From: Larry Serflaten on

"phil hunt" <a(a)abc.com> wrote
> I have an application that pop up a form (vbModal) asking for password in
> order to proceed. It pops up after a period of idling. It works prettty
> well.
> The hassle comes when there is a MsgBox popping up and the user does not
> respond, then the modal form pop up. Now I got 2 modal things, and you
> cannot click anything to move on. I have been sidestepping the problem by
> disabling the modal form whenever I show msgbox. I am wondering if there is
> a better way to do this.

How are you detecting idle time? If that is on a Timer, why not just disable the
timer before you show the msgbox? You might wrap that up in a routine so as
to catch it every time:

Sub SimplePrompt(Msg As String, Optional Buttons As VbMsgBoxStyle = vbOKOnly)
Timer1.Enabled = False
If frmPassword.Visible Then
Unload frmPassword
MsgBox Msg, Buttons
frmPassword.Show vbModal
Else
MsgBos Msg, Buttons
End If
Timer1.Enabled = True
End Sub


LFS


From: Phil Hunt on
That's what I am doing now. Over and over again. Ralph's link is pretty
good, b/c it is a closer approixmation than other "Timed message box".
Wouldn't it be nice if I can show a msgbox NON-Modal.


"Larry Serflaten" <serflaten(a)gmail.com> wrote in message
news:i447oj$p52$1(a)news.eternal-september.org...
>
> "phil hunt" <a(a)abc.com> wrote
>> I have an application that pop up a form (vbModal) asking for password in
>> order to proceed. It pops up after a period of idling. It works prettty
>> well.
>> The hassle comes when there is a MsgBox popping up and the user does not
>> respond, then the modal form pop up. Now I got 2 modal things, and you
>> cannot click anything to move on. I have been sidestepping the problem by
>> disabling the modal form whenever I show msgbox. I am wondering if there
>> is
>> a better way to do this.
>
> How are you detecting idle time? If that is on a Timer, why not just
> disable the
> timer before you show the msgbox? You might wrap that up in a routine so
> as
> to catch it every time:
>
> Sub SimplePrompt(Msg As String, Optional Buttons As VbMsgBoxStyle =
> vbOKOnly)
> Timer1.Enabled = False
> If frmPassword.Visible Then
> Unload frmPassword
> MsgBox Msg, Buttons
> frmPassword.Show vbModal
> Else
> MsgBos Msg, Buttons
> End If
> Timer1.Enabled = True
> End Sub
>
>
> LFS
>
>


First  |  Prev  | 
Pages: 1 2
Prev: DCOM Error
Next: ActiveX EXE SingleUse Vs MultiUse