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. C#
  4. Button Click -> to Paint handler??

Button Click -> to Paint handler??

Scheduled Pinned Locked Moved C#
questiongraphics
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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    I have a button that when clicked will draw a line on a Form. How do I pass to the Paint handler that the button was clicked to DrawLine, since I should do all my drawing inside the Paint handler? i.e... // btn_OK_Click { /// g.DrawLine(..... } // private void On_Paint { //btn_OK_Click ?? }

    A 1 Reply Last reply
    0
    • A Anonymous

      I have a button that when clicked will draw a line on a Form. How do I pass to the Paint handler that the button was clicked to DrawLine, since I should do all my drawing inside the Paint handler? i.e... // btn_OK_Click { /// g.DrawLine(..... } // private void On_Paint { //btn_OK_Click ?? }

      A Offline
      A Offline
      Ashok Dhamija
      wrote on last edited by
      #2

      You can use Invalidate method in the button click event handler which will repaint the window; so in the OnPaint you can put the code for drawing the line. Regards, Ashok Dhamija _____________________________ Padam Technologies

      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