Accepting Tab
-
I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors." -
I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors."Have you just tried to reset the focus back to your control at that point? Nick Parker
-
Have you just tried to reset the focus back to your control at that point? Nick Parker
yes, and it does not work.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors." -
I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors."I don;t think that this is something that could be done at the control level. Using tab to move from control to control is IMHO more of a form level process. I would hate to think that a control would be allowed to grab focus and not let it go like that. If you want to achive it at the form level just set the tabstop property of all the other controls to false and focus will have no where to go. If you are trying to do this in a custom control you are writing then I don't think that you can.
-
I don;t think that this is something that could be done at the control level. Using tab to move from control to control is IMHO more of a form level process. I would hate to think that a control would be allowed to grab focus and not let it go like that. If you want to achive it at the form level just set the tabstop property of all the other controls to false and focus will have no where to go. If you are trying to do this in a custom control you are writing then I don't think that you can.
it must be possible, im sure the TextBox/RichTextBox classes that come with the frameowkr can do it.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors." -
it must be possible, im sure the TextBox/RichTextBox classes that come with the frameowkr can do it.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors."Hmmmm you learn someting new every day I guess. I never noticed that the RichText control has a AcceptsTab property....
-
I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors." -
Did you try KeyDown instead of KeyPress? Are you canceling the event in your handler with SystemEventArgs.Cancel? Bill F
i was always using KeyDown, but i didnt try cancelling the event, ill try that.
:suss: Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk
:suss:"All programmers are playwrights and all computers are lousy actors."