VB.Net by API/System.Windows.Forms/DialogResult

Материал из VB Эксперт
Версия от 12:52, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

DialogResult.Abort

  
Imports System.Windows.Forms
Public Class Test
    Public Shared Sub Main
        Dim drResult As DialogResult
        drResult = MessageBox.Show("Q?", "Sample", MessageBoxButtons.RetryCancel)
    
        If drResult = DialogResult.Retry Then
          Console.WriteLine("Retry")
        Else
          Console.WriteLine("Cancel")
        End If
    
        Select Case MessageBox.Show("Bad stuff happened","Long Process", MessageBoxButtons.AbortRetryIgnore)
          Case DialogResult.Abort
            Console.WriteLine("abort")
          Case DialogResult.Retry
            Console.WriteLine("retry")
          Case DialogResult.Cancel
            Console.WriteLine("cancel")
          Case Else
            Console.WriteLine("Else")
        End Select
    End Sub
End Class


DialogResult.Cancel

  
Imports System.Windows.Forms
Public Class Test
    Public Shared Sub Main
        Dim drResult As DialogResult
        drResult = MessageBox.Show("Q?", "Sample", MessageBoxButtons.RetryCancel)
    
        If drResult = DialogResult.Retry Then
          Console.WriteLine("Retry")
        Else
          Console.WriteLine("Cancel")
        End If
    
        Select Case MessageBox.Show("Bad stuff happened","Long Process", MessageBoxButtons.AbortRetryIgnore)
          Case DialogResult.Abort
            Console.WriteLine("abort")
          Case DialogResult.Retry
            Console.WriteLine("retry")
          Case DialogResult.Cancel
            Console.WriteLine("cancel")
          Case Else
            Console.WriteLine("Else")
        End Select
    End Sub
End Class


DialogResult.Retry

  
Imports System.Windows.Forms
Public Class Test
    Public Shared Sub Main
        Dim drResult As DialogResult
        drResult = MessageBox.Show("Q?", "Sample", MessageBoxButtons.RetryCancel)
    
        If drResult = DialogResult.Retry Then
          Console.WriteLine("Retry")
        Else
          Console.WriteLine("Cancel")
        End If
    
        Select Case MessageBox.Show("Bad stuff happened","Long Process", MessageBoxButtons.AbortRetryIgnore)
          Case DialogResult.Abort
            Console.WriteLine("abort")
          Case DialogResult.Retry
            Console.WriteLine("retry")
          Case DialogResult.Cancel
            Console.WriteLine("cancel")
          Case Else
            Console.WriteLine("Else")
        End Select
    End Sub
End Class