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. Web Development
  3. ASP.NET
  4. redraw line drawn at runtime

redraw line drawn at runtime

Scheduled Pinned Locked Moved ASP.NET
graphicshelptutorial
2 Posts 2 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.
  • M Offline
    M Offline
    mats_mathai
    wrote on last edited by
    #1

    hi, i need to know how to redraw a line drawn at runtime on a windows form control.the problem i'm facing is that evrytime the scrollbar is moved the line drawn dissappears. i cannot add the line drawing to the onpaint method as the line is created in reponse to a mouse click event. Thanks, mats_mathai.

    J 1 Reply Last reply
    0
    • M mats_mathai

      hi, i need to know how to redraw a line drawn at runtime on a windows form control.the problem i'm facing is that evrytime the scrollbar is moved the line drawn dissappears. i cannot add the line drawing to the onpaint method as the line is created in reponse to a mouse click event. Thanks, mats_mathai.

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      In the future, you'll probably get a much better response if you posted this to the C# forum instead of here. This forum is for ASP.NET questions, and yours is WinForm based. That being said, you will have to redraw the line in the OnPaint method when the form is repainted. Scrolling the form is one of the things that will cause a form to repaint, which is clearing the line you draw in the mouse event handler. What I would recommend is that you continue to draw the line initially in the mouse event handler, but keep a member level variable or two populated with the needed information so that you know when and how to redraw the line from OnPaint. Hope that helps. :) --Jesse

      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