Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Halt execution

1 view
Skip to first unread message

Eduardo

unread,
Oct 5, 2008, 6:48:37 AM10/5/08
to
I have to show a modal form with a message from within an ActiveX control.
But if at that time the client program tries to show a non modal form, then
the error 401 is raised (can't show non modal form when modal form is
displayed).

I see that the VB function MsgBox and InputBox halt the execution of all the
client program when they are showing a message (the timers are not fired,
etc).
Is it possible to do the same?

Thanks,
Eduardo.


Ken Halter

unread,
Oct 6, 2008, 6:40:00 PM10/6/08
to
"Eduardo" <m...@mm.com> wrote in message news:gca62d$j5u$1...@aioe.org...

> I see that the VB function MsgBox and InputBox halt the execution of all
> the client program when they are showing a message (the timers are not
> fired, etc).

Msgbox stops a timer only from within the IDE. In a compiled app, the timer
keeps firing.

'====Proof
Option Explicit

Private Sub Command1_Click()
MsgBox "Test"
End Sub

Private Sub Command2_Click()
MsgBox InputBox("Test")
End Sub

Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Me.Caption = Timer
End Sub
'====

--
Ken Halter
Part time groupie

>


Eduardo

unread,
Oct 6, 2008, 8:17:36 PM10/6/08
to
Last night I was doing some testing about this issue, and I realized that
the modal forms at design time stop the execution, but at run time they
don't.
The same you are now saying about Msgboxes.

But if a form displaying a Msgbox is unloaded while the Msgbox is in the
screen (at run time), the MsgBox also closes (if that form was the last one
loaded, if there is another form loaded, then the Msgbox stays).

But if you do that with a modal form instead of a Msgbox, you get the error
"modal form must be closed first... etc").

It is annoying, because how from the form that is shown modally, that it's a
form of my ActiveX control, can I know that the parent form of my control is
trying to close?
It seems to me that I can't. Because not even the Query_Unload event (of the
parent form) is fired before the error message.


"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> escribió en el mensaje
news:uqCDzRAK...@TK2MSFTNGP05.phx.gbl...

0 new messages