←Select platform

ItemStyle Property

Summary

Gets or sets the style of how items are displayed in the control.

Syntax

C#
VB
C++
public ImageListItemStyle ItemStyle { get; set; } 
Public Property ItemStyle As Leadtools.Windows.Controls.ImageListItemStyle 

Property Value

A ImageListItemStyle enumeration that specifies how the items are displayed in the control. Default value is ImageListItemStyle.Normal.

Remarks

The ImageList control contains pre-defined styles for various ways to draw the items. It will set these predefined styles in the ItemContainerStyle property. When ImageListItemStyle.UserStyle is specified, it is up to you to set the required styles in ItemContainerStyle.

For more information, refer to the ImageListItemStyle enumeration.

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
using Leadtools; 
using Leadtools.Codecs; 
 
/// This example will show the different view styles of a <see cref="ImageList"/> control. 
public void ImageList_ItemStyle(ImageList imageList) 
{ 
   // Save the current view style 
   ImageListItemStyle currentStyle = imageList.ItemStyle; 
 
   // Show all the different styles available 
   Array a = Enum.GetValues(typeof(ImageListItemStyle)); 
   foreach (ImageListItemStyle style in a) 
   { 
      imageList.ItemStyle = style; 
      MessageBox.Show("ItemStyle = " + style.ToString()); 
   } 
 
   // Restore original view style 
   imageList.ItemStyle = currentStyle; 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Codecs 
Imports Leadtools 
 
''' This example will show the different view styles of a <see cref="ImageList"/> control. 
Public Sub ImageList_ItemStyle(ByVal imageList As ImageList) 
   ' Save the current view style 
   Dim currentStyle As ImageListItemStyle = imageList.ItemStyle 
 
   ' Show all the different styles available 
   Dim a As Array = System.Enum.GetValues(GetType(ImageListItemStyle)) 
   For Each style As ImageListItemStyle In a 
      imageList.ItemStyle = style 
      MessageBox.Show("ItemStyle = " & style.ToString()) 
   Next style 
 
   ' Restore original view style 
   imageList.ItemStyle = currentStyle 
End Sub 
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
/// This example will show the different view styles of a <see cref="ImageList"/> control. 
public void ImageList_ItemStyle(ImageList imageList) 
{ 
   // Save the current view style 
   ImageListItemStyle currentStyle = imageList.ItemStyle; 
 
   // Show all the different styles available 
   Array a = GetValues(typeof(ImageListItemStyle)); 
   foreach (ImageListItemStyle style in a) 
   { 
      imageList.ItemStyle = style; 
      MessageBox.Show("ItemStyle = " + style.ToString()); 
   } 
 
   // Restore original view style 
   imageList.ItemStyle = currentStyle; 
} 
Imports Leadtools.Windows.Controls 
 
''' This example will show the different view styles of a <see cref="ImageList"/> control. 
Public Sub ImageList_ItemStyle(ByVal imageList As ImageList) 
   ' Save the current view style 
   Dim currentStyle As ImageListItemStyle = imageList.ItemStyle 
 
   ' Show all the different styles available 
   Dim a As Array = GetValues(GetType(ImageListItemStyle)) 
   For Each style As ImageListItemStyle In a 
      imageList.ItemStyle = style 
      MessageBox.Show("ItemStyle = " & style.ToString()) 
   Next style 
 
   ' Restore original view style 
   imageList.ItemStyle = currentStyle 
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