LEADTOOLS WPF and Silverlight (Leadtools.Windows.Controls assembly)

ItemStyle Property

Show in webframe
Example 





Gets or sets the style of how items are displayed in the control.
Syntax
[CategoryAttribute("Appearance")]
[DescriptionAttribute("Item styles.")]
public ImageListItemStyle ItemStyle {get; set;}
'Declaration
 
<CategoryAttribute("Appearance")>
<DescriptionAttribute("Item styles.")>
Public Property ItemStyle As ImageListItemStyle
'Usage
 
Dim instance As ImageList
Dim value As ImageListItemStyle
 
instance.ItemStyle = value
 
value = instance.ItemStyle

            

            
[CategoryAttribute("Appearance")]
[DescriptionAttribute("Item styles.")]
public:
property ImageListItemStyle ItemStyle {
   ImageListItemStyle get();
   void set (    ImageListItemStyle value);
}

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
Copy Code  
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;
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;
}
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
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"
x:Class="ScrollStyle.Window1"
x:Name="Window"
Title="Window1"
Width="640" Height="480" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic">
   <DockPanel>
     <Leadtools_Windows_Controls:ImageList Margin="8,46,8,196" HorizontalContentAlignment="Center" VerticalContentAlignment="Top" 
                                           Orientation="Vertical" ShowText="False" ItemForeground="#FF000000" ItemStyle="Normal" 
                                           ItemBorderThickness="2,2,2,2" ItemMargin="0,0,0,0" ItemSize="120,128" 
                                           ItemImageSize="102,102" DockPanel.Dock="Left">
       <Leadtools_Windows_Controls:ImageList.ItemBackground>
         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
           <GradientStop Color="#FFFFFFFF" Offset="0.329"/>
           <GradientStop Color="#FF415C85" Offset="0.548"/>
         </LinearGradientBrush>
       </Leadtools_Windows_Controls:ImageList.ItemBackground>
       <Leadtools_Windows_Controls:ImageList.ItemSelectedBackground>
         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
           <GradientStop Color="#FFF7F7F7" Offset="0.038"/>
           <GradientStop Color="#FFC9E00B" Offset="1"/>
         </LinearGradientBrush>
       </Leadtools_Windows_Controls:ImageList.ItemSelectedBackground>
       <Leadtools_Windows_Controls:ImageListItem Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg">
         <Leadtools_Windows_Controls:ImageListItem.Background>
           <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
             <GradientStop Color="#FFFCFDFD" Offset="0.258"/>
             <GradientStop Color="#FF2798D8" Offset="1"/>
             <GradientStop Color="#FE000101" Offset="0.498"/>
             <GradientStop Color="#FE01080B" Offset="0.058"/>
             <GradientStop Color="#FEFFFFFF" Offset="0.738"/>
           </LinearGradientBrush>
         </Leadtools_Windows_Controls:ImageListItem.Background>
       </Leadtools_Windows_Controls:ImageListItem>
       <Leadtools_Windows_Controls:ImageListItem Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg">
         <Leadtools_Windows_Controls:ImageListItem.Background>
           <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
             <GradientStop Color="#FF000000" Offset="0"/>
             <GradientStop Color="#FFC1D836" Offset="1"/>
           </LinearGradientBrush>
         </Leadtools_Windows_Controls:ImageListItem.Background>
       </Leadtools_Windows_Controls:ImageListItem>
       <Leadtools_Windows_Controls:ImageListItem Content="ImageListItem" ScrollViewer.HorizontalScrollBarVisibility="Visible" 
                                                 Source="file:///c:\users\Public\Documents\LEADTOOLS Images\eye.gif"/>
     </Leadtools_Windows_Controls:ImageList>
   </DockPanel>
 </Window>
Requirements

Target Platforms

See Also

Reference

ImageList Class
ImageList Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.