How to focus cursor using next control

Posted by Jayakumars under ASP.NET on 8/23/2014 | Points: 10 | Views : 322 | Status : [Member] [MVP] | Replies : 1

I have used keypress event for controls. But when using multilinetextbox control while entering next line it is switching to the next control so how to restrict that.

protected override bool ProcessKeyPreview(ref Message m)
if (m.Msg == 0x0100 && (int) m.WParam == 13)
return base.ProcessKeyPreview(ref m);

Mark as Answer if its helpful to you
EmailId :


Posted by: Dotnet_EVIL on: 8/28/2014 [Member] Starter | Points: 25


Entering new line by pressing Enter key, is natural and we do not need to make a multiline textbox control bound to accept the new line characters.

It may be that, there is some code, written by you, for the same multiline textbox control's keypress event, which may be for some other functionality to be achieved, which is opposing the same multiline textbox control to behave this way.


Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response