•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 374,158 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,445 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 428 | Replies: 6
![]() |
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
MsgBox is a function with a return parameter available. The syntax is as follows:
Options is a combination of your buttons, icons, and default button.
Example:
The allowable values are listed on the Microsoft MSDN Library web site
http://msdn2.microsoft.com/en-us/lib...82(VS.60).aspx
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
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.
ex : msgbox("message","Titile") -> it will shown Ok only.
to get other icon do like techtix said.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
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.
** 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()
Dim iResponse As Integer
iResponse = MsgBox("Have a gala shopping", vbOKCancel + vbInformation + vbDefaultButton1, "welcome to the superMarket")
If iResponse = vbOK Then
Call MsgBox("sonia")
End If
End Sub Last edited by techtix : Apr 5th, 2008 at 11:47 pm.
•
•
Join Date: Apr 2008
Posts: 18
Reputation:
Rep Power: 1
Solved Threads: 0
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...
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...
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- hi,i need to discard the password dialog box. (Windows 9x / Me)
- changing color of a pushbutton on a dialog box (C)
- open save dialog box error (PHP)
- Dialog box missing when sending attachments. (Windows NT / 2000 / XP / 2003)
- dialog box question (C)
- Dialog box wrong size (Windows NT / 2000 / XP / 2003)
- Common Open dialog box (C++)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: printer properties
- Next Thread: Basic question



Linear Mode