private void toolStripMenuItem2_Click(object sender, EventArgs e) { if (showIcon == false) { toolStripMenuItem2.Image = Bitmap.FromFile("d:\\pic.bmp");//рисовать галочку showIcon = true; //сделать действие } else { toolStripMenuItem2.Image = null; showIcon = false; //сделать действие } }
pic.bmp (or .ico, .jpg) - a picture with a tick. When you click a menu item, draw a check mark and do some action (for example, change the desired parameter to 1). When you click again, remove the check mark and do another action (for example, change the desired parameter to 0).
"At the request of the workers" instead of the bydlokoderksky option, a kosher version is offered :)
private void toolStripMenuItem2_Click(object sender, EventArgs e) { if (toolStripMenuItem2.CheckState == CheckState.Unchecked) { toolStripMenuItem2.CheckState = CheckState.Checked; } else { toolStripMenuItem2.CheckState = CheckState.Unchecked; } }