CodePudding user response:
Private Sub Command1_Click ()
If MsgBox ("?" , vbQuestion + vbYesNo)=vbYes Then
The Debug. Print "chose Yes
"The Else
The Debug. Print "chose No
"End the If
End Sub
CodePudding user response:
Can't trigger you want unless you use a form from the definition of a "dialog",Want to be in your call MsgBox or MessageBox. Show of code determine its return value, such as upstairs in the VB 6, the following c #
If (MessageBox. Show (" choose?" , "", MessageBoxButtons YesNo, MessageBoxIcon. Question)==DialogResult. Yes)
{
MessageBox (" click on the button "is" ");
}
The else
{
MessageBox (" click on the button "no" ");
}
Indeed you expect event processing, have been encapsulated in the corresponding function, provided no external interface,
CodePudding user response:
That is the message box system, like a function that provides you with a return value, you can according to the return value judgment points which button, and then call call question_Click a button click event of the processCodePudding user response:
This trigger is system level event!CodePudding user response:
If MessageBox. Show (... )=DialogResult. Yes ThenButton2. PerformClick ()
End If
CodePudding user response:
In fact you can customize a window class, the window class used to instantiate the message window, this type of implementation to support what you needCodePudding user response:
You don't call the function directly?