Results 1 to 5 of 5

Thread: Ghost value in textbox

  1. #1
    Lively Member
    Join Date
    Jul 12
    Posts
    111

    Ghost value in textbox

    Hi, I have an empty textbox .
    Now this is very weird!

    Code:
     If textbox1.Text <> "" Then
                MsgBox("It's not empty")
            Else
                MsgBox("It's empty")
            End If
    I dont write anything in the textbox but it still says "it's not empty!" if I put the cursor in the text field and press
    "delete" even though i didn't write anything, it then says " it's empty!" .
    Weird stuff!

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 12
    Posts
    5,984

    Re: Ghost value in textbox

    Spaces are characters too! In a multiline box returns are characters too too! Tabs are characters too too also! Just because you can't see it, doesn't mean it's not there!

  3. #3
    Lively Member
    Join Date
    Jul 12
    Posts
    111

    Re: Ghost value in textbox

    Yes. the problem was in the text properties box. I deletedwht seemed to be a blank space.
    It's working now.
    Is there a function like PHP "trim()" to trim spaces or any other to prevent it interpreting spaces as characters?

    Thanks

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 12
    Posts
    5,984

    Re: Ghost value in textbox

    Yup, and strangely enough it's TextBox1.Text.Trim()

  5. #5
    Lively Member
    Join Date
    Jul 12
    Posts
    111

    Re: Ghost value in textbox

    lol
    Cheers

Posting Permissions

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