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?
Printable View
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?
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