I have some map control and when I clicked on it, I open contextMenuStrip and then clicked for the snapshot of my map.
Problem is that when I click for the snapshot, it’s snapshot map including contextMenuStrip.
I try with, “contextMenuStrip.Close()” but not work.
//on map click event
private void map1_Click(MouseEventArgs e)
{
System.Drawing.Point point = new System.Drawing.Point(e.X, e.Y + 160);
contextMenu.Show(this.contextMenu, point);
}
//item of contextMenu
private void contextMenuConvert_Click(object sender, EventArgs e)
{
contextMenu.Close();
map.CreateImage(ImageFormat.Jpeg);
}
That just sends a message which is queued. If you want to make sure it is actually done use Application.DoEvents() between the Close call and the CreateImage call.