Version

CaptionAlignment Property

Gets/sets the position of the control’s caption relative to the header edge closest to the first character of the caption.
Syntax
'Declaration
 
Public Property CaptionAlignment As GroupBoxCaptionAlignment
public GroupBoxCaptionAlignment CaptionAlignment {get; set;}
Remarks

This property controls where the caption appears in the header. The behavioral invariant of this property is that setting it to 'Near' will cause the caption to be rendered such that the first character is close to an edge of the header. In other words, setting this property to 'Far' will cause the last character of the caption to be rendered close to an edge of the header (possibly leaving a large gap between the first character and a header edge).

If the header is horizontal then setting this property to 'Near' means that the caption will be rendered on the left side of the header. If the header is vertical (i.e. on the left or right edge of the control) then the VerticalTextOrientation property must be taken into consideration to determine where the caption will appear. This is due to the fact that the VerticalTextOrientation property changes the direction that the caption is rendered.

Example
This snippet demonstrates how to manipulate the location of the control's caption within the header.

The caption of the control can appear in three distinct locations in the header. The "header" is the logical area of the control which contains the caption, an optional image, and (in the UltraExpandableGroupBox) an optional expansion indicator. This snippet shows how you can use the CaptionAlignment property to manipulate the location of the caption.
Imports Infragistics.Win.Misc

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

    ' Center the control's caption in the header.
    Me.UltraGroupBox1.CaptionAlignment = GroupBoxCaptionAlignment.Center

End Sub
The caption of the control can appear in three distinct locations in the header. The "header" is the logical area of the control which contains the caption, an optional image, and (in the UltraExpandableGroupBox) an optional expansion indicator. This snippet shows how you can use the CaptionAlignment property to manipulate the location of the caption.
using Infragistics.Win.Misc;

private void Form1_Load(object sender, System.EventArgs e)
{
	// Center the control's caption in the header.
	this.ultraGroupBox1.CaptionAlignment = GroupBoxCaptionAlignment.Center;
}
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