へのC#から変換した後、私はこれは、変換されたVB.NETのコードであるhttp://converter.telerik.com/エラーVB.NET
public static MessageBoxResult Show(string caption, string text, MessageBoxButton button, MessageBoxImage image)
{
_messageBox = new WpfMessageBox { Label1 = { Content = caption }, Label2 = { Content = text } };
return _result;
}
を経由してVB.NETのコードに以下のC#コードを変換しています。ここで
Public Shared Function Show(caption As String, text As String, button As MessageBoxButton, image As MessageBoxImage) As MessageBoxResult
_messageBox = New WpfMessageBox() With { _
Key .Label1 = {Key .Content = caption}, _
Key .Label2 = {Key .Content = text} _
}
Return _result
End Function
は誤りです:
これはvb.netでは間違いなく無効な構文です。インライン初期化を使用してWpfMessageBoxを初期化する方法については、読んでおく必要があります。または、最初にWpfMessageBoxのインスタンスを作成し、そのプロパティを設定します。 –