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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. drawing line

drawing line

Scheduled Pinned Locked Moved Visual Basic
graphicsquestionannouncement
3 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.
  • D Offline
    D Offline
    dkosasih
    wrote on last edited by
    #1

    dear fellow programmers, i have been trying to achieve this but it's so hard. i am trying to say make an image and when i mouse down the image and drag it, i want to draw a line from the initial of the image to where my mouse is. and when i release it, the line will disappear. is there anyway I can achieve this? thanks all...

    D C 2 Replies Last reply
    0
    • D dkosasih

      dear fellow programmers, i have been trying to achieve this but it's so hard. i am trying to say make an image and when i mouse down the image and drag it, i want to draw a line from the initial of the image to where my mouse is. and when i release it, the line will disappear. is there anyway I can achieve this? thanks all...

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      You need to draw the line in the Paint event of the form.

      जय हिंद

      1 Reply Last reply
      0
      • D dkosasih

        dear fellow programmers, i have been trying to achieve this but it's so hard. i am trying to say make an image and when i mouse down the image and drag it, i want to draw a line from the initial of the image to where my mouse is. and when i release it, the line will disappear. is there anyway I can achieve this? thanks all...

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        There's paint program samples that will show you how to do this. You need to store the mouse position in member variables, and then do what danish said, draw them in your paint event. Except, as you want the line to disappear when the mouse comes up, this is actually a place where the CreateGraphics method of the form is valid, it's used to create a graphics object on which to draw temporary things.

        Christian Graus Driven to the arms of OSX by Vista.

        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