Gets or sets the brush used to draw the border of each item.
Supported in Silverlight, Windows Phone 7
Syntax
Example
Visual Basic | Copy 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.Background = New RadialGradientBrush(Colors.DarkGray, Colors.LightGray)
imageList.ItemBorderBrush = Brushes.Yellow
imageList.ItemStyle = ImageListItemStyle.Normal
imageList.ItemBorderThickness = New Thickness(5)
imageList.ItemMargin = New Thickness(10)
imageList.ItemSize = New Size(250, 250)
imageList.ItemImageSize = New Size(200, 200)
imageList.ItemSelectedForeground = Brushes.Blue
imageList.ItemSelectedBackground = Brushes.White
imageList.BorderThickness = New Thickness(5)
' Create three items
Dim imagesPath As String = LEAD_VARS.ImagesDir
For i As Integer = 0 To 2
' Load the image
Dim index As Integer = i + 1
Dim imageFileName As String = Path.Combine(imagesPath, "ImageProcessingDemo\Image" & index.ToString() & ".jpg")
Dim item As ImageListItem = New ImageListItem()
item.Source = New BitmapImage(New Uri(imageFileName))
item.Text = "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
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class |
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.Background = new RadialGradientBrush(Colors.DarkGray, Colors.LightGray);
imageList.ItemBorderBrush = Brushes.Yellow;
imageList.ItemStyle = ImageListItemStyle.Normal;
imageList.ItemBorderThickness = new Thickness(5);
imageList.ItemMargin = new Thickness(10);
imageList.ItemSize = new Size(250, 250);
imageList.ItemImageSize = new Size(200, 200);
imageList.ItemSelectedForeground = Brushes.Blue;
imageList.ItemSelectedBackground = Brushes.White;
imageList.BorderThickness = new Thickness(5);
// Create three items
string imagesPath = LEAD_VARS.ImagesDir;
for (int i = 0; i < 3; i++)
{
// Load the image
int index = i + 1;
string imageFileName = Path.Combine(imagesPath, @"ImageProcessingDemo\Image" + index.ToString() + ".jpg");
ImageListItem item = new ImageListItem();
item.Source = new BitmapImage(new Uri(imageFileName));
item.Text = "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();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
} |
SilverlightCSharp | Copy Code |
---|
class MyWindow2 : ChildWindow
{
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.Background = new RadialGradientBrush(Colors.DarkGray, Colors.LightGray);
imageList.ItemBorderBrush = new SolidColorBrush(Colors.Yellow);
imageList.ItemStyle = ImageListItemStyle.Normal;
imageList.ItemBorderThickness = new Thickness(5);
imageList.ItemMargin = new Thickness(10);
imageList.ItemSize = new Size(250, 250);
imageList.ItemImageSize = new Size(200, 200);
imageList.ItemSelectedForeground = new SolidColorBrush(Colors.Blue);
imageList.ItemSelectedBackground = new SolidColorBrush(Colors.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();
item.Source = new BitmapImage(new Uri(imageFileName));
item.Text = "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.Show();
} |
SilverlightVB | Copy Code |
---|
Private Class MyWindow2 : Inherits ChildWindow
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.Background = New RadialGradientBrush(Colors.DarkGray, Colors.LightGray)
imageList.ItemBorderBrush = New SolidColorBrush(Colors.Yellow)
imageList.ItemStyle = ImageListItemStyle.Normal
imageList.ItemBorderThickness = New Thickness(5)
imageList.ItemMargin = New Thickness(10)
imageList.ItemSize = New Size(250, 250)
imageList.ItemImageSize = New Size(200, 200)
imageList.ItemSelectedForeground = New SolidColorBrush(Colors.Blue)
imageList.ItemSelectedBackground = New SolidColorBrush(Colors.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()
item.Source = New BitmapImage(New Uri(imageFileName))
item.Text = "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.Show()
End Sub |
XAML | Copy 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 Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg" Text="slave.jpg" />
<Leadtools_Windows_Controls:ImageListItem Source="file:///c:\users\Public\Documents\LEADTOOLS Images\clean.tif" Text="clean.tif" />
</Leadtools_Windows_Controls:ImageList>
</DockPanel>
</Window> |
Requirements
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also