S
sverre.bakke
Hi
I am using a multiline textbox with wordwrapping for creating "large"
texts, but I dont want the user to be able to create a new line. The
property called SuppressKeyPress seem to be the perfect way to solve
this using the KeyDown event. It doesnt work.
My code looks like this:
if (e.KeyCode == Keys.Enter)
{
e.SuppressKeyPress = true; //doesnt work
MessageBox.Show("yes I pushed enter and
SuppressKeyPress was changed");
}
But still it doesnt work. After reading MSDN I am sure that there is
something MSDN hasnt told me about SuppressKeyPress or there are some
sort of bug, cause I cant get this to work.
Thanks in advance for the help.
I am using a multiline textbox with wordwrapping for creating "large"
texts, but I dont want the user to be able to create a new line. The
property called SuppressKeyPress seem to be the perfect way to solve
this using the KeyDown event. It doesnt work.
My code looks like this:
if (e.KeyCode == Keys.Enter)
{
e.SuppressKeyPress = true; //doesnt work
MessageBox.Show("yes I pushed enter and
SuppressKeyPress was changed");
}
But still it doesnt work. After reading MSDN I am sure that there is
something MSDN hasnt told me about SuppressKeyPress or there are some
sort of bug, cause I cant get this to work.
Thanks in advance for the help.