←Select platform

Orientation Property

Summary

Gets or sets the direction the ImageList control scrolls the displayed items.

Syntax

C#
VB
C++
public Orientation Orientation { get; set; } 
Public Property Orientation As Orientation 
public: 
property Orientation Orientation { 
   Orientation get(); 
   void set (    Orientation ); 
} 

Property Value

An System.Windows.Controls.Orientation enumeration that specifies the direction the ImageList control scrolls the displayed items. Default value is Orientation.Horizontal.

Remarks

When the value of this property is Orientation.Horizontal, the items are added in the control till all the horizontal space is filled, items then will be added in the next "row" and a vertical scrollbar might become visible and functional.

When the value of this property is Orientation.Vertical, the items are added in the control till all the vertical space is filled, items then will be added in the next "column" and a horizontal scrollbar might become visible and functional.

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
using Leadtools; 
using Leadtools.Codecs; 
 
public void ImageList_Orientation(ImageList imageList) 
{ 
   // Clear out any items in the image list 
   imageList.Items.Clear(); 
 
   // Create 20 items 
   for (int i = 0; i < 20; i++) 
   { 
      // Load the image 
      int index = i + 1; 
      ImageListItem item = new ImageListItem(); 
      item.Text = "item" + index.ToString(); 
 
 
      // Select every otehr item 
      if ((i % 2) == 0) 
         item.IsSelected = true; 
 
      // Add the item to the image list 
      imageList.Items.Add(item); 
   } 
 
   Array a = Enum.GetValues(typeof(Orientation)); 
   foreach (Orientation style in a) 
   { 
      imageList.Orientation = style; 
      MessageBox.Show("Orientation = " + style.ToString()); 
   } 
 
   // Set vertical scrolling style 
   imageList.Orientation = Orientation.Vertical; 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Codecs 
Imports Leadtools 
 
Public Sub ImageList_Orientation(ByVal imageList As ImageList) 
   ' Clear out any items in the image list 
   imageList.Items.Clear() 
 
   ' Create 20 items 
   For i As Integer = 0 To 19 
      ' Load the image 
      Dim index As Integer = i + 1 
      Dim item As ImageListItem = New ImageListItem() 
      item.Text = "item" & index.ToString() 
 
 
      ' Select every otehr item 
      If (i Mod 2) = 0 Then 
         item.IsSelected = True 
      End If 
 
      ' Add the item to the image list 
      imageList.Items.Add(item) 
   Next i 
 
   Dim a As Array = System.Enum.GetValues(GetType(Orientation)) 
   For Each style As Orientation In a 
      imageList.Orientation = style 
      MessageBox.Show("Orientation = " & style.ToString()) 
   Next style 
 
   ' Set vertical scrolling style 
   imageList.Orientation = Orientation.Vertical 
End Sub 
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
public void ImageList_Orientation(ImageList imageList) 
{ 
   // Clear out any items in the image list 
   imageList.Items.Clear(); 
 
   // Create 20 items 
   for (int i = 0; i < 20; i++) 
   { 
      // Load the image 
      int index = i + 1; 
      ImageListItem item = new ImageListItem(); 
      item.Text = "item" + index.ToString(); 
 
 
      // Select every otehr item 
      if ((i % 2) == 0) 
         item.IsSelected = true; 
 
      // Add the item to the image list 
      imageList.Items.Add(item); 
   } 
 
   Array a = GetValues(typeof(Orientation)); 
   foreach (Orientation style in a) 
   { 
      imageList.Orientation = style; 
      MessageBox.Show("Orientation = " + style.ToString()); 
   } 
 
   // Set vertical scrolling style 
   imageList.Orientation = Orientation.Vertical; 
} 
Imports Leadtools.Windows.Controls 
 
Public Sub ImageList_Orientation(ByVal imageList As ImageList) 
   ' Clear out any items in the image list 
   imageList.Items.Clear() 
 
   ' Create 20 items 
   For i As Integer = 0 To 19 
      ' Load the image 
      Dim index As Integer = i + 1 
      Dim item As ImageListItem = New ImageListItem() 
      item.Text = "item" & index.ToString() 
 
 
      ' Select every otehr item 
      If (i Mod 2) = 0 Then 
         item.IsSelected = True 
      End If 
 
      ' Add the item to the image list 
      imageList.Items.Add(item) 
   Next i 
 
   Dim a As Array = GetValues(GetType(Orientation)) 
   For Each style As Orientation In a 
      imageList.Orientation = style 
      MessageBox.Show("Orientation = " & style.ToString()) 
   Next style 
 
   ' Set vertical scrolling style 
   imageList.Orientation = Orientation.Vertical 
End Sub 

Requirements

Target Platforms

See Also

Reference

ImageList Class

ImageList Members

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Controls Assembly