hello... i have quite a good idea of java and C sharp... previously i worked in c++ and over there in order to make a string appear in the text box i had to program it manually that is i made a string. Same was the case in java, text in textboxes were shown by programing the event (keypressed or keyup) in the manner that it would form a string. but here in c sharp the textbox string is made automatically ie when i make the text box object i dont really need to attach an event to it to make strings.
My questions are:
1. is this handler already implemented in the textboxbase class? if not where is it implemented?
2. i want to change the handler? do i have to override any member or property? if yes plz provide the name of the member or property...
actually i want my text box to produce a beep when the first character is inserted as a number. also i want not to allow the special characters, though i want underscore to be implemented . please provide an insight
thanx...
praveen kumarPosted Mar 22, 2006, 5:07 AM
Craig MurphyPosted Mar 15, 2006, 5:13 PM
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length > 0){
Char c = textBox1.Text[0]; int n = System.Convert.ToInt16(c); // 0-9 test if ( (n>=48) & n<=57) Console.Beep();}
}
HTH
Ajnavi RaniPosted Mar 13, 2006, 3:26 PM