Results 1 to 6 of 6

Thread: If text line starts with # then...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Utah
    Posts
    397

    If text line starts with # then...

    I have a RichTextBox and a Drop Down List, if the users types something like:
    #hello
    then it add the # and everything after the # into the drop down list, and then if they select one that has been added to the drop down list, then it will goto the line that has the string that they selected from the dropdownlist.

    well... i think that made sense...

    any suggestions?

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    VB Code:
    1. if Left(strString,1) = "#" Then
    2.      Msgbox "strString starts with #"
    3. end If
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Utah
    Posts
    397
    that doesn't work...

    i dont get an error or anything, it jsut doesn't do anything

    i have
    VB Code:
    1. Private Sub RTB_change()
    2.     Dim strString As String
    3.  
    4.     If Left(strString, 1) = "#" Then
    5.         MsgBox "strString starts with #"
    6.     End If
    7.  
    8. End Sub
    Last edited by Narfy; Oct 12th, 2003 at 06:28 PM.

  4. #4
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    Of course it doesn't work, you haven't set strString to anything (ie, strString = "", more or less); You have to replace strString with whatever you want to test. All he was doing was offering an example of how to test if a string starts with "#".
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Utah
    Posts
    397
    lol, im stupid (like always)

    thanks

  6. #6
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    lol

    Any time
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

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