Results 1 to 3 of 3

Thread: Where ti disable/intercept the Close Window (X) control ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    65

    Where ti disable/intercept the Close Window (X) control ?

    In the property windows of the form, there is a "Window Style" allowing me to turn "ControlBox" for Minimize, Maximize and Close controls as well as individual "MaximizeBox" and "MinimizeBox" to True or False.

    However, where is the individual control for the Close (X) window ?

    My appl users have been accidentally press the (X) control to close the window and I need to intercept this (X) close window control to warn user of this action.

    Can someone please tell me how can I either disable/intercept this event ?

    I search throught the net and found an answer point to a website for solution no longer exist. If someone can let me know or repost the solution will be appreciated.

    Regards

  2. #2
    New Member
    Join Date
    Nov 2006
    Posts
    13

    Re: Where ti disable/intercept the Close Window (X) control ?

    in VB2005 you can keep your users from closing your form using this code
    VB Code:
    1. Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    2.         e.Cancel = True
    3.  
    4.     End Sub

  3. #3
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: Where ti disable/intercept the Close Window (X) control ?

    Before 2005, it was done with API.

    Remove titlebar's system menu items

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width