OLE controls and Tab
Vijai Singh -- vsingh@m-net.arbornet.org
Wednesday, November 27, 1996
Environment: Win 95, Visual C++ 4.2 flat
>Hi,
>
>I am trying to put a modeless dialog box as a child of another dialog box,
>the child dialog box has CONTROL property set (available during designing
>of dialog box, in the property box) and it's parent dialog has CONTROL PARENT
>style set. Then I drop in few normal(Not OLE or VBX) controls in the dialogs.
>the dialogs work fine and the child dialog works just like another control
>in the dialog box and doesn't blocks the tab.
>
>But now if I drop in a OLE control in the child dialog box it blocks the TAB
>and focus will never come out of the child dialog box.
>
>what is this special behaviour with OLE controls, and how can it be overcome.
>keeping every thing else same specially control and control parent styles.
>
>I am using Visual C++ 4.2 and don't have MSDN
>
>Thanks
Logan Gilbert -- lgilbert@maxserv.com
Wednesday, December 04, 1996
I've had a problem similiar to this and I resolved it by doing this:=20
Subclass the controls you insert in your dialog ( create your own class =
derived from CEdit for example ) and catch the Tabs within your control =
by catching WM_KEYDOWN messages and doing the following bit of code:
void CMyEditCtl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if ( (nChar =3D=3D VK_TAB) && (GetKeyState(VK_SHIFT) < 0) ) //Shift-Tab =
was pressed
{
((CDialog*)GetOwner())->PrevDlgCtrl();
}
else if (nChar =3D=3D VK_TAB) // Tab was pressed
{
((CDialog*)GetOwner())->NextDlgCtrl();
}=20
}
This maybe of some help. My problem was with a OLE Control, inserted =
into a container. The control fires off a modeless dialog. The tab =
messages get sucked up by the container of the control, not by the =
control or its modeless dialog.
----------
From: Vijai Singh
Sent: Wednesday, November 27, 1996 2:23 PM
To: mfc-l@netcom.com
Subject: OLE controls and Tab
Environment: Win 95, Visual C++ 4.2 flat
>Hi,
>
>I am trying to put a modeless dialog box as a child of another dialog =
box,
>the child dialog box has CONTROL property set (available during =
designing
>of dialog box, in the property box) and it's parent dialog has CONTROL =
PARENT
>style set. Then I drop in few normal(Not OLE or VBX) controls in the =
dialogs.
>the dialogs work fine and the child dialog works just like another =
control=20
>in the dialog box and doesn't blocks the tab.
>
>But now if I drop in a OLE control in the child dialog box it blocks =
the TAB
>and focus will never come out of the child dialog box.
>
>what is this special behaviour with OLE controls, and how can it be =
overcome.
>keeping every thing else same specially control and control parent =
styles.
>
>I am using Visual C++ 4.2 and don't have MSDN
>
>Thanks
| Вернуться в корень Архива
|