> I'd like to create a control that's top-level, i.e. parented by the
> Windows desktop - something like a tooltip or menu.
[quoted text clipped - 4 lines]
> There must be an easy way to create a true top-level control in Windows
> Forms that isn't hosted/parented by a Windows Forms form.
Hi Nick
I say "there must be an easy way" because, firstly, a form is a control,
as a component is a control. To Windows, they're all just window
handles. I've been programming Windows for 20+ years, since the Petzold
days. So I expect there must be a way to create a control that doesn't
have to be hosted in a form. Like I said, a *form* is a control that's
not hosted in a form, so there is a way.
If it's not easy, it must be because WinForms is going out of its way to
make it not easy, since there's no intrinsic reason why it should be hard.
Cheers,
MikeS.
>> I'd like to create a control that's top-level, i.e. parented by the
>> Windows desktop - something like a tooltip or menu.
[quoted text clipped - 14 lines]
> I suspect that what you want is simply to create a form and turn off the
> borders and title (f.FormBorderStyle = FormBorderStyle.None)
Chris Dunaway - 02 Mar 2006 18:01 GMT
Have you looked at the NativeWindow class? Perhaps that will help you.
Nick Hounsome - 02 Mar 2006 18:53 GMT
Hi Mike,
A Component is NOT a Control.
Tooltip is a Component and therefore is not a control and has no handle.
Obviously the visual bit that it controls does have a handle but you can't
get at it and I see no reason to believe (other than simplicity) that it
isn't a form with the border turned off.
What about my suggestion of using a form with the border turned off?
Or NativeWindow if you must.
> Hi Nick
>
[quoted text clipped - 30 lines]
>> I suspect that what you want is simply to create a form and turn off the
>> borders and title (f.FormBorderStyle = FormBorderStyle.None)
Mike Scott - 03 Mar 2006 09:51 GMT
Hi Nick
Sorry, you're right about component. However, a form is a control and it
can be top-level.
As for using a form with no border - tried that! That's what my other
thread is about "Zero-sized form" that you've been participating in :-)
Ideally I just need a control, not a form though that obviously works.
This is partly a learning exercise - I can do it easily in native
Windows and I'm trying to figure out how to do it in WinForms.
Thanks for your help.
MikeS.
> Hi Mike,
>
[quoted text clipped - 42 lines]
>>> I suspect that what you want is simply to create a form and turn off the
>>> borders and title (f.FormBorderStyle = FormBorderStyle.None)