Form disappears when when msgbox is displayed? [modified]Can any one Answer this??????????
-
I'm having a problem when using a msgbox on a second loaded form. I have two forms ... frmMain (default) and frmSecondary. When the program is run, frmSecondary will eventually be loaded and displayed as the active window (both are maximized, frmMain is still loaded in the background). Now, when a msgbox is used to advise the user of some occurence on frmSecondary, the frmSecondary disappears and frmMain suddenly appears behind the msgbox. Once the msgbox is clicked(i.e.,closed) the frmMain disappears (usually),and again reveal the frmSecondary. I would be grateful if someone could tell me why this is occurring. Note both the forms are border Style is set to None. Thank you.
modified on Friday, January 8, 2010 5:06 AM
-
I'm having a problem when using a msgbox on a second loaded form. I have two forms ... frmMain (default) and frmSecondary. When the program is run, frmSecondary will eventually be loaded and displayed as the active window (both are maximized, frmMain is still loaded in the background). Now, when a msgbox is used to advise the user of some occurence on frmSecondary, the frmSecondary disappears and frmMain suddenly appears behind the msgbox. Once the msgbox is clicked(i.e.,closed) the frmMain disappears (usually),and again reveal the frmSecondary. I would be grateful if someone could tell me why this is occurring. Note both the forms are border Style is set to None. Thank you.
modified on Friday, January 8, 2010 5:06 AM
-
Hello Eddy Vluggen, Its Vb6 application.
-
I'm having a problem when using a msgbox on a second loaded form. I have two forms ... frmMain (default) and frmSecondary. When the program is run, frmSecondary will eventually be loaded and displayed as the active window (both are maximized, frmMain is still loaded in the background). Now, when a msgbox is used to advise the user of some occurence on frmSecondary, the frmSecondary disappears and frmMain suddenly appears behind the msgbox. Once the msgbox is clicked(i.e.,closed) the frmMain disappears (usually),and again reveal the frmSecondary. I would be grateful if someone could tell me why this is occurring. Note both the forms are border Style is set to None. Thank you.
modified on Friday, January 8, 2010 5:06 AM
In what form do you call the messagebox? Is frmsecondary shown modal or not?
-
In what form do you call the messagebox? Is frmsecondary shown modal or not?
Tom Deketelaere Its modaless form . Its bcoz i have set form border style to none.So i just wanna know why is causing problem with borderless form.
-
Hello Eddy Vluggen, Its Vb6 application.
I guess that the MsgBox is a form without a parent, and the
MsgBox
[^] method of VB6 doesn't have a parameter to set that. Without a parent, focus will be returned to the application, giving it's mainform the focus. Alternatively, you can call the MessageBoxA method from User32;Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" ( _
ByVal hWnd As Long, _
ByVal lpText As String, _
ByVal lpCaption As String, _
ByVal wType As Long) As LongThat goes into a module, and you can call it like this;
MessageBox Me.hWnd, _
"Caption", _
"Text goes here", _
vbExclamationGood luck :)
I are Troll :suss:
-
I'm having a problem when using a msgbox on a second loaded form. I have two forms ... frmMain (default) and frmSecondary. When the program is run, frmSecondary will eventually be loaded and displayed as the active window (both are maximized, frmMain is still loaded in the background). Now, when a msgbox is used to advise the user of some occurence on frmSecondary, the frmSecondary disappears and frmMain suddenly appears behind the msgbox. Once the msgbox is clicked(i.e.,closed) the frmMain disappears (usually),and again reveal the frmSecondary. I would be grateful if someone could tell me why this is occurring. Note both the forms are border Style is set to None. Thank you.
modified on Friday, January 8, 2010 5:06 AM
I'm certainly glad you modified your header to show how frustrated you are that no-one dropped what they were doing to provide you with the answer. Certainly all the time you have posted to help others should be a beacon to the rest of us.
Jon "Fix reason firmly in her seat, and call to her tribunal every fact, every opinion. Question with boldness even the existence of a God; because, if there be one, he must more approve of the homage of reason, than that of blindfolded fear. " ~ Thomas Jefferson Soap Box 1.0: the first, the original, reborn troll-less