Msgbox显示两次

时间:2014-05-07 04:28:51

标签: vb.net

在Visual Basic 2012中,当我为任何动作添加Msgbox时,Msgbox显示两次

我的Msgbox代码

    Dim msg1
msg1 = MsgBox("Form2.show",MsgBoxStyle.Information Or MsgBoxStyle.YesNo,"Form2")

If msg1 = vbYes Then Form2.Show()

else

end if

1 个答案:

答案 0 :(得分:0)

    Dim msg1
    msg1 = MsgBox("Form2.show", MsgBoxStyle.Information Or MsgBoxStyle.YesNo, "Form2")
    If msg1 = vbYes Then
        Me.Show()
    ElseIf msg1 = vbNo Then
        Me.Close() 'put here what you want to do
    End If
End Sub