Link to home
Start Free TrialLog in
Avatar of sindhuxyz
sindhuxyz

asked on

form closing event windows mobile

Hi,

How can I trap form closing event, I tried below:
//form load event
this.Closing += new CancelEventHandler(Form1_FormClosing);

private void Form1_FormClosing(object sender, System.ComponentModel.CancelEventArgs e)

        {
            // Determine if text has changed in the textbox by comparing to original text.
         

        }
When I clicked "X" on form, I could not get close event that I defined.

Please help
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

the trouble with WinMo is that "x" does NOT close the form, but does what's called "Smart Close" which is in effect like "minimize"

so when you press "x" you'll get LostFocus or Activated - just experiment with it, add the handlers for those events and see when you arrive there.

personally, I tend to remove "x" from the forms, so if I want to let the user to exit it is done via Menu or whatever UI where I can control it
Avatar of sindhuxyz
sindhuxyz

ASKER

Ok, thanks for you advise.

Please tell me how to remove "X"

ASKER CERTIFIED SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial