Infragistics2.Win.UltraWinListView.v8.1
Alignment Property
See Also  Example
Infragistics.Win.UltraWinListView Namespace > UltraListViewIconicViewSettingsBase Class : Alignment Property

Gets/sets whether items are laid out in a horizontal or vertical direction before wrapping to the next row or column.

Syntax

Visual Basic (Declaration) 
Public Property Alignment As ItemAlignment
C# 
public ItemAlignment Alignment {get; set;}

Example

The following code sample demonstrates how to use some of the properties of the UltraListViewIconicViewSettingsBase class.

Visual BasicCopy Code
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView


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

        ' Set the TextAreaAlignment so that the item values appear on top of the image
        Me.ultraListView1.ViewSettingsIcons.TextAreaAlignment = TextAreaAlignment.Top

        ' Allow only 1 line of text to display the item's Value,
        ' so that icons are aligned vertically
        Me.ultraListView1.ViewSettingsIcons.MaxLines = 1

        ' Set the Alignment property of the ViewSettingsIcons to 'TopToBottom'
        Me.ultraListView1.ViewSettingsIcons.Alignment = ItemAlignment.TopToBottom

        ' Increase the width of the item size by 10 pixels
        Dim itemSize As Size = Me.ultraListView1.ItemSizeResolved
        itemSize.Width += 10
        Me.ultraListView1.ViewSettingsIcons.ItemSize = itemSize

        ' Add some vertical space between the icon rows
        Me.ultraListView1.ViewSettingsIcons.Spacing = New Size(1, 10)

    End Sub
C#Copy Code
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;

       
private void Form1_Load(object sender, System.EventArgs e)
       {
               
//    Set the TextAreaAlignment so that the item values appear on top of the image
               
this.ultraListView1.ViewSettingsIcons.TextAreaAlignment = TextAreaAlignment.Top;

               
//    Allow only 1 line of text to display the item's Value,
               
//    so that icons are aligned vertically
               
this.ultraListView1.ViewSettingsIcons.MaxLines = 1;

               
//    Set the Alignment property of the ViewSettingsIcons to 'TopToBottom'
               
this.ultraListView1.ViewSettingsIcons.Alignment = ItemAlignment.TopToBottom;

               
//    Increase the width of the item size by 10 pixels
               
Size itemSize = this.ultraListView1.ItemSizeResolved;
               itemSize.Width += 10;
               
this.ultraListView1.ViewSettingsIcons.ItemSize = itemSize;

               
//    Add some vertical space between the icon rows
               
this.ultraListView1.ViewSettingsIcons.Spacing = new Size( 1, 10 );
       }

See Also