Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 MsgBox
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jacklarry




PostPosted: Fri Mar 02, 2007 3:38 pm   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
jacklarry




PostPosted: Sun Mar 04, 2007 11:21 am   Post subject: Re: MsgBox

cud anyone plz tell me if it is possible?
Ultrahex




PostPosted: Sun Mar 04, 2007 11:36 am   Post subject: 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




PostPosted: Sun Mar 04, 2007 10:18 pm   Post subject: 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! Smile
ToughRouge




PostPosted: Fri Mar 09, 2007 9:10 am   Post subject: 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




PostPosted: Fri Mar 09, 2007 4:26 pm   Post subject: Re: MsgBox

ToughRouge @ Fri Mar 09, 2007 9:10 am wrote:
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




PostPosted: Wed Apr 11, 2007 8:30 pm   Post subject: Re: MsgBox

Well, for a msgbox, you need to enter at least a prompt message the format for a msgbox is as follows: MsgBox(prompt[, buttons][, title][, helpfile, context]). So, for example:
code:
MsgBox "Prompt",vbOKOnly,"Title bar"

That is all you need to do. For other buttons, follow this:
Quote:

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




PostPosted: Thu May 17, 2007 5:08 pm   Post subject: RE:MsgBox

alrite thnx guys
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Tue Apr 01, 2008 6:41 pm   Post subject: 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




PostPosted: Tue Apr 01, 2008 6:47 pm   Post subject: RE:MsgBox

The msgBox will return a value to the form depending on what was clicked.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: