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;
- }

Kunal PatelRank #1,359 · 1.2K reputationPosted Mar 14, 2016, 9:34 PM EDT
http://stackoverflow.com/questions/9967558/only-allow-two-digits-after-decimal-in-textbox
Amit KumarRank #459 · 5.4K reputationPosted Mar 14, 2016, 9:36 PM EDT
AnkushRank #8,005 · 230 reputationPosted Mar 14, 2016, 9:51 PM EDT
Amit Kumar SinghRank #562 · 4.3K reputationPosted Mar 14, 2016, 9:55 PM EDT