Reputation: 1381
I need create one item in my ToolStripMenuItem with this feature: if I check it, in application is turn on "stay on top" property.
I tryed this code:
private void alwaysOnTopToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
{
if (alwaysOnTopToolStripMenuItem.Checked)
fForm1.TopMost = true;
else
{
fForm1.TopMost = false;
}
}
but I get this error in Visual Studio 2010 (Windows Form)
I dont know how I can solve this strage issue. Thanks in advance.
Upvotes: 1
Views: 789
Reputation: 33738
assuming the click handler lives in the form:
this.TopMost = alwaysOnTopToolStripMenuItem.Checked;
Upvotes: 2