I have a problem / question. I have built a 1.1 C# application which in this
case is being used from a Non-Managed application as a plug-in. So this app
I have written is a DLL that has a Form that is used as a property page. In
the creation of this form we set the parent window through an interface the
main applicaiton has provided. which does the following:
public void Activate(IntPtr wndParent, ref Rectangle rect, bool modal)
{
// Make us a child of the given parent, and remove all window styles
except WS_CHILD
SetParent(Handle, wndParent);
SetWindowLong(Handle, -16, 0x40000000);
OnPageActivate(wndParent, rect, modal); // inform derived class
}
Now when this occurs our property page displays correctly however now all
the arrow keys act just like a tab key and I think it has to do something
with Managed code used from non-managed app. Not sure though. All I have is
a drop-down and two text boxes. The way I found to fix the problem (kind of)
is to override the ProcessCmdKeys like so:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// TODO: Add frmHelloProperties.ProcessCmdKey implementation
if (keyData == Keys.Left || keyData == Keys.Right || keyData ==
Keys.Up || keyData == Keys.Down)
{
return true;
}
return base.ProcessCmdKey (ref msg, keyData);
}
The problem is now what if I want to use the arrow keys, say to navigate my
drop-down and such.
Have you guys ever heard of this? Do I need to use something like
Windowless controls or something? I am trying to figure out what behavior
would cause such a thing.
If you need more info please let me know and I'll provide it.
Thanks.
|