Results 1 to 9 of 9

Thread: Close Button

  1. #1

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134

    Question Close Button

    How can I disable the (X) Close Button?
    Also, Why is it that I can still maximize my form after setting maximizeBox to false???
    This is making me kind of mad.
    Last edited by Rally2000; Dec 25th, 2003 at 04:26 AM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Handle CancelEventArgs parameter in Closing event . This way :

    VB Code:
    1. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    2.         e.Cancel = True
    3.     End Sub

    Why is it that I can still maximize my form after setting maximizeBox to false???
    How ?

  3. #3

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    Try it and you will see what I'm talking about.
    I'm using VS.Net Pro 2003
    If you click around where that button would normally be U will find it. (or not)
    If need be I can show you a screen shot.

    PS: Thanks!!

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    When setting the property 'MaximizeBox' of the form to False , this would show it but dimmed . I've tried what you said but nothing happened .

  5. #5

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    I know what is happening now, I’m using fixed tool window for border style (does not show min., max.) but I did not set the min. and max. property to false (did not know you had to do that) besides, I did not even think to do it since the boxes don’t show.
    Anyway, any time you are using fixed border style setting and do not disable min. and max. Button U still be able to maximize your App.
    I’m glad I found the problem.

  6. #6
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by Rally2000

    If you click around where that button would normally be U will find it. (or not)
    It is supposed to do that. Clicking on the title bar of a Windows Application is supposed to maximize and minimize the program.

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by kasracer
    It is supposed to do that. Clicking on the title bar of a Windows Application is supposed to maximize and minimize the program.
    I'm sure , you didn't read through the thread . If MaximizedBox is set to false , this , no way to maxmimize the window by the 'max' button nor clicking on the title bar .

  8. #8
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by Pirate
    I'm sure , you didn't read through the thread . If MaximizedBox is set to false , this , no way to maxmimize the window by the 'max' button nor clicking on the title bar .
    Yes I know, I was explaining to him why what he did maximized the app

  9. #9

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    My point was simply this, if it claims to be a fixed type window it should not expand at any time.
    but it does, oh well! Next time I know to disable min. and max. button.

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