What does a TextBox return?

  • Thread starter Thread starter antonyliu2002
  • Start date Start date
A

antonyliu2002

I know it returns the string that fills the TextBox.

What does it return when nothing is put into the TextBox? The empty
string ""? Or Null? Or Nothing?

I haven't been able to figure it out.
 
Empty string.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
You can always check to see if any text was entered by checking

if Textbox.Text.length = 0 Then
'whatever
End If

Another option is

If Textbox.Text.Equals(String.Empty) Then
'whatever
End If

HTH,

Joe
 
Hmm, this is new to me. And it sounds cool. Will definitely give it a
shot!

I've tried this:

If myTextBox.Text = "" Then
'Do something
End If

Don't know if this worked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top