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





Gets or sets the item border brush of the items in this ImageList. This is a dependency property.

Syntax

Visual Basic (Declaration) 
Public Property ItemBorderBrush As Brush
Visual Basic (Usage)Copy Code
Dim instance As ImageList
Dim value As Brush
 
instance.ItemBorderBrush = value
 
value = instance.ItemBorderBrush
C# 
public Brush ItemBorderBrush {get; set;}
C++/CLI 
public:
property Brush ItemBorderBrush {
   Brush get();
   void set (Brush value);
}
XAML Syntax 
For XAML information, see the Brush type.

Dependencies Property Information 

Identifier field

ItemBorderBrushProperty

Metadata properties set to true

None

XAML Syntax 
For XAML information, see the Brush type.

Dependencies Property Information 

Identifier field

ItemBorderBrushProperty

Metadata properties set to true

None

Return Value

The items border brush in this ImageList

Example

Visual BasicCopy Code
Private Class MyWindow2 : Inherits Window
    Public imageList As ImageList
    Public Sub New(ByVal title As String)
        title = title
        ' Set the size of the window
        Width = 400
        Height = 200

        ' Create a new ImageList control.
        imageList = New ImageList()
        imageList.Width = Double.NaN
        imageList.Height = Double.NaN

        imageList.Items.SortDescriptions.Clear()
        imageList.Background = New RadialGradientBrush(Colors.DarkGray, Colors.LightGray)

        imageList.ItemBorderBrush = Brushes.Yellow
        imageList.ViewStyle = ImageListViewStyle.Normal
        imageList.ItemBorderThickness = New Thickness(5)
        imageList.ItemMargin = New Thickness(10)

        imageList.ItemSize = New Size(250, 250)
        imageList.ImageSize = New Size(200, 200)

        imageList.ItemSelectedForeground = Brushes.Blue
        imageList.ItemSelectedBackground = Brushes.White
        imageList.BorderThickness = New Thickness(5)


        ' Create three items
        Dim imagesPath As String = LeadtoolsExamples.Common.ImagesPath.Path + ""

        For i As Integer = 0 To 2
            ' Load the image
            Dim index As Integer = i + 1
            Dim imageFileName As String = imagesPath & "Image" & index.ToString() & ".jpg"

            Dim item As ImageListItem = New ImageListItem(New BitmapImage(New Uri(imageFileName)), "item" & index.ToString())

            ' Select the first item
            If i = 0 Then
                item.IsSelected = True
            End If

            ' Add the item to the image list
            imageList.Items.Add(item)
        Next i

        ' Add the ImageList to the Window.
        Content = imageList
    End Sub
End Class

Public Sub ImageList_ItemBorderBrush(ByVal title As String)
    Dim window As MyWindow2 = New MyWindow2(title)
    window.ShowDialog()
End Sub
C#Copy Code
class MyWindow2 : Window 

   public ImageList imageList; 
   public MyWindow2(string title) 
   { 
      Title = title; 
      // Set the size of the window 
      Width = 400; 
      Height = 200; 
 
      // Create a new ImageList control. 
      imageList = new ImageList(); 
      imageList.Width = Double.NaN; 
      imageList.Height = Double.NaN; 
 
      imageList.Items.SortDescriptions.Clear(); 
      imageList.Background = new RadialGradientBrush(Colors.DarkGray, Colors.LightGray); 
 
      imageList.ItemBorderBrush = Brushes.Yellow; 
      imageList.ViewStyle = ImageListViewStyle.Normal; 
      imageList.ItemBorderThickness = new Thickness(5); 
      imageList.ItemMargin = new Thickness(10); 
 
      imageList.ItemSize = new Size(250, 250); 
      imageList.ImageSize = new Size(200, 200); 
 
      imageList.ItemSelectedForeground = Brushes.Blue; 
      imageList.ItemSelectedBackground = Brushes.White; 
      imageList.BorderThickness = new Thickness(5); 
 
 
      // Create three items 
      string imagesPath = LeadtoolsExamples.Common.ImagesPath.Path; 
 
      for (int i = 0; i < 3; i++) 
      { 
         // Load the image 
         int index = i + 1; 
         string imageFileName = imagesPath + "Image" + index.ToString() + ".jpg"; 
 
         ImageListItem item = new ImageListItem(new BitmapImage(new Uri(imageFileName)), "item" + index.ToString()); 
 
         // Select the first item 
         if (i == 0) 
            item.IsSelected = true; 
 
         // Add the item to the image list 
         imageList.Items.Add(item); 
      } 
 
      // Add the ImageList to the Window. 
      Content = imageList; 
   } 

 
public void ImageList_ItemBorderBrush(string title) 

   MyWindow2 window = new MyWindow2(title); 
   window.ShowDialog(); 
}
XAMLCopy Code
<Window Height="600" Width="800" Title="ItemBorderBrush 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> 
    <Leadtools_Windows_Controls:ImageList Name="theImageList" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom" ItemBorderBrush="Red" ItemSelectedForeground="Blue" ItemSelectedBackground="Yellow"> 
      <Leadtools_Windows_Controls:ImageListItem ViewStyle="Normal" Image="file:///C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" Text="slave.jpg" /> 
      <Leadtools_Windows_Controls:ImageListItem ViewStyle="Normal" Image="file:///e:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\clean.tif" Text="clean.tif" /> 
    </Leadtools_Windows_Controls:ImageList> 
  </DockPanel> 
</Window>

Remarks

How the ItemBorderBrush value is used to draw the items depends on the current ViewStyle. The following table lists all the cases:
ViewStyleDescription
ImageListViewStyle.NormalFills the background of the selected items.
ImageListViewStyle.ExplorerNot used.
ImageListViewStyle.ButtonNot used.

For more information about item appearance, refer to ImageList Appearance.

Requirements

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

See Also