Tab Key does not work in usercontrol

  • Thread starter Thread starter Saurabh
  • Start date Start date
S

Saurabh

I have a control derived from the usercontrol. When I use this control on
the form, the tab key does not work within the control. I mean I cannot
navigate from one editbox to next editbox using the tab key. I also have
combo boxes in the control and the arrow keys do move the selection up and
down within the comboboxes. What am I doing wrong ?

TIA,

--Saurabh
 
Please ignore the previous post, the reason for tabkey not working is, the
..NET form is set as a child of the Win32 application and thats probably the
reason whyc the form is not getting tab key. Does anyone have an idea as to
how to achieve this?

TIA,

--Saurabh
 
Saurabh,

If your Win32 app is written in VC++ then its possible to achieve it by
handling the PreTranslateMessage event. Using these SDK commands you shd be
able to move to the next Tab style value.

HWND GetNextDlgTabItem(

HWND hDlg,
HWND hCtl,
BOOL bPrevious
);
Get the HWND & pass it to this func
void GotoDlgCtrl(
HWND hWndCtrl
) const throw();

Thanks,
Vijai
 
My Win32 App is written in VC++ which exposes an automation interface. I do
not have source to the main application.

Anyways, What I've done now is I associated a KeyDown handler with all of my
individual controls and on tab press I am calling SelectNextControl from the
form. It works perfect in forward direction but in reverse direction the
focus does not complete the full circle. For example when it reaches the
combo box, you cannot shift + tab out of it but you can tab out of it.

Do you know why this might be happening?

TIA,

--Saurabh
 
Back
Top