0

I have 100 buttons which created dynamically. Every button has same text and same name. Actually all of them is totally same. I added a property to my toolstrip menu called "color".

This is my function which must be change color.

private void colorfunc(object sender, MouseEventArgs e)
        {
            //
        }

I created the toolstrip like this.

  ContextMenuStrip menu= new ContextMenuStrip();
  ToolStripMenuItem color= new ToolStripMenuItem("color");
   
  color.Click += colorfunc;
  menu.Items.AddRange(new ToolStripItem[] { color});

I want to do is when i right click to my button and after click the color item from toolstrip my button must be green. But i want to do is for only the button which is right clicked. Other 99 button must be stay like before. How to i do that?

0 Answers0