Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
ImageListItem Class
See Also  Members   Example 
Leadtools.Windows.Controls Namespace : ImageListItem Class





Represents an item in an ImageList control.

Syntax

Visual Basic (Declaration) 
<ContentPropertyAttribute("FileName")>
Public Class ImageListItem 
   Inherits ListBoxItem
Visual Basic (Usage)Copy Code
Dim instance As ImageListItem
C# 
[ContentPropertyAttribute("FileName")]
public class ImageListItem : ListBoxItem 
C++/CLI 
[ContentPropertyAttribute("FileName")]
public ref class ImageListItem : public ListBoxItem 
XAML Object Element Usage 

<ImageListItem .../>

XAML Object Element Usage 

<ImageListItem .../>

Example

For C#/VB examples, refer to ImageList.

XAMLCopy Code
<Window Height="600" Width="800" Title="using ImageListItem with ListBox Sample" 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"> 
  <DockPanel> 
    <ListBox Name="theListBox" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom"> 
      <Leadtools_Windows_Controls:ImageListItem ViewStyle="Normal" Image="file:///c:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" Text="slave.jpg" ShowText="True" SelectedForeground="Red" SelectedBackground="Yellow" FileName="e:\Program Files(32)\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" ImageSize="128,128" /> 
      <Leadtools_Windows_Controls:ImageListItem ViewStyle="Button" Image="file:///c:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\clean.tif" Text="clean.tif" ShowText="False" FileName="e:\Program Files(32)\LEAD Technologies\LEADTOOLS 16\Images\clean.tif" ImageSize="150,150" /> 
    </ListBox> 
  </DockPanel> 
</Window>

Remarks

The ImageList control is derived from ListBox. The main difference is that the ImageList supports viewing the BitmapSource in the number of different ways that items can be viewed by the user. The ImageListItem class defines the appearance and data associated with an item that is displayed in the ImageList control.

Most of the properties of the ImageListItem class provide ways to change the display of the item in the ImageList control it is associated with. The Image properties allows you to specify the image to view. Items also have a Text property that displays the text associated with this item.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Control
                     System.Windows.Controls.ContentControl
                        System.Windows.Controls.ListBoxItem
                           Leadtools.Windows.Controls.ImageListItem

Requirements

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

See Also