Textbox Input Catching

V

vb6dev2003

Hi,

I would like to prevent a user from entering data in a textbox (BUT not
read-only) by catching the OnBeforeChange in managed code. Can we catch the
ascii input and reset some or all of the characters typed to nothing?

Thanks.

vbdev2003
 
M

Michelle

In the OnBeforeChange event of the textbox, try something like:
if (e.NewValue.ToString() != "")
{
string strNewVal = e.NewValue.ToString();
//perform string manipulation on the value here
//and then set the nodevalue
e.Source.text = strNewVal;
}

Michelle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top