Results 1 to 2 of 2

Thread: onclick handler for drawed objects

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Posts
    231

    onclick handler for drawed objects

    Hello,I have two dimentianal array which I visualizate on screen this way:
    Code:
     g.DrawImage(img, col * BALLON_CELL_SIZE, row * BALLON_CELL_SIZE);
    Where BALLON_CELL_SIZE is 30.
    How can I attach on each drawed image a onclick method ?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: onclick handler for drawed objects

    You can't because there is no object. GDI+ drawing is simply coloured pixels. What you need to do is to handle the appropriate event of the object they are drawn on, e.g. form or PictureBox, determine whether the mouse pointer is within the bounds of the drawing and then act accordingly. For an example of this, follow the CodeBank link in my signature and check out my thread on Manipulating GDI+ Drawings.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width