Version

Expanded Property

Gets and sets the expansion state of the UltraExpandableGroupBox.
Syntax
'Declaration
 
Public Property Expanded As Boolean
public bool Expanded {get; set;}
Remarks

When the value of this property is changed the UltraExpandableGroupBox will fire two events. First it will fire the ExpandedStateChanging event before the expanded state has been changed. A handler of that event can specify that the expansion state modification should be cancelled by setting the Cancel property on the System.ComponentModel.CancelEventArgs to true. After the expanded state has changed the ExpandedStateChanged event will fire. A handler of that event can perform tasks that need to be performed after an expansion state modification, such as changing the header caption.

Example
The following snippet shows how to use many of the different properties provided by the UltraExpandableGroupBox to customize it's appearance.

Imports Infragistics.Win

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    ' Make sure that the UltraExpandableGroupBox is expanded.
    Me.UltraExpandableGroupBox1.Expanded = True

    ' Set custom images for the expansion indicator when the control is collapsed and expanded.
    Me.UltraExpandableGroupBox1.ExpansionIndicatorCollapsed = Bitmap.FromFile("myCollapsedImage.bmp")
    Me.UltraExpandableGroupBox1.ExpansionIndicatorExpanded = Bitmap.FromFile("myExpandedImage.bmp")

    ' Prevent the expansion indicator from drawing a focus rectangle when the control has focus.
    Me.UltraExpandableGroupBox1.ShowFocus = False

    ' Allow the elements in the header to hottrack.
    Me.UltraExpandableGroupBox1.HotTracking = True

    ' Make the caption red when the header is being hottracked.
    Me.UltraExpandableGroupBox1.HeaderHotTrackingAppearance.ForeColor = Color.Red

    ' Ensure that the caption is not bold when the control is collapsed.
    Me.UltraExpandableGroupBox1.HeaderCollapsedAppearance.FontData.Bold = DefaultableBoolean.False

    ' Make the caption bold when the control is expanded.
    Me.UltraExpandableGroupBox1.HeaderExpandedAppearance.FontData.Bold = DefaultableBoolean.True

End Sub
using Infragistics.Win;

private void Form1_Load(object sender, System.EventArgs e)
{
	// Make sure that the UltraExpandableGroupBox is expanded.
	this.ultraExpandableGroupBox1.Expanded = true;

	// Set custom images for the expansion indicator when the control is collapsed and expanded.
	this.ultraExpandableGroupBox1.ExpansionIndicatorCollapsed = Bitmap.FromFile( "myCollapsedImage.bmp" );
	this.ultraExpandableGroupBox1.ExpansionIndicatorExpanded  = Bitmap.FromFile( "myExpandedImage.bmp" );

	// Prevent the expansion indicator from drawing a focus rectangle when the control has focus.
	this.ultraExpandableGroupBox1.ShowFocus = false;

	// Allow the elements in the header to hottrack.
	this.ultraExpandableGroupBox1.HotTracking = true;

	// Make the caption red when the header is being hottracked.
	this.ultraExpandableGroupBox1.HeaderHotTrackingAppearance.ForeColor = Color.Red;

	// Ensure that the caption is not bold when the control is collapsed.
    this.ultraExpandableGroupBox1.HeaderCollapsedAppearance.FontData.Bold = DefaultableBoolean.False;

	// Make the caption bold when the control is expanded.
	this.ultraExpandableGroupBox1.HeaderExpandedAppearance.FontData.Bold = DefaultableBoolean.True;
}
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