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. Rectangle onclick event

Rectangle onclick event

Scheduled Pinned Locked Moved C#
graphicshelptutorialquestion
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.
  • R Offline
    R Offline
    reshsilk
    wrote on last edited by
    #1

    Hello, I am drawing a table in the OnPaint method of a windows form. I would like to add Rectangles to the page that will fire an onclick event when I click on them. Does anybody know how to accomplish this? As far as I can see, the rectangle object doesn't have that kind of functionality built in... I originally just tried using buttons, but since I need quite a few of them, it is taking too long to draw them. Thanks for your help! RC

    J 1 Reply Last reply
    0
    • R reshsilk

      Hello, I am drawing a table in the OnPaint method of a windows form. I would like to add Rectangles to the page that will fire an onclick event when I click on them. Does anybody know how to accomplish this? As far as I can see, the rectangle object doesn't have that kind of functionality built in... I originally just tried using buttons, but since I need quite a few of them, it is taking too long to draw them. Thanks for your help! RC

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      VS 2005 has a new control called "TableLayoutPanel". You may want to try this before writing your own rectangles. The panel certainly supports click events. Check this CP article[^]. Best, Jun

      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