Am I Stupid ??? 
Author Message
 Am I Stupid ???

Hello to all.

I got a little problem again #:-(..

Maybe it is something really stupid... but I can't find the so solution..
it is following:

I am trying to make an aplication where I create a selfmade MyMsgbox.. so
what I did is for example two forms.. one holding the execution and the
other for the created MyMsgbox.. .. I create this message box to inform
about an error. Ok.. Executing the application when I do Load the form that
holds the MyMsgbox it does not stay there and whaits till I press ok in the
mymsgbox form... it just returns back from where I loaded it previously...
the question is :

How can I make that a form keeps the execution flow of the program till I
do detect an
event in this form !! That is to say... How can I emulate a normal VB
Msgbox ?

Thank you


Wed, 17 Mar 1999 03:00:00 GMT  
 Am I Stupid ???

To emulate the standard messagebox, you need to show the form as
modal ( 1), and if you require a return value (other than
ok), you need to code for obtaining that value before destroying the
message box.

I did a similar thing, and used the following routine.  It won't all
be applicable to your situation,  but you can see the idea.

'global variable
 MsgAction as Integer  'return value from the messagebox

Function GetMessage(msgType%, xtraInfo$, iconNo&) As Integer

    Dim btnPanel%
    msgExtraStrInfo$ = xtraInfo$

    dlgMsg!Msg = fGetMsg$(msgType%, ActivePanel%)
    dlgMsg!MsgPnl(btnPanel%).ZOrder 0

   'if a valid icon value is specified, load & display it too.
    If iconNo& >= IDI_HAND And iconNo& <= IDI_ASTERISK Then

      Dim hIcon&, success&

     'clear the picturebox & set AutoRedraw to true.
      dlgMsg!Picture1 = LoadPicture("")
      dlgMsg!Picture1.AutoRedraw = True

     'load the icon & draw it to the picturebox.
      hIcon& = LoadIcon(0&, iconNo&)
      success& = DrawIcon(dlgMsg!Picture1.hDc, 0&, 0&, hIcon&)

    End If

    dlgMsg.Show 1
    GetMessage% = MsgAction%

End Function

Thu, 18 Mar 1999 03:00:00 GMT  
 Am I Stupid ???

If you want to display the form and let other forms in the program keep
working, show the form with 'Form.Show', you may have been using 'Form.Show
1' - which shows the form modally, i.e. it is given total focus and no other
form in your app can be used.

This has the disadvantage that you can only use the form one at a time.
You could load new instances of the form and that would give you more than
one copy of the form available at a time.

Fri, 19 Mar 1999 03:00:00 GMT  
 [ 3 post ] 

 Relevant Pages 

1. Am I stupid or is it VB? [Recordsets]

2. Am I Stupid ?...

3. Using MSMAPI ocx: Am I stupid or what?

4. MDI-problem-am i stupid or is it a bug -2 icons in menubar

5. Am I stupid? :)

6. Locking error, DataControl Error, or am I stupid ?

7. Bug in D3DXQuaternionRotationMatrix - or am I stupid?

8. Am I stupid? ShellExecute woes

9. Am I stupid? :)

10. Locking error, DataControl Error, or am I stupid ?

11. Access Gurus needed for this one !! Or maybe I am just stupid!

12. Is this a bug, or am I stupid (or both)?


Powered by phpBB® Forum Software