I have a task, my textbox accepts only first character capital lettr and remaing characters normal.
Asked
Active
Viewed 1,683 times
0
-
Welcome to Stack Overflow! [What have you tried?](http://whathaveyoutried.com) – Matt Ball Dec 04 '12 at 05:02
1 Answers
1
Use KeyPress event of textbox:
private void txt_KeyPress(object sender, KeyPressEventArgs e) { if (txt.Text != "" && !Char.IsUpper(txt.Text, 0)) { txt.Text = Char.ToUpper(txt.Text[0]) + txt.Text.Substring(1); } }

suco2007
- 131
- 1
- 7
-
thanks for reply but its working reverse what is my requirement,my requirerment is first character should be capital letter – user1858718 Dec 04 '12 at 05:33