Visual Basic (Declaration) | |
---|---|
<DefaultEventAttribute("SelectedIndexChanged")> <DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="Leadtools.WinForms.RasterImageListDesigner, Leadtools.WinForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")> <ToolboxBitmapAttribute()> <DefaultPropertyAttribute("ViewStyle")> Public Class RasterImageList Inherits Control |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
[DefaultEventAttribute("SelectedIndexChanged")] [DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="Leadtools.WinForms.RasterImageListDesigner, Leadtools.WinForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")] [ToolboxBitmapAttribute()] [DefaultPropertyAttribute("ViewStyle")] public class RasterImageList : Control |
Managed Extensions for C++ | |
---|---|
[DefaultEventAttribute("SelectedIndexChanged")] [DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="Leadtools.WinForms.RasterImageListDesigner, Leadtools.WinForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")] [ToolboxBitmapAttribute()] [DefaultPropertyAttribute("ViewStyle")] public __gc class RasterImageList : public Control |
C++/CLI | |
---|---|
[DefaultEventAttribute("SelectedIndexChanged")] [DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="Leadtools.WinForms.RasterImageListDesigner, Leadtools.WinForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")] [ToolboxBitmapAttribute()] [DefaultPropertyAttribute("ViewStyle")] public ref class RasterImageList : public Control |
This example creates an instance of a RasterImageList control and adds it to a form Next three images are loaded to populate the control. The PaintBackground event is used to fill the background of a control with a gradient brush.
Visual Basic | Copy Code |
---|---|
Private Class MyForm1 : Inherits Form |
C# | Copy Code |
---|---|
class MyForm1 : Form |
The RasterImageList control lets you display and manipulate a list of images. The RasterImageList control contains a list of items that can be used to view thumbnails of RasterImage objects.
A RasterImageList control allows you to display a list of items with text and an RasterImage.
For example, the Windows Explorer in Thumbnails mode is similar in appearance to a
RasterImageList control. The RasterImageListItem class represents an item within a
RasterImageList control. The items that are displayed in the list can be shown using one of the
RasterImageListViewStyle styles.
RasterImageList supports single or multiple item selection. The multiple selection
feature lets the user select from a list of items in a way similar to a ListBox control.
Additionally, the user can activate selected items to perform a task. For example, you could use a
RasterImageList control to display a list of files that the application can then open and utilize.
The user can select the files to open and then double-click them to activate the items and open the files in the
application.
RasterImageList provides a large number of properties that provide flexibility in appearance and behavior. The ViewStyle property allows you to change the way in which items are displayed. Items are added and removed from the RasterImageList through the Items property. The Items property allows you to access the RasterImageListItemCollection of the control, which provides methods for manipulating the items in the control. When your control contains a large number of items, it is often easier for the user to see them in a sorted list. You can use the Sorting property to sort the items alphabetically.
In addition to the many properties that are available for a RasterImageList control, there are methods and events that your application can use to provide additional capabilities to the RasterImageList. The BeginUpdate and EndUpdate methods allow you to add many items to a RasterImageList without displaying the repainting of the control each time an item is added, thus improving performance. You you may want to provide functionality when the user right-clicks an item. To determine the item which is being clicked, you can use the HitTest method or you can manually calculate what item is displayed in what position using the GetItemRectangle method. Sometimes you want to display a specific item to the user to view. The EnsureVisible method can be called to ensure that the specific item is in the visible area of the control.
When the user changes the selected items with the keyboard or mouse, the control will fire the SelectedIndexChanged event. You can then read the SelectedItems to get a list of the currently selected items.
NOTE: For automatic generation of thumbnails from files stored on your computer, see RasterThumbnailBrowser.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
Leadtools.WinForms.RasterImageList
Leadtools.WinForms.RasterThumbnailBrowser
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