tags:

views:

134

answers:

1

here is the code in c# to allow only one decimal point in a textbox..

if textbox5.text.contains(".") && e.keychar="." { e.handled=true }

i have to use it in vb.net 2003 version..how can i use it..it does not allows to use conatins property.. how to do it..

+1  A: 

How about using the Text.IndexOf(".") Method instead? If it returns >=0 then you already have a decimal point.

If (textbox5.Text.IndexOf(".") >= 0 And e.KeyChar = ".") Then e.Handled = True
Raithlin
thanks alot.....it really worked..
ren, i'm gonna ask you to go ahead and mark this the accepted answer, mkay.
Marcus