![]()  | 
 
MDI Minimize to tray issue | 
 
    Post Reply  
   | 
  
| Author | |
   
   JvdH  
   
   Groupie  
   Joined: 09 May 2008 Status: Offline Points: 50  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: MDI Minimize to tray issuePosted: 03 May 2009 at 3:55pm  | 
 
| 
   
    
   Hello folks,
 
   
  When I try to minimize a ribbon by clicking the the close button on the parent form it automatically closes the subforms for some reason. 
The unload code on the parent is: 
Public Sub MDIForm_Unload(Cancel As Integer) 
On Error Resume Next Dim sMainCloseButtonFunction As Integer 
sMainCloseButtonFunction = ReadINIFile(App.Path & "\Preferences.ini", "Settings", "MainCloseButtonFunction", "")     If sMainCloseButtonFunction = 1 Then 
Cancel = True         Call MinimizeToTray 
Exit Sub Else mWidth = Me.Width mHeight = Me.Height SaveSetting App.Title, "Settings", "Width", mWidth SaveSetting App.Title, "Settings", "Height", mHeight         Call SetWindowLong(Me.hwnd, GWL_WNDPROC, OldWindowProc) 'unload resize form 
        Unload Me: End 
End If End Sub The minimze code: 
Public Sub MinimizeToTray() 
If Not Minimized Then TI.MinimizeToTray Me.hwnd Minimized = True CommandBars.RecalcLayout Else TI.MaximizeFromTray Me.hwnd Minimized = False CommandBars.RecalcLayout End If End Sub And when I call the MinimizeToTray function via a Button it works fine. 
Is this a bug or am I missing a piece of code or? 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 13.2.1 
 
   
  Platform: Windows 7 (64bit) Language: Visual Basic 6.0 SP6  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 03 May 2009 at 10:02pm | 
 
| 
   
    
   Maybe try the QueryUnload event instead (test the UnloadMode parameter for vbFormControlMenu and then run your minimize code)? 
   
   | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.6 
   
  Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |