|
-
Sep 2nd, 2012, 03:59 PM
#1
Thread Starter
Lively Member
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!
-
Sep 2nd, 2012, 04:10 PM
#2
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!
-
Sep 2nd, 2012, 04:23 PM
#3
Thread Starter
Lively Member
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
-
Sep 2nd, 2012, 04:29 PM
#4
Re: Ghost value in textbox
Yup, and strangely enough it's TextBox1.Text.Trim()
-
Sep 2nd, 2012, 05:33 PM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|