本文整理汇总了VB.NET中System.Windows.MessageBox.Show方法的典型用法代码示例。如果您正苦于以下问题:VB.NET MessageBox.Show方法的具体用法?VB.NET MessageBox.Show怎么用?VB.NET MessageBox.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了MessageBox.Show方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Hello, MessageBox!"
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message)
End Sub
示例2:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Message text"
Dim caption As String = "Caption text"
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message, caption)
End Sub
示例3:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Hello, MessageBox!"
Dim caption As String = "Caption text"
Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons)
End Sub
示例4:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Hello, MessageBox!"
Dim caption As String = "Caption text"
Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
Dim icon As MessageBoxImage = MessageBoxImage.Information
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon)
End Sub
示例5:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Hello, MessageBox!"
Dim caption As String = "Caption text"
Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
Dim icon As MessageBoxImage = MessageBoxImage.Information
Dim defaultResult As MessageBoxResult = MessageBoxResult.OK
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon, defaultResult)
End Sub
示例6:
Private Sub showMessageBoxButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Configure message box
Dim message As String = "Hello, MessageBox!"
Dim caption As String = "Caption text"
Dim buttons As MessageBoxButton = MessageBoxButton.OKCancel
Dim icon As MessageBoxImage = MessageBoxImage.Information
Dim defaultResult As MessageBoxResult = MessageBoxResult.OK
Dim options As MessageBoxOptions = MessageBoxOptions.RtlReading
' Show message box
Dim result As MessageBoxResult = MessageBox.Show(message, caption, buttons, icon, defaultResult, options)
End Sub