Click to See Complete Forum and Search --> : C# Controls


khullaryogesh@rediffmail.com
June 6th, 2005, 02:25 AM
Hi All,

I am working on C# UI .I want to restrict the user from entering any things in the controls like TextBox and at the same time I do not want to give him the feeling that Control is Disabled .
If any one has any idea please let me know
Yogesh K

Shuja Ali
June 6th, 2005, 03:14 AM
Hi All,

I am working on C# UI .I want to restrict the user from entering any things in the controls like TextBox and at the same time I do not want to give him the feeling that Control is Disabled .
If any one has any idea please let me know
Yogesh K
Create an event for KeyPress and in that event set e.Handled = true; something like this..

private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
e.Handled=true;
}

Now whatever you type, it will not be displayed in the textbox..:)