-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>5ywHB/dgkUStAiKjTE/f5w==</Id>
To draw on the desktop you need a wee bit of interop to import the GetDC and
ReleaseDC methods. Get a DC for the desktop using null as a window handle,
wrap the returned DC in a Graphics object using Graphics.FromHdc, Draw on
the desktop, dispose of the Graphics object and release the DC again.
If you search in the VB group you'll find an answer I gave someone an answer
with a layered window solution.
The post was dated 30th march and entitled "Re: Using The NativeWindow Class
To Draw A GDI Type Circle On Top Of A DataGrid Possibly In The Override
OnPaint"
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Chris Pursley via .NET 247" <anon...@dotnet247.com> wrote in message
news:elFOniHP...@TK2MSFTNGP09.phx.gbl...
Controls cannot draw over their children because by default all windows have
WS_CLIPCHILDREN style set. With this style all space occupied by child
controls is clipped off of the control's client area.
What one can do in this case is to override CreateParams virtual property
and exlude this flag from the styles that the base implenetation returns
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style &= (~WS_CLIPCHILDREN);
return cp;
}
WS_CLIPCHILDREN is 0x02000000
This won't work though for controls, which are outside the client rectangle
such as scrollbars, menu, etc
--
Stoitcho Goutsev (100) [C# MVP]
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:uYqm20IP...@TK2MSFTNGP14.phx.gbl...