msgbox format and syntax

krishnanhemanth

Registered User.
Local time
Today, 11:35
Joined
Jun 12, 2009
Messages
115
hi
can somebody please help me on the correct format and syntax of message box

i can do this
msgbox"my message"
but how to add the yes / no key
how to add a name to the title

thanks in advance
 
The syntax varies slightly depending on how you're using it. To simply add a given response button and a title:

Code:
[B]MsgBox "Your message goes here", vbYesNo, "Message Box Title goes here"[/B]
To assign the response according to the button that's pressed:

Code:
[B]Response = MsgBox("Your message goes here", vbYesNo, "Message Box Title goes here")[/B]
Notice the parens that have been added.

Using it in an If...Then construct:

Code:
[B]If MsgBox("Your message goes here", vbYesNo, "Message Box Title goes here") = vbYes Then
  'Code goes here for actions if Yes button is pressed
End If[/B]
 
I needed this info also- found it using search.
Won't allow me to add to reputation again :), but the code is great! Thanks :)
 
That's why we're here! And it is nice to see that there are people out there who use our Search engine before asking for help!

Linq
 

Users who are viewing this thread

Back
Top Bottom