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
Example
This example fills an ImageList control with 10 items.
It will then show the difference between vertical and horizontal scrolling styles.
Visual Basic | Copy Code |
---|
Public Sub ImageList_ScrollStyle(ByVal imageList As ImageList)
imageList.Items.Clear()
For i As Integer = 0 To 19
Dim index As Integer = i + 1
Dim item As ImageListItem = New ImageListItem(Nothing, "Item" & index.ToString())
If (i Mod 2) = 0 Then
item.IsSelected = True
End If
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
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