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





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.

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;}
Managed Extensions for C++ 
public: __property Brush get_ItemBorderBrush();
public: __property void set_ItemBorderBrush( 
   Brush value
);
C++/CLI 
public:
property Brush ItemBorderBrush {
   Brush get();
   void set (Brush value);
}
XAML 
For XAML information, see the Brush type.

Dependency 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 = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\"

      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 = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\"; 
 
      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(); 
}

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