Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.03.25
ScrollStyle Property
See Also  Example
Leadtools.Windows.Controls Namespace > ImageList Class : ScrollStyle Property





This member is available in the WPF Express Edition. See the LEADTOOLS products page for full details on more WPF features available with LEADTOOLS toolkits.

Specifies the direction the ImageList Control scrolls the displayed items. This is a dependency property.

Syntax

Visual Basic (Declaration) 
Public Property ScrollStyle As ImageListScrollStyle
Visual Basic (Usage)Copy Code
Dim instance As ImageList
Dim value As ImageListScrollStyle
 
instance.ScrollStyle = value
 
value = instance.ScrollStyle
C# 
public ImageListScrollStyle ScrollStyle {get; set;}
Managed Extensions for C++ 
public: __property ImageListScrollStyle get_ScrollStyle();
public: __property void set_ScrollStyle( 
   ImageListScrollStyle value
);
C++/CLI 
public:
property ImageListScrollStyle ScrollStyle {
   ImageListScrollStyle get();
   void set (ImageListScrollStyle value);
}
XAML Attributes Usage 

<object ScrollStyle=Leadtools.Windows.Controls.ImageListScrollStyle .../>

Dependency Property Information 

Identifier field

ScrollStyleProperty

Metadata properties set to true

None

Return Value

An ImageListScrollStyle enumeration value that specifies the direction the ImageList Control scrolls the displayed items. Default value is ImageListScrollStyle.Vertical.

Example

This example fills an ImageList control with 10 items. It will then show the difference between vertical and horizontal scrolling styles.

Visual BasicCopy Code
Public Sub ImageList_ScrollStyle(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(Nothing, "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(ImageListScrollStyle))
   For Each style As ImageListScrollStyle In a
      imageList.ScrollStyle = style
      MessageBox.Show("ScrollStyle = " & style.ToString())
   Next style

   ' Set vertical scrolling style
   imageList.ScrollStyle = ImageListScrollStyle.Vertical
End Sub
C#Copy Code
public void ImageList_ScrollStyle(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(null, "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(ImageListScrollStyle)); 
   foreach (ImageListScrollStyle style in a) 
   { 
      imageList.ScrollStyle = style; 
      MessageBox.Show("ScrollStyle = " + style.ToString()); 
   } 
 
   // Set vertical scrolling style 
   imageList.ScrollStyle = ImageListScrollStyle.Vertical; 
}

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also