Version

WrapText Property (ControlBase)

Gets/sets if the text is wrapped when there is not enough room to display the text.
Syntax
'Declaration
 
Public Property WrapText As Boolean
public bool WrapText {get; set;}
Example
This sample demonstrates initializing some of the common properties of the UltraLabel control.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Misc

Private Sub InitializeLabel(ByVal label As Infragistics.Win.Misc.UltraLabel)

    ' specify a gradient for the label
    label.Appearance.BackColor = SystemColors.Control
    label.Appearance.BackColor2 = SystemColors.ControlDarkDark
    label.Appearance.BackGradientStyle = GradientStyle.ForwardDiagonal


    ' initialize the borders and allow for 3 pixels betwen the 
    ' inner and outer borders
    label.BorderStyleInner = UIElementBorderStyle.Etched
    label.BorderStyleOuter = UIElementBorderStyle.RaisedSoft
    label.InnerBorderPadding = New Size(3, 3)


    ' set the text and make it so that an ellipse
    ' is displayed if all the text cannot be displayed
    label.Text = "&This is a long line of text that would usually wrap."
    label.WrapText = False
    label.Appearance.TextTrimming = TextTrimming.EllipsisCharacter
    label.AutoSize = False


    ' the ampersand in the text should be treated as an access key
    label.UseMnemonic = True


    ' set the image to be displayed
    label.ImageList = Me.imageList1
    label.ImageSize = New Size(16, 16)
    label.Appearance.Image = 2 ' 3rd image in the imagelist
    label.ImageTransparentColor = Color.Silver


    ' add some padding between the borders and the image and text
    label.Padding = New Size(2, 2)


    ' change the appearance when the mouse is over the label
    label.HotTracking = True
    label.HotTrackAppearance.BackColor = SystemColors.ControlDark
    label.HotTrackAppearance.BackColor2 = SystemColors.ControlLight
End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void InitializeLabel(Infragistics.Win.Misc.UltraLabel label)
{
	// specify a gradient for the label
	label.Appearance.BackColor = SystemColors.Control;
	label.Appearance.BackColor2 = SystemColors.ControlDarkDark;
	label.Appearance.BackGradientStyle  = GradientStyle.ForwardDiagonal;


	// initialize the borders and allow for 3 pixels betwen the 
	// inner and outer borders
	label.BorderStyleInner = UIElementBorderStyle.Etched;
	label.BorderStyleOuter = UIElementBorderStyle.RaisedSoft;
	label.InnerBorderPadding = new Size(3,3);


	// set the text and make it so that an ellipse
	// is displayed if all the text cannot be displayed
	label.Text = "&This is a long line of text that would usually wrap.";
	label.WrapText = false;
	label.Appearance.TextTrimming = TextTrimming.EllipsisCharacter;
	label.AutoSize = false;


	// the ampersand in the text should be treated as an access key
	label.UseMnemonic = true;


	// set the image to be displayed
	label.ImageList = this.imageList1;
	label.ImageSize = new Size(16,16);
	label.Appearance.Image = 2;	// 3rd image in the imagelist
	label.ImageTransparentColor = Color.Silver;

	// add some padding between the borders and the image and text
	label.Padding = new Size(2,2);


	// change the appearance when the mouse is over the label
	label.HotTracking = true;
	label.HotTrackAppearance.BackColor = SystemColors.ControlDark;
	label.HotTrackAppearance.BackColor2 = SystemColors.ControlLight;
}
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