Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Drawing Outside The Form

Drawing Outside The Form

Scheduled Pinned Locked Moved Graphics
comgraphicstoolstutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    The ANZAC
    wrote on last edited by
    #1

    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

    D S 2 Replies Last reply
    0
    • T The ANZAC

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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

        T Offline
        T Offline
        The ANZAC
        wrote on last edited by
        #3

        ok then thanks.

        Please check out my articles: The ANZAC's articles

        1 Reply Last reply
        0
        • T The ANZAC

          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

          S Offline
          S Offline
          Smithers Jones
          wrote on last edited by
          #4

          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)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups