Results 1 to 5 of 5

Thread: Form won't open

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Question Form won't open

    I have a mdi app which uses an icon I put in the sys tray.

    When I double click on the icon (and the app is minimized) the app is maximized and a child form is opened. This works ok.

    If I double click on the icon (and the app is in any state) the app should appear and the child form should either be loaded of have focus set to it. This does not work. The mdi form does not even appear.

    Can anybody explain why and how to correct this.

    VB Code:
    1. Private Sub MDIForm_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.  
    3. Static lngMsg As Long
    4. Static blnFlag As Boolean
    5.  
    6. Dim lngResult As Long
    7.  
    8.   lngMsg = X / Screen.TwipsPerPixelX
    9.  
    10.   If blnFlag = False Then
    11.        
    12.     blnFlag = True
    13.    
    14.     Select Case lngMsg
    15.    
    16.       Case WM_LBUTTONDBLCLK
    17.        
    18.         lngResult = SetForegroundWindow(Me.hwnd)
    19.        
    20.         ' Check if RATs is minimized
    21.         If Me.WindowState = vbMinimized Then Me.WindowState = vbMaximized
    22.        
    23.         ' Check if Pinboard is open
    24.         If FormIsOpen("frmRelatedItems") Then
    25.  
    26.           ' Check if Pinboard is minimized
    27.           If frmRelatedItems.WindowState = vbMinimized Then
    28.             frmRelatedItems.WindowState = vbNormal
    29.           Else
    30.             frmRelatedItems.SetFocus
    31.           End If
    32.  
    33.         Else
    34.  
    35.           Load frmRelatedItems
    36.  
    37.         End If
    38.      
    39.     End Select
    40.    
    41.     blnFlag = False
    42.  
    43.   End If
    44.  
    45. End Sub
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  2. #2
    Lively Member Optic's Avatar
    Join Date
    Mar 2001
    Location
    I'm everywhere and nowhere, I'm inside your computer and inside your mind. You can't escape me for I am vision.
    Posts
    117
    Why do you check the state's of the form. I would automatically make the main form maximized and the child form normal and have focus. The only check I would do is to see if the child form was open.

  3. #3

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Some users may have their mdi form in normal mode, so if it isn't minimized I don't want to change their form size.

    If a child form is minimized and you set focus to it, I think it causes an error.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  4. #4

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Now I look at it, it seems that the mdi parent will not maximize if any child forms are open, no matter what their state.

    Anybody know why?
    Last edited by Stevie; Jan 10th, 2002 at 10:52 AM.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  5. #5

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Bump
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

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