Clickable C # Image Card

I am making a C # inventory application. However, I want there to be a map in which the user can click on several areas and interact with inventory in that specific area.

Currently, I was photographing a map and made it a shape backdrop. I plan to put the images in different areas and the code manually on the mouse, click the mouse and mouse to show the appearance of the button.

Anyway, my question is, is it a good idea? Should I just load the map into the picture window, get rid of the fluffy visual effects and track the coordinates of the click?

+5
source share
2 answers

, , Rectangles onclick, Rectangle.Contains(Point), , , , .

.

Rectangle R1 = new Rectangle(/*Passed Variables*/);
Rectangle R2 = new Rectangle(/*Passed Variables*/);
//...
OnClick(object sender, MouseEventArgs e)
 {
 If (R1.Contains(e.Location))
  {
   //Stuff
  }
 else
 {
  If (R2.Contains(e.Location))
   {
    //Stuff
   }
 }
}

Rectangle, Rectangles for , Rectangle.

+2

CodeProject - ImageMap Control . , .

0

All Articles