Infragistics(R) NetAdvantage(R) Windows Forms
UltraGroupBox Class
Members  Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.Misc Namespace : UltraGroupBox Class

The UltraGroupBox represents a standard Windows GroupBox with a high degree of flexibility.

Syntax

Visual Basic (Declaration) 
Public Class UltraGroupBox 
   Inherits Infragistics.Win.UltraControlBase
   Implements Infragistics.Shared.IUltraLicensedComponent, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement 
C# 
public class UltraGroupBox : Infragistics.Win.UltraControlBase, Infragistics.Shared.IUltraLicensedComponent, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement  

Example

This snippet shows how to use the HeaderAppearance property to add an image to the header and fine-tune the position of the caption.

Visual BasicCopy Code
Imports Infragistics.Win

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

    ' Display an image in the header.
    Me.UltraGroupBox1.HeaderAppearance.Image = Bitmap.FromFile("c:\someSmallImage.bmp")

    ' Center the caption within the area of the header that it is being drawn.
    ' If you want to shift the location of the caption entirely, 
    ' use the CaptionAlignment property.
    Me.UltraGroupBox1.HeaderAppearance.TextHAlign = HAlign.Center

End Sub
C#Copy Code
using Infragistics.Win;

private void Form1_Load(object sender, System.EventArgs e)
{
	// Display an image in the header.
	this.ultraGroupBox1.HeaderAppearance.Image = Bitmap.FromFile( "c:\\someLittleImage.bmp" );

	// Center the caption within the area of the header that it is being drawn.
	// If you want to shift the location of the caption entirely, 
	// use the CaptionAlignment property.
	this.ultraGroupBox1.HeaderAppearance.TextHAlign = HAlign.Center;
}

Remarks

It can be configured so that the header (which includes the caption and optional image) appears on any of its four sides. By default the header is positioned on the border but it can also be outside of the border and inside of it as well.

See Also