CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Catching the Minimized button

    My very favorite form has MinButton = True. I want to call my very favorite procedure (Private Sub MinimizeEvent) when the user clicks the MinButton. Any way to do this?


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Catching the Minimized button

    Simple direct VB way would be to catch the _Resize event and check for Me.Minismized=True

    private Sub Form_Resize()
    if me.Minimized = true then
    Call MyFavoriteMinimizeProcedure
    'or
    RaiseEvent MyFavoriteMinimiseEvent '!!
    exit sub
    end if
    ' else handle it if you care!
    end sub




    Another (pure) API way would be to subclass the form. When the user clicks any of the control-box buttons you get a WM_SYSCOMMAND (with command type = SC_MINIMIZE, for Minimise btn ) event . You can latch on to this to do your processing. This would be under the hood of VB.

    RK

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

Featured