Closing events?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HANG  LAM

    #1

    Closing events?

    hi,

    How do I capture the closing events coming from the 'X' icon in the
    top-right corner of a form and the
    Form.Close() command?
    I want to be able to differentiate between the Closing Event coming from the
    'X' icon in the top-right corner of a form and the closing event coming from
    the Form.Close() command.

    I don't want the user to be able to close the application by clicking on the
    "X" icon on the top-right corner in a form so I override the Closing event
    but I want the form to close when Form.Close() is called.

    In Wisual Basic 6.0, I used to do it by checking the Unload Mode against
    vbFormControMen u variable.


    Thanks,
    Scott


  • Cor

    #2
    Re: Closing events?

    Hi Scott,

    Are you sure you cannot set the controlbox property from the form to false,
    that is mostly used and for the user very general.

    This question has been more times here, I think your solution is not right,
    do not forget that when a user click on the X he is used that the form or
    program closes.

    When not it will be called a bug in your program (and in my opinion that is
    than true although you did it express).

    Just my thought,

    Cor


    Comment

    Working...