locked
Minimized forms, redundant clicks to navigate RRS feed

  • Question

  • While navigating around my mobile app, I've noticed a couple of things and have a couple of questions:

    1. Even though I "close" a form (by clicking the X in the lower right), when I bring up the same form later it will contain the same info as before. It is not being closed but minimized. Is there a way such that selecting X will actually close the form?

    2. When I'm a couple forms deep from the main menu, while closing forms on the way back to the main menu I will need to click the X (or OK) twice to close a single form. Is there a way I can have 1 click to close 1 form?

    Thursday, January 12, 2012 5:53 PM

Answers

  • That is the intended behavior of the X button.

    In native code, you can use the SHDoneButton API to turn that X in to an OK that will close the dialog.

    In the .NET. set the Form.MinimixeBox property to false.

    see: http://msdn.microsoft.com/en-us/library/dd721907.aspx

    1 click should be enough to close or minimize a form. If it is taking two clicks, you may have a defect. Use Remote Spy++ to see what messages are being sent and processed by your application when you try to close the window.

    -PaulH


    • Edited by PaulH79 Saturday, January 14, 2012 3:38 AM
    • Proposed as answer by Jesse Jiang Monday, January 16, 2012 6:59 AM
    • Unproposed as answer by Aaron Hartley Monday, January 16, 2012 7:08 PM
    • Marked as answer by Aaron Hartley Monday, January 16, 2012 7:58 PM
    Saturday, January 14, 2012 3:36 AM

All replies

  • That is the intended behavior of the X button.

    In native code, you can use the SHDoneButton API to turn that X in to an OK that will close the dialog.

    In the .NET. set the Form.MinimixeBox property to false.

    see: http://msdn.microsoft.com/en-us/library/dd721907.aspx

    1 click should be enough to close or minimize a form. If it is taking two clicks, you may have a defect. Use Remote Spy++ to see what messages are being sent and processed by your application when you try to close the window.

    -PaulH


    • Edited by PaulH79 Saturday, January 14, 2012 3:38 AM
    • Proposed as answer by Jesse Jiang Monday, January 16, 2012 6:59 AM
    • Unproposed as answer by Aaron Hartley Monday, January 16, 2012 7:08 PM
    • Marked as answer by Aaron Hartley Monday, January 16, 2012 7:58 PM
    Saturday, January 14, 2012 3:36 AM
  • I set the MinimizeBox property to false on all of my forms and now all the X buttons are OK buttons.

    However, I'm still having this double click OK to exit a form issue. Let me try to describe the situation a little better. The parent form launches the child form*. Launching the child form doesn't close the parent form, the parent form is simply behind the child and becomes visible again if the child form closes by selecting OK. So I've got a main screen that parent to several child forms that are themselves parents to child forms. So it is possible to go 2 levels deep from main to a grandchild and back: main > intermediate parent > grandchild. Going "down" involves opening child forms and works fine, going "up" back to the main does involves closing forms and does some strange things. Working backward from a grandchild back to main, I noticed something interesting.

    1st click OK: grandchild form disappears, intermediate parent form shows EXCEPT the title bar still shows the name of the grandchild form.

    2nd click OK: intermediate parent forms shows, title bar now also shows the name of the intermediate parent form.

    3rd click OK: intermediate parent disappears, main shows EXCEPT the title bar still shows the name of the intermediate parent

    4th click OK: main shows, title bar now also shows the name of the main form

    The 2nd and 4th OK clicks can be substituted for clicking anywhere on the form.

    1 and 2 are the same thing as 3 and 4. This led me to try my own solution, on the Closing event of a grandchild form I tried setting focus to the intermediate parent form. Unfortunately, this didn't work. Now that the problem is documented a lot better, maybe we can get to a solution. Any suggestions?

    * this is just my own jargon for what I'm trying to express, there is probably more official terminology for this.

     

     

    UPDATE: Nevermind, it was the way that I was opening the forms (ShowDialog + Focus)



    Monday, January 16, 2012 7:08 PM