Vb.net 正在尝试按退出按钮

Vb.net 正在尝试按退出按钮,vb.net,button,Vb.net,Button,我有一些我不确定的代码,我以为它在一个老项目上工作,但不确定我在哪里把它搞砸了 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing If MessageBox.Show("Are you sure?", MessageBox.Show(vbYesNo)) = Windows.Forms.DialogResult.No Then e.Can

我有一些我不确定的代码,我以为它在一个老项目上工作,但不确定我在哪里把它搞砸了

Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
    If MessageBox.Show("Are you sure?", MessageBox.Show(vbYesNo)) = Windows.Forms.DialogResult.No Then e.Cancel = True
End Sub
这是我最大的错误:

Error   1   Overload resolution failed because no accessible 'Show' can be called without a narrowing conversion:
    'Public Shared Function Show(owner As System.Windows.Forms.IWin32Window, text As String) As System.Windows.Forms.DialogResult': Argument matching parameter 'owner' narrows from 'String' to 'System.Windows.Forms.IWin32Window'.
    'Public Shared Function Show(owner As System.Windows.Forms.IWin32Window, text As String) As System.Windows.Forms.DialogResult': Argument matching parameter 'text' narrows from 'System.Windows.Forms.DialogResult' to 'String'.
    'Public Shared Function Show(text As String, caption As String) As System.Windows.Forms.DialogResult': Argument matching parameter 'caption' narrows from 'System.Windows.Forms.DialogResult' to 'String'

为什么里面有
MessageBox.Show(vbYesNo)
而不是
vbYesNo

编辑:
少一点讽刺:没有重载的
Show
将字符串和DialogResult作为参数,也没有重载的MsgBoxStyle参数。 也没有采用字符串和MsgBoxStyle常量的重载。 你可能是说

MsgBox("Are you sure?", vbYesNo)


这是[vb.net]还是[vba]?这只是一个简单的计算器,我正在尝试让它工作,我在没有它的情况下尝试过,我会继续尝试,但这只是我认为我以前见过的最后一次尝试。
MessageBox.Show("Are you sure?", "Caption", MessageBoxButtons.YesNo)