我在使用以下代码编写 VB 2010 时遇到问题。
Public Sub about(ByVal sender As System.Object, ByVal e As System.EventArgs)
MessageBox.Show("Omega Management System © Shelby Taylor 2013 ******@gmail.com", MessageBoxButtons.OK, MessageBoxIcon.Information)
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, caption 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, caption As String) As System.Windows.Forms.DialogResult': Argument matching parameter 'text' narrows from 'System.Windows.Forms.MessageBoxButtons' to 'String'.
'Public Shared Function Show(owner As System.Windows.Forms.IWin32Window, text As String, caption As String) As System.Windows.Forms.DialogResult': Argument matching parameter 'caption' narrows from 'System.Windows.Forms.MessageBoxIcon' to 'String'.
'Public Shared Function Show(text As String, caption As String, buttons As System.Windows.Forms.MessageBoxButtons) As System.Windows.Forms.DialogResult': Argument matching parameter 'caption' narrows from 'System.Windows.Forms.MessageBoxButtons' to 'String'.
'Public Shared Function Show(text As String, caption As String, buttons As System.Windows.Forms.MessageBoxButtons) As System.Windows.Forms.DialogResult': Argument matching parameter 'buttons' narrows from 'System.Windows.Forms.MessageBoxIcon' to 'System.Windows.Forms.MessageBoxButtons'. M:\oms\omega_managment_system\WindowsApplication1\globalStructures.vb 21 9 Omega Managment System
而且我不明白发生了什么。有人可以解释一下问题是什么,以及如何解决吗?
谢谢你。