Pouknouki

CustomMessageBox C# code converted to VB .NET

Jan 1st, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.65 KB | None | 0 0
  1. Dim messageBox As New CustomMessageBox() With { _
  2.     Key .Caption = "Do you like this sample?", _
  3.     Key .Message = "There are tons of things you can do using custom message boxes. To learn more, be sure to check out the source code at CodePlex.", _
  4.     Key .LeftButtonContent = "yes", _
  5.     Key .RightButtonContent = "no" _
  6. }
  7.  
  8. messageBox.Dismissed += Function(s1, e1)
  9. Select Case e1.Result
  10.     Case CustomMessageBoxResult.LeftButton
  11.         ' Do something.
  12.         Exit Select
  13.     Case CustomMessageBoxResult.RightButton
  14.         ' Do something.
  15.         Exit Select
  16.     Case CustomMessageBoxResult.None
  17.         ' Do something.
  18.         Exit Select
  19.     Case Else
  20.         Exit Select
  21. End Select
  22.  
  23. End Function
  24.  
  25. messageBox.Show()
Advertisement
Add Comment
Please, Sign In to add comment