'宣言 Public Property Style As MessageBoxStyle
public MessageBoxStyle Style {get; set;}
Private Sub ShowContinueMessage(ByVal message As String) Using ultraMessageBoxInfo As New UltraMessageBoxInfo() ' Set the general display style ultraMessageBoxInfo.Style = MessageBoxStyle.Vista ' Set the text for the Text, Caption, Header and Footer ultraMessageBoxInfo.Text = message ultraMessageBoxInfo.Caption = "Continue?" ultraMessageBoxInfo.Header = "Would you like to continue" ultraMessageBoxInfo.Footer = "Continuing without restarting can produce unpredictable behaviors." ' Specify which buttons should be used and which is the default button ultraMessageBoxInfo.Buttons = MessageBoxButtons.AbortRetryIgnore ultraMessageBoxInfo.DefaultButton = MessageBoxDefaultButton.Button2 ultraMessageBoxInfo.ShowHelpButton = Infragistics.Win.DefaultableBoolean.[False] ' Display the OS Error Icon ultraMessageBoxInfo.Icon = MessageBoxIcon.[Error] ' Disable the default sounds ultraMessageBoxInfo.EnableSounds = Infragistics.Win.DefaultableBoolean.[False] ' Show the UltraMessageBox Me.ultraMessageBoxManager1.ShowMessageBox(ultraMessageBoxInfo) End Using End Sub
private void ShowContinueMessage(string message) { using (UltraMessageBoxInfo ultraMessageBoxInfo = new UltraMessageBoxInfo()) { // Set the general display style ultraMessageBoxInfo.Style = MessageBoxStyle.Vista; // Set the text for the Text, Caption, Header and Footer ultraMessageBoxInfo.Text = message; ultraMessageBoxInfo.Caption = "Continue?"; ultraMessageBoxInfo.Header = "Would you like to continue"; ultraMessageBoxInfo.Footer = "Continuing without restarting can produce unpredictable behaviors."; // Specify which buttons should be used and which is the default button ultraMessageBoxInfo.Buttons = MessageBoxButtons.AbortRetryIgnore; ultraMessageBoxInfo.DefaultButton = MessageBoxDefaultButton.Button2; ultraMessageBoxInfo.ShowHelpButton = Infragistics.Win.DefaultableBoolean.False; // Display the OS Error Icon ultraMessageBoxInfo.Icon = MessageBoxIcon.Error; // Disable the default sounds ultraMessageBoxInfo.EnableSounds = Infragistics.Win.DefaultableBoolean.False; // Show the UltraMessageBox this.ultraMessageBoxManager1.ShowMessageBox(ultraMessageBoxInfo); } }