Please can someone post the stuff about the MSGBox functions because i'm doing research from home but VB is at school so i can't access it at the moment. But still need the information.
Printable View
Please can someone post the stuff about the MSGBox functions because i'm doing research from home but VB is at school so i can't access it at the moment. But still need the information.
Here's some examples I just wrote now..hope they help you.
Code:'ok/cancel
msg = MsgBox("Would you like some pie?", 1) 'you can add an icon by putting a + after the three and a 16, 32, 48, 64
If msg = 1 Then
MsgBox "You pressed Ok...go help yourself."
Else
MsgBox "You pressed cancel...it's good pie!"
Exit Sub
End If
'abort/ignore/retry
msg = MsgBox("Would you like some pie?", 2) 'you can add an icon by putting a + after the three and a 16, 32, 48, 64
If msg = 3 Then
MsgBox "You pressed abort...cancelling pie?"
ElseIf msg = 4 Then
MsgBox "You pressed retry...sorry, i ate all the pie!"
ElseIf msg = 5 Then
MsgBox "You pressed ignore...don't ignore pie...you know you want it!"
End If
'yes/no/cancel
msg = MsgBox("Would you like some pie?", 3) 'you can add an icon by putting a + after the three and a 16, 32, 48, 64
If msg = 6 Then
MsgBox "You pressed yes...go help yourself."
ElseIf msg = 2 Then
MsgBox "You pressed cancel...it's good pie!"
ElseIf msg = 7 Then
MsgBox "You pressed no...it's good pie, my mom made it!"
End If
'yes/no
msg = MsgBox("Would you like some pie?", 4) 'you can add an icon by putting a + after the three and a 16, 32, 48, 64
If msg = 6 Then
MsgBox "You pressed yes...go help yourself."
Else
MsgBox "You pressed no...it's good pie!"
Exit Sub
End If
'retry/cancel
msg = MsgBox("Would you like some pie?", 5) 'you can add an icon by putting a + after the three and a 16, 32, 48, 64
If msg = 4 Then
MsgBox "You pressed retry...sorry, i ate all the pie!"
ElseIf msg = 2 Then
MsgBox "You pressed cancel...it's good pie!"
ElseIf msg = 7 Then
MsgBox "You pressed no...it's good pie, my mom made it!"
End If