I am making a screenshotting application using C# and WinForms and so I need my form to hide itself so it can take a picture of the screen. This I have accomplished, but if I hover over the New Screenshot button before taking the screenshot and the tooltip pops up, the tooltip doesn't get hidden with the form and ends up being in the screenshot.
I've tried setting the AutoToolTip
property to false
and setting the tooltip text to null
, but it makes no difference.
One thing that did work was calling main_toolStrip.Dispose();
, but then of course it disappears from the form after the form unhides itself.
I've got this code so far:
private void newScreenshot_btn_Click(object sender, EventArgs e)
{
main_toolStrip.ShowItemToolTips = false;
this.WindowState = FormWindowState.Minimized;
this.Visible = false;
this.ShowInTaskbar = false;
System.Threading.Thread.Sleep(2000);
//screenshot code is here
main_toolStrip.ShowItemToolTips = true;
this.ShowInTaskbar = true;
this.Visible = true;
this.Size = new Size(1000, 800);
this.WindowState = FormWindowState.Normal;
prepareMenus(); //enables the required buttons on the toolstrip
}
As you can see by the code, ShowItemToolTips
hasn't helped either.
I don't particularly want to remove the tooltip from the button, however.
Images:
This is a screenshot of a screenshot taken by my program demonstrating the tooltip problem:
And the toolbar button that creates the tooltip:
Also note that this isn't an explicitly created ToolTip
control; it is the one "included", if you like, with the ToolStrip
control.