Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Allow 2 decimal points / dots in textbox using c#
Ankush
Mar 15 2016 1:24 AM
352
Reply
I am developing a windows application using c#.
The user enters a website name which should allow only 2 dots for eg www.google.com
I have written but that is accepting only 1 dot. The code I have written is :-
if
((e.KeyChar ==
'.'
) && ((sender
as
TextBox).Text.IndexOf(
'.'
) > -1))
{
e.Handled =
true
;
}
Thanks in Advance ...!!!
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
How to get number of days in between two dates
retrieve data from multiple tables using datetimepicker