Gets/sets a value indicating whether the tree node responds to activation, selection, etc.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Overridable Property Enabled As Boolean |
| C# | |
|---|
public virtual bool Enabled {get; set;} |
Remarks
Example
The following sample code sets various properties on an UltraWinListbar.
| Visual Basic | Copy Code |
|---|
Private Sub InitializeListbar()
With Me.ultraListBar1
.BorderStyle = Infragistics.Win.UIElementBorderStyle.InsetSoft
.DefaultIcon = New Icon(Me.GetType(), "MyDefault.ico")
.DefaultStyle = Infragistics.Win.UltraWinListBar.Style.SmallIcons
.GroupHeadersVisible = True
.Orientation = Infragistics.Win.UltraWinListBar.Orientation.Vertical
.ShowContextMenus = True
Dim group As Infragistics.Win.UltraWinListBar.Group
Dim item As Infragistics.Win.UltraWinListBar.Item
.Groups.Clear()
group = .Groups.Add("G1", "Group header 1")
group.Style = Infragistics.Win.UltraWinListBar.Style.LargeIcons
group.Selected = True
item = group.Items.Add("I1", "Item 1 caption")
item.SmallImageIndex = 0
item.LargeImageIndex = 0
item = group.Items.Add("I2", "Item 2 caption")
item.SmallImageIndex = 1
item.LargeImageIndex = 1
group = Me.ultraListBar1.Groups.Add("G2", "Group header 2")
item = group.Items.Add("I1", "Group 2 - Item 1")
item.SmallImageIndex = 0
item.LargeImageIndex = 0
End With
End Sub
|
| C# | Copy Code |
|---|
private void InitializeListbar()
{
// Set the border style of the control
this.ultraListBar1.BorderStyle =
Infragistics.Win.UIElementBorderStyle.InsetSoft;
// Set the icon that will be used for items
// that don't specify their own
this.ultraListBar1.DefaultIcon =
new Icon( this.GetType(), "MyDefault.ico" );
// Set the default style to be used for
// new groups when they are added
this.ultraListBar1.DefaultStyle =
Infragistics.Win.UltraWinListBar.Style.SmallIcons;
// Specify whether group headers are visible (the default
// setting is true).
// Note: If this is set to 'false' then only the currently
// selected group's items are visible. In that case
// there would be no UI exposed by the listbar control
// for selecting another group.
// However, the listbar's 'SelectedGroup' property can
// be used to select another group in code.
this.ultraListBar1.GroupHeadersVisible =
true;
// Specify whether the listbar has a vertical
// or horizontal orientation
this.ultraListBar1.Orientation =
Infragistics.Win.UltraWinListBar.Orientation.Vertical;
// Have the control put up the default context menus.
// Note: if the control's 'ContextMenu' is set then
// this property setting is ignored.
this.ultraListBar1.ShowContextMenus =
true;
Infragistics.Win.UltraWinListBar.Group group;
Infragistics.Win.UltraWinListBar.Item item;
// First clear the groups collection since there is
// one group added by default
this.ultraListBar1.Groups.Clear();
// Add a group
group = this.ultraListBar1.Groups.Add("G1", "Group header 1"
);
// Set its style property if you don't want to use
// the default style set above
group.Style =
Infragistics.Win.UltraWinListBar.Style.LargeIcons;
// select this group
group.Selected = true;
// add items to the group and specify both the large and
// small image indexes for each.
// Note: If the index isn't specified of the corresponding
// Large/SmallImageList is null or doesn't have an image
// at that index then the DefaultIcon that was specified
// above will be used for that item.
item = group.Items.Add("I1", "Item 1 caption" );
item.SmallImageIndex = 0;
item.LargeImageIndex = 0;
item = group.Items.Add("I2",
"Item 2 caption" );
item.SmallImageIndex = 1;
item.LargeImageIndex = 1;
// Continue to add other groups and their items
group = this.ultraListBar1.Groups.Add("G2", "Group header 2"
);
item = group.Items.Add("I1",
"Group 2 - Item 1" );
item.SmallImageIndex = 0;
item.LargeImageIndex = 0;
} |
See Also