How to focus cursor using next control

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

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)
{
this.ProcessTabKey(true);
}
return base.ProcessKeyPreview(ref m);
}

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

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

Up
0
Down
Hello,

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.


Thanks.

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

Login to post response