Re: message box non modal?



or set a flag to ignore them while the modal msgbox is up.

Thank you Tom.
That is what I have decided to do.

"Tom Esh" <tjeshGibberish@xxxxxxxxxx> wrote in message
news:k03q525s6l9v6v80mq2vpgi2a0dukmea5d@xxxxxxxxxx
On Sat, 6 May 2006 14:48:02 -0400, "Jack" <notreplyto@it> wrote:

My problem is, that my application receives callbacks from Windows.
Sometimes there is a a situation, when the msgbox is displayed (user has
not
reacted yet to it), but the callback is received and it tries to show
another window.
In that situaton there is Error 401: :Non modal form cannot be displayed,
when there is modal form opened".

So you've got a modal dialog (msgbox) that by nature limits UI input,
and callbacks that can change the UI. They aren't going to get along,
and if they somehow did, the user would certainly be confused.

The problem here is one of ~design~ consideration, in particular does
it really need to be modal (?) If it must be modal, then asynchronous
callbacks that can effect UI input are a no-no. In that case you
should either remove those aspects from the callbacks, or queue them,
or set a flag to ignore them while the modal msgbox is up.


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)


.



Relevant Pages

  • Re: message box non modal?
    ... Sometimes there is a a situation, when the msgbox is displayed (user has not ... In that situaton there is Error 401::Non modal form cannot be displayed, ... The problem here is one of ~design~ consideration, ... callbacks that can effect UI input are a no-no. ...
    (microsoft.public.vb.general.discussion)
  • Re: message box non modal?
    ... that my application receives callbacks from Windows. ... Sometimes there is a a situation, when the msgbox is displayed (user has not ... another window. ... Check out the MessageBox& API call. ...
    (microsoft.public.vb.general.discussion)
  • Re: Timer event just...doesnt happen
    ... form and any event in the non modal form. ... Private Sub Command1_Click ... MessageBox Me.hwnd, "Hullo", App.Title, 0 ... Case 3: MsgBox "VB MsgBox" ...
    (microsoft.public.vb.general.discussion)
  • Re: DoEvents with MsgBox displayed
    ... With a true MsgBox, I thought that halted the code until the MsgBox was acknowledged? ... Michael C wrote: ... but that's an order of magnitude more complicated than the custom form solutions the others have suggested. ... I don't think the user interface should be modified to get around a programming issue, if a modal form is what is best then a modal form should be used. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to force selection to show onscreen before MsgBox executed
    ... Oh okay I thought user is typing in something, that's why I said Inputbox. ... Actually, I've been using MsgBox. ... modal form - thought I'd get that working before shifting to modeless. ... triggered some sort of global latch which enabled the selection display on ...
    (microsoft.public.powerpoint)

Loading