Drawing Outside The Form
-
Not sure if this can be done simply, but hoping it can be. I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form. Can anyone provide guidance or even an example?
Please check out my articles: The ANZAC's articles
-
Not sure if this can be done simply, but hoping it can be. I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form. Can anyone provide guidance or even an example?
Please check out my articles: The ANZAC's articles
The ANZAC wrote:
I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form.
You can't. You can only draw on your form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
The ANZAC wrote:
I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form.
You can't. You can only draw on your form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007ok then thanks.
Please check out my articles: The ANZAC's articles
-
Not sure if this can be done simply, but hoping it can be. I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form. Can anyone provide guidance or even an example?
Please check out my articles: The ANZAC's articles
i don't know, if this is what you are looking for, but i found that piece of vb.net-code on a cd:
Private Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Integer) As IntPtr Private Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As Integer, ByVal hdc As IntPtr) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim blackPen As New Pen(Color.Black, 3) Dim dc As IntPtr Dim g As Graphics Dim rnd As New Random() Dim i As Integer dc = GetDC(0) g = Graphics.FromHdc(dc) For i = 0 To 1000 g.DrawLine(blackPen, rnd.Next(600), rnd.Next(600), rnd.Next(600), rnd.Next(600)) Next g.Dispose() ReleaseDC(0, dc) End Sub
click on the button to draw a bunch of lines to the screen, independent of your form. is this of any help?"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)