Reputation: 21599
I need to provide a Windows Forms control to a native application (Visual Studio).
So I create a control and provide its handle.
Then, when I check the native window using Spy++, I see that my control is wrapped in additional 'control' with window class = "Static" and title "This is a static!". I have several problems with it:
WS_EX_CONTROLPARENT
, which causes KB149501 to appear (in short, whole application hangs on lost focus).WS_EX_CONTROLPARENT
, listbox within the static stops redrawing.I think I have been doing something wrong, but I am not sure what. Google does not help, since static is a C# keyword as well so it occurs quite often in WinForms results.
Upvotes: 1
Views: 509
Reputation: 21599
I mostly solved the redrawing problem using DoubleBuffered=True, so probably this is it.
I still think I am doing something wrong, but at least it works now.
Upvotes: 0