![]() |
| ||
| Dialog Box Private Sub Command2_Click() MsgBox "Have a gala shopping", vbOKCancel, "welcome to the superMarket" End Sub Hey, 1) I want to know how to add icons in the message Box . 2) How To Set the Default Button. |
| ||
| Re: Dialog Box MsgBox is a function with a return parameter available. The syntax is as follows: ReturnVal = MsgBox(Prompt, Options, Title) Options is a combination of your buttons, icons, and default button. Example: ReturnVal = MsgBox("Do you want to continue?", VBYesNo + VBQuestion + VBDefaultButton1, "Closing")
The allowable values are listed on the Microsoft MSDN Library web site http://msdn2.microsoft.com/en-us/lib...82(VS.60).aspx |
| ||
| Re: Dialog Box to set default button u don't have to fill button style in msgbox or use vbdefaultbutton style. ex : msgbox("message","Titile") -> it will shown Ok only. to get other icon do like techtix said. |
| ||
| Re: Dialog Box . |
| ||
| Re: Dialog Box When calling a function, make sure you use parentheses. Also, you are not soliciting a vbYes from the user. Just a vbOK or vbCancel. ** It's a personal preference, but when I call a function that is overloaded as a method, I try to always still call it as a function. Private Sub Command2_Click() |
| ||
| Re: Dialog Box Private Sub Command2_Click() Dim response As Integer Response=MsgBox "Have a gala shopping", vbOKCancel + vbInformation + vbDefaultButton1, "welcome to the superMarket" If response = vbYes Then MsgBox "mansi" End If End Sub I want to display the further msg on Yes button ,But the error is the response. Jx_man,Ya dats right,by default first button in the dialog Box is the default button, But if there are two buttons, & to set the second button as default button, we have to follow the texttix code... |
| ||
| Re: Dialog Box Still a problem here. The MsgBox options you are setting are vbOkCancel. This will never return a vbYes. Your only options for a return code are vbOk and vbCancel. ** See my previous post for the correct code. |
| All times are GMT -4. The time now is 10:33 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC