Version

ButtonAlignment Property (UltraMessageBoxManager)

Gets or set how the buttons will be horizontally aligned in the button area.
Syntax
'Declaration
 
Public Property ButtonAlignment As HAlign
public HAlign ButtonAlignment {get; set;}
Example
The following code demonstrate how to set some of the properties on the UltraMessageBoxManager

Private Sub InitializeUltraMessageBoxManager() 
    ' Set the Style so the dialog resembles the MessageBox as displayed on Vista 
    Me.ultraMessageBoxManager1.Style = MessageBoxStyle.Vista 
    
    ' Set the general appearance of the dialog. 
    Me.ultraMessageBoxManager1.Appearance.ForeColor = Color.White 
    Me.ultraMessageBoxManager1.Appearance.BackColor = Color.Black 
    Me.ultraMessageBoxManager1.Appearance.BackColor2 = Color.Gray 
    Me.ultraMessageBoxManager1.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.ForwardDiagonal 
    Me.ultraMessageBoxManager1.Appearance.BackGradientAlignment = Infragistics.Win.GradientAlignment.Client 
    
    ' Change the alignment of the buttons 
    Me.ultraMessageBoxManager1.ButtonAlignment = Infragistics.Win.HAlign.Center 
    
    ' Turn off OS Themes so the ButtonAppearance modifications will be honored 
    Me.ultraMessageBoxManager1.UseOsThemes = Infragistics.Win.DefaultableBoolean.[False] 
    
    ' Change the appearance of the buttons. 
    Me.ultraMessageBoxManager1.ButtonAppearance.BackColor = SystemColors.ControlDarkDark 
    Me.ultraMessageBoxManager1.ButtonAppearance.ForeColor = Color.White 
    
    ' Define the maximum and minimum width of the dialog (in pixels) 
    Me.ultraMessageBoxManager1.MaximumWidth = 600         
    Me.ultraMessageBoxManager1.MinimumWidth = 400

    ' Disable the playing of the default sounds 
    Me.ultraMessageBoxManager1.EnableSounds = Infragistics.Win.DefaultableBoolean.[False] 
End Sub
private void InitializeUltraMessageBoxManager()
{
    // Set the Style so the dialog resembles the MessageBox as displayed on Vista
    this.ultraMessageBoxManager1.Style = MessageBoxStyle.Vista;

    // Set the general appearance of the dialog.
    this.ultraMessageBoxManager1.Appearance.ForeColor = Color.White;
    this.ultraMessageBoxManager1.Appearance.BackColor = Color.Black;
    this.ultraMessageBoxManager1.Appearance.BackColor2 = Color.Gray;
    this.ultraMessageBoxManager1.Appearance.BackGradientStyle = Infragistics.Win.GradientStyle.ForwardDiagonal;
    this.ultraMessageBoxManager1.Appearance.BackGradientAlignment = Infragistics.Win.GradientAlignment.Client;

    // Change the alignment of the buttons
    this.ultraMessageBoxManager1.ButtonAlignment = Infragistics.Win.HAlign.Center;

    // Turn off OS Themes so the ButtonAppearance modifications will be honored
    this.ultraMessageBoxManager1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;

    // Change the appearance of the buttons.
    this.ultraMessageBoxManager1.ButtonAppearance.BackColor = SystemColors.ControlDarkDark;
    this.ultraMessageBoxManager1.ButtonAppearance.ForeColor = Color.White;

    // Define the maximum and minimum width of the dialog (in pixels)
    this.ultraMessageBoxManager1.MaximumWidth = 600;
    this.ultraMessageBoxManager1.MinimumWidth = 400;

    // Disable the playing of the default sounds
    this.ultraMessageBoxManager1.EnableSounds = Infragistics.Win.DefaultableBoolean.False;
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also