1.

Solve : VB code?

Answer»

Say I have a message box with two options: YES or NO.
What codes would I use that in the EVENT that I click YES, one message box comes up, and if I click NO, a different message box comes up? This is for use in VB6, but I was also wondering if the same codes could be used in NOTEPAD.
Thanks.Each the Yes and No buttons will return different return codes that you can test for:

Code: [Select]if vbYes Then msgbox("You pressed YES")
if vbNo Then msgbox("You pressed No")

Quote

This is for use in VB6, but I was also wondering if the same codes could be used in Notepad

Used how and for what purpose?

For the message box:

DIM Result as VBMsgBoxResult
Result = Msgbox("Original","Your original Messagebox",vbYesNo)
If Result = vbYes then
'Yes was pressed.
Else
'No was pressed
end if



Last time I checked notepad was a text editor, so I'll assume you MEAN batch files. although technically you could be working with VBScript or god knows what, making this question a bit broad in scope. If it was Batch, then you'll need a stub program of some kind so SHOW the message, I don't know of a command to do so.


Discussion

No Comment Found