S
Serge Wautier
Env.: CF 3.5, WM6
Hi All,
I'd like to know when user clicks the X on the title bar of my form.
I thought the Deactivate event would be a good place but it isn't good
enough: The event is fired in other circumstances as well such as opening a
program from the start menu.
I tried this unfortunately to no avail (hoping that Visible would be turned
off only when user clicks the X. Might be a stupid assumption since we have
only one visible form system-wide). Anyway the 'funny' thing is that Visible
is true in all cases when the event handler is called.
private void MyForm_Deactivate(object sender, EventArgs e)
{
if (!Visible)
{
System.Diagnostics.Debug.WriteLine("hello");
}
}
TIA for your help.
Serge.
Hi All,
I'd like to know when user clicks the X on the title bar of my form.
I thought the Deactivate event would be a good place but it isn't good
enough: The event is fired in other circumstances as well such as opening a
program from the start menu.
I tried this unfortunately to no avail (hoping that Visible would be turned
off only when user clicks the X. Might be a stupid assumption since we have
only one visible form system-wide). Anyway the 'funny' thing is that Visible
is true in all cases when the event handler is called.
private void MyForm_Deactivate(object sender, EventArgs e)
{
if (!Visible)
{
System.Diagnostics.Debug.WriteLine("hello");
}
}
TIA for your help.
Serge.