|
-
Jan 9th, 2002, 07:03 AM
#1
Thread Starter
Fanatic Member
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:
Private Sub MDIForm_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static lngMsg As Long
Static blnFlag As Boolean
Dim lngResult As Long
lngMsg = X / Screen.TwipsPerPixelX
If blnFlag = False Then
blnFlag = True
Select Case lngMsg
Case WM_LBUTTONDBLCLK
lngResult = SetForegroundWindow(Me.hwnd)
' Check if RATs is minimized
If Me.WindowState = vbMinimized Then Me.WindowState = vbMaximized
' Check if Pinboard is open
If FormIsOpen("frmRelatedItems") Then
' Check if Pinboard is minimized
If frmRelatedItems.WindowState = vbMinimized Then
frmRelatedItems.WindowState = vbNormal
Else
frmRelatedItems.SetFocus
End If
Else
Load frmRelatedItems
End If
End Select
blnFlag = False
End If
End Sub
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Jan 9th, 2002, 08:45 AM
#2
Lively Member
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.
-
Jan 9th, 2002, 08:51 AM
#3
Thread Starter
Fanatic Member
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. 
-
Jan 10th, 2002, 05:44 AM
#4
Thread Starter
Fanatic Member
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. 
-
Jan 10th, 2002, 10:54 AM
#5
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|