How to paint off the form?

T

Tomas Machala

Hi,
Is there a way how to paint some lines via GDI to some place on the screen,
even off the application form?
Also, how do I make that lines 'topmost' to be uncoverable by any other
application?
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Tomas,
Hi,
Is there a way how to paint some lines via GDI to some place on the
screen, even off the application form?

Normally applications have limit their drawing to there own client area. It
is possible to obtain HDC to the entire screen and then attached to a
Graphics object and draw all over the screen, but this involves uing PInvoke
and inmanaged API (look at GetDCEx)

You can also use ControlPaint class and its methods DrawReversibleLine and
FillReversibleRectangle to draw on the screen, but this is as much as you
can get from managed code.
Also, how do I make that lines 'topmost' to be uncoverable by any other
application?

To make the form staying on the top of all normal windows set form's TopMost
to *true*. It places the form over all windows that are not top most. If two
top most widnows are on the floor the active one is obove the inactive.
There is no way you can set a form that stays over all other windows.
Internesting what would happen if two such forms are shown at the same time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top