Results 1 to 3 of 3

Thread: Help with small project! visual basic 2005

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    1

    Smile Help with small project! visual basic 2005

    Hello all, I am currently taking a visual basic class and have found myself really stumped for the first time with a project. If it helps anyone I am using the book Visual Basic 2005, sixth edition by David Schneider.

    Here is the project I am having a lot of trouble getting to work.

    Section 3.4 #48

    48) Write a program that requests a letter, converts it to uppercase, and gives its first position in the sentence "THE QUICK BROWN FOX JUMPS OVER A LAZY DOG." For example, if the user responds by typing "b" into the text box, then the message "B first occurs in position 10." is displayed.

    My main question is how do I make the input of one textbook be affected by the action of pushing my action button produce a certain output in another textbook. I have had trouble with the somewhat similar examples in my book and any advice or tips would be greatly appreciated!

    Also the teacher also said to use the programming tools "toupper" and "indexof".

    Any help would be greatly appreciated!

  2. #2

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Help with small project! visual basic 2005

    vb Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.     Dim str As String = "THE QUICK BROWN FOX JUMPS OVER A LAZY DOG."
    3.     TextBox2.Text = TextBox1.Text.ToUpper & " first occurs in position " & str.IndexOf(TextBox1.Text.ToUpper).ToString
    4. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width