
-----------------------------------
jacklarry
Fri Mar 02, 2007 3:38 pm

MsgBox
-----------------------------------
How can you add a button in the message box? I want to add a button and change its caption to print. So that when i click on it...it will print the document. Could anyone please help? Thanx.

-----------------------------------
jacklarry
Sun Mar 04, 2007 11:21 am

Re: MsgBox
-----------------------------------
cud anyone plz tell me if it is possible?

-----------------------------------
Ultrahex
Sun Mar 04, 2007 11:36 am

Re: MsgBox
-----------------------------------
I do not know Visual Basic, So I am Unsure if you can or cannot; however, why not just make a...

"Do You Want To Print?"

with a yes and no ?

or ... why not read:

http://www.devcity.net/Articles/118/custom_msgbox.aspx

(Other articles about Custom MsgBoxes If You Search "Custom MsgBoxes Visual Basic" On Google)

-----------------------------------
cool dude
Sun Mar 04, 2007 10:18 pm

Re: MsgBox
-----------------------------------
I got a good solution for you. Add another form. Shrink the form to the size of a message box. place a button on the form called print. Now it will act just like a message box! :)

-----------------------------------
ToughRouge
Fri Mar 09, 2007 9:10 am

Re: MsgBox
-----------------------------------
I'm pretty sure you can't just add a button to a MsgBox because it's a set command. 
If you want to add a button, you need to use a separate form instead and call it up.

-----------------------------------
cool dude
Fri Mar 09, 2007 4:26 pm

Re: MsgBox
-----------------------------------
I'm pretty sure you can't just add a button to a MsgBox because it's a set command. 
If you want to add a button, you need to use a separate form instead and call it up.

Is it just me or i said the same thing  :wink:

-----------------------------------
wargamer17
Wed Apr 11, 2007 8:30 pm

Re: MsgBox
-----------------------------------
Well, for a msgbox, you need to enter at least a prompt message the format for a msgbox is as follows: MsgBox(promptMsgBox "Prompt",vbOKOnly,"Title bar"
That is all you need to do. For other buttons, follow this:
vbOKOnly- Display OK button only. 
vbOKCancel- Display OK and Cancel buttons. 
vbAbortRetryIgnore- Display Abort, Retry, and Ignore buttons. 
vbYesNoCancel- Display Yes, No, and Cancel buttons. 
vbYesNo- Display Yes and No buttons. 
vbRetryCancel- Display Retry and Cancel buttons. 
vbCritical- Display Critical Message icon.  
vbQuestion- Display Warning Query icon. 
vbExclamation- Display Warning Message icon. 
vbInformation- Display Information Message icon. 
vbDefaultButton1- First button is default. 
vbDefaultButton2- Second button is default. 
vbDefaultButton3- Third button is default. 
vbDefaultButton4- Fourth button is default. 
vbApplicationModal- Application modal; the user must respond to the message box before continuing work in the current application. 
vbSystemModal- System modal; all applications are suspended until the user responds to the message box. 
[/code]

-----------------------------------
jacklarry
Thu May 17, 2007 5:08 pm

RE:MsgBox
-----------------------------------
alrite thnx guys

-----------------------------------
MysticVegeta
Tue Apr 01, 2008 6:41 pm

Re: MsgBox
-----------------------------------
Yo wargamer, im just curious, how would you detect if the user clicked Yes or no or cancel suppose we were to use vbYesNoCancel?

-----------------------------------
CodeMonkey2000
Tue Apr 01, 2008 6:47 pm

RE:MsgBox
-----------------------------------
The msgBox will return a value to the form depending on what was clicked.
