Blank textbox.text value

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Jun 30, 2007.

  1. Cableguy

    Cableguy Expert Licensed User

    How to trap a blank textbox.text value?

    I have tryed "" but it doesn work...

    I need a textbox.text to BE something starting with a letter!
     
  2. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Hello CableGuy,

    This works for me....
    Code:
    Sub Globals

    End Sub

    Sub App_Start
       Form1.Show
    End Sub

    Sub Form1_MouseDown (x,y)
     
    If TextBox1.Text="" Then
     
    MsgBox("Works")
     
    End If
    End Sub
    Just add a TextBox1 with no text to From1 and try for yourself.
    I fear that you must be doing something else wrong.

    Regards,
    RandomCoder
     
  3. Scubaticus

    Scubaticus Active Member Licensed User

    This works, but a trim would be very handy ;)

    x = strLength (txtString.Text)
    y = " " (lot of space chars)


    if (txtString.Text = "") Or ( subString(txtString.Text,0, x) = subString(y,0,x) ) then String has all spaces or is empty

    Scub
     
  4. Cableguy

    Cableguy Expert Licensed User

    Thanks Guys

    You were right, I was testig for textbox.text = "" when I should be testing for textbox.text <> ""

    Thats what happens when you try to code for 4 hours stright....ending at 1AM...:sign0013:
     
  5. Scubaticus

    Scubaticus Active Member Licensed User

    When I told you how many hours I'm behind my screen.... I never had a PPC but want to archive fishing details (including GPS tracking etc.). Now I have a PPC and B4ppc and want to finish my program. For me it's Work-B4ppc-Sleep and repeating since the last week :sign0148:

    But it's a lot of fun!

    So for all my stupid questions the next few days :sign0013:

    Scub
     
  6. RandomCoder

    RandomCoder Well-Known Member Licensed User

    You lightweight ;)

    Regards,
    RandomCoder.
     
Loading...