Q: number in the textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I grantee that user enter only number in the textbox. If possible
accept ","and "." in the number. Can I do this?
 
JIM.H. said:
How can I grantee that user enter only number in the textbox. If possible
accept ","and "." in the number. Can I do this?

Take a look at the validator controls. You can validate that the textbox is
non-empty, has a number in it and you can even validate that the number be
within a particular range of values.

John Saunders
 
can someone give me validation string?

John Saunders said:
Take a look at the validator controls. You can validate that the textbox is
non-empty, has a number in it and you can even validate that the number be
within a particular range of values.

John Saunders
 
JIM.H. said:
can someone give me validation string?

It's not just a simple string. You should spend a little time reading about
the Validation controls, otherwise any "validation string" won't help you.

Do you need a pointer to the MSDN documentation on the validation controls?

John Saunders
 
that might help. I have another related question, I defined myVar as double
and it seems myVar=myTextBox.Text statement converts text to double without
problem. Do you see any problem in that?
 
JIM.H. said:
that might help. I have another related question, I defined myVar as
double
and it seems myVar=myTextBox.Text statement converts text to double
without
problem. Do you see any problem in that?

Yes. Don't let VB.NET do such things for you. Turn "Options Strict On", and
decide for yourself what the relationship is between text and string.

I suggest that Options Strict be turned on always except possibly at the
very beginning of a migration from ASP.

John Saunders
 

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

Similar Threads

Access Dateadd function question.. 0
mask to textbox 2
Enter behaviour on textbox 2
add textbox values 4
how to enter phone number in special format? 3
delete text in a textbox 3
RegularExpression? 1
Input mask for TextBoxes 1

Back
Top