• home
  • forum
  • my
  • kt
  • download
  • How to reverse a string

    Author: 2008-09-13 09:52:15 From:

    When you've done that, it should prompt you with a dialog box asking you what type of project you want to make. Choose Standard EXE and press open.

    First Step.

    Once you have done that, you should have something that looks like this:

    Step 2.

    Now we are going to set up the design of the application. To do this we are going to need one Command button and one Text box

    We need to, to start off our design, insert the Command button (in green below) an insert the text box (in blue). Click on the appropriate button and then bring the mouse over to the form and drag.

    Step 5

    We now need to name the controls so that we can keep track of them when we're coding and we know what they do. Click on the command button on your form and go to the bottom right hand side. There is a properties box. Click on the name tab and change it to 'cmdReverse':

    Then change the caption to something like "Reverse String." Do the same for the textbox but name it "txtReverse." You can change the test displayed in there on run-time, when the program is running and in the properties toolbox. Scroooooll down to the Text tab and change it to something you want.

    Time to code :D

    Double click on the Command Button. It should come up with some code like this:

    Private Sub cmdReverse_Click()()

    End Sub

    In the middle of this, insert this code

    txtReverse.Text =StrReverse(txtReverse.Text)

    You should now have this code

    Private Sub Form_Load()
    txtReverse.Text = StrReverse(txtReverse.Text)
    End Sub

    What this is telling the application to do is, when the command button is pressed it tells the app. to reverse the string. The string here is txtReverse.text and output the result to the same textbox.

    Now press F5. This will run your application. Alternitivly you can press this button (the one highlighted in blue):

    When you do this, you should enter text in the textbox and then click the button. If the text was, "Ebonez.info" then your outputted result should be, "ofni.zenobE"

    When you are done with your application, exit out of it and save.

     

    Download Project

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      .NET (8)
      Buttons (3)
      Database Related (7)
      Date and Time (1)
      Development (3)
      Error Handling (2)
      File Manipulation (5)
      Introduction to Visual Basic (23)
      Miscellaneous (3)
      Multimedia (10)
      Networking (10)
      Security (1)
      VB Script (6)

    New

    Hot