Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
ItemBorderStyle Property
See Also  Example
Leadtools.WinForms Namespace > RasterImageList Class : ItemBorderStyle Property




Gets or sets the border style to draw around the RasterImageListItem in the control.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute("Border type to draw around each item.")>
<CategoryAttribute("Appearance")>
Public Property ItemBorderStyle As BorderStyle
Visual Basic (Usage)Copy Code
Dim instance As RasterImageList
Dim value As BorderStyle
 
instance.ItemBorderStyle = value
 
value = instance.ItemBorderStyle
C# 
[DescriptionAttribute("Border type to draw around each item.")]
[CategoryAttribute("Appearance")]
public BorderStyle ItemBorderStyle {get; set;}
Managed Extensions for C++ 
[DescriptionAttribute("Border type to draw around each item.")]
[CategoryAttribute("Appearance")]
public: __property BorderStyle get_ItemBorderStyle();
public: __property void set_ItemBorderStyle( 
   BorderStyle value
);
C++/CLI 
[DescriptionAttribute("Border type to draw around each item.")]
[CategoryAttribute("Appearance")]
public:
property BorderStyle ItemBorderStyle {
   BorderStyle get();
   void set (BorderStyle value);
}

Return Value

A BorderStyle enumeration that specifies the border to draw around the RasterImageListItem in the control.

Example

This example changes the border style around the image list items.

Visual BasicCopy Code
Public Sub RasterImageList_ItemBorderStyle(ByVal imageList As RasterImageList)
   ' Apply our custom item styles
   imageList.BeginUpdate()

   ' Make sure we are using Normal style
   imageList.ViewStyle = RasterImageListViewStyle.Normal

   ' Draw a border around the item
   imageList.ItemBorderStyle = BorderStyle.FixedSingle

   ' Draw a border around the image inside each item
   imageList.ItemImageBorderStyle = BorderStyle.FixedSingle

   ' Leave 10 pixels between each adjucent items
   imageList.ItemSpacingSize = New Size(10, 10)

   ' Apply a dark cyan/white color scheme
   imageList.ItemForeColor = Color.DarkCyan
   imageList.ItemSelectedForeColor = Color.White
   imageList.ItemBackColor = Color.White
   imageList.ItemSelectedBackColor = Color.DarkCyan

   imageList.EndUpdate()
End Sub
C#Copy Code
public void RasterImageList_ItemBorderStyle(RasterImageList imageList) 

   // Apply our custom item styles 
   imageList.BeginUpdate(); 
 
   // Make sure we are using Normal style 
   imageList.ViewStyle = RasterImageListViewStyle.Normal; 
 
   // Draw a border around the item 
   imageList.ItemBorderStyle = BorderStyle.FixedSingle; 
 
   // Draw a border around the image inside each item 
   imageList.ItemImageBorderStyle = BorderStyle.FixedSingle; 
 
   // Leave 10 pixels between each adjucent items 
   imageList.ItemSpacingSize = new Size(10, 10); 
 
   // Apply a dark cyan/white color scheme 
   imageList.ItemForeColor = Color.DarkCyan; 
   imageList.ItemSelectedForeColor = Color.White; 
   imageList.ItemBackColor = Color.White; 
   imageList.ItemSelectedBackColor = Color.DarkCyan; 
 
   imageList.EndUpdate(); 
}

Remarks

The ItemBorderStyle property is only supported when the value of the ViewStyle is set to RasterImageListViewStyle.Normal

When changing any of the item sizes or styles, you should pay special attention to the values you specify, in general, you should setup ItemSize to be large enough to accommodate ItemImageSize plus room for ItemBorderStyle and ItemImageBorderStyle. If you set the ShowItemText property to true, then you should also accommodate room for the item text in your calculations.

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also