I
Iulian Ionescu
Hi, I have the following problem: I designed a control
that acts similar to a combo box by dropping a small
window on click with some content. The control has a
private member of type ContainerPanel, which is a type I
defined as derived from form. I set all the properties
for this type so that it acts like a floating window (no
frame, no show in task bar, etc...). I override
OnActivate and set the focus back to the owner (which is
always the form that the controls lies on). However, when
the window is shown there is a very small flicker,
because for a fraction of a second the main form looses
focus and then gets it back. Is there any way to prevent
that? Should I use DestroyHandle to make sure the
floating window cannot receive focus?
I use the following routine to show the window:
NativeMethods.ShowWindow((IntPtr)base.Handle, 8);
then I have this:
protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
if (base.Owner != null)
{
base.Owner.Focus();
}
}
I would appreciate any ideas,
Thank you!
Iulian
that acts similar to a combo box by dropping a small
window on click with some content. The control has a
private member of type ContainerPanel, which is a type I
defined as derived from form. I set all the properties
for this type so that it acts like a floating window (no
frame, no show in task bar, etc...). I override
OnActivate and set the focus back to the owner (which is
always the form that the controls lies on). However, when
the window is shown there is a very small flicker,
because for a fraction of a second the main form looses
focus and then gets it back. Is there any way to prevent
that? Should I use DestroyHandle to make sure the
floating window cannot receive focus?
I use the following routine to show the window:
NativeMethods.ShowWindow((IntPtr)base.Handle, 8);
then I have this:
protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
if (base.Owner != null)
{
base.Owner.Focus();
}
}
I would appreciate any ideas,
Thank you!
Iulian