This event is generated when a thumbnail image is selected. Thumbnail images can be selected by clicking the mouse, using the keyboard, or executing the SelectImage method.

[Visual Basic] Public Event SelectFile As ThumbnailEventHandler
[C#] public event ThumbnailEventHandler SelectFile;

Event Data

The event handler retrieves arguments of type  ThumbnailEventArgs

Explanation

The SelectFile event is generated when a thumbnail image is selected. Thumbnail images can be selected by clicking the mouse, using the keyboard, or executing the SelectImage method. If the thumbnail image is not displayed on the Thumbnail Control then this event is not generated.

By pressing the Ctrl key while clicking with the mouse, several thumbnails can be selected or deselected. In either case, this event is generated. To determine whether or not a particular thumbnail image is selected, please use the IsSelected method.

Thumbnail images can be selected by clicking the mouse, using the keyboard, or executing the SelectImage method. By pressing the Shift key while clicking with the mouse, a series of thumbnails can be selected. This event is generated multiple times for each thumbnail image that has been selected.

Information about files loaded during this event can be referred to within the ThumbnailLoadEventArgs arguments.

Regarding the properties for the ThumbnailEventArgs class

If the selected thumbnail frame has no thumbnail displayed then the DirectoryName and FileName parameters will contain empty strings and the ImageNumber parameter will return -1. When multi-page image files are loaded, the page number is appended to the FileName parameter (If the page number is 0 then it is omitted).

Example: When page 2 of the file ABC.TIF is loaded into the thumbnail control, the FileName parameter will return the string "ABC.TIF 2".

Example

Displays the filename of the selected thumbnail

[Visual Basic.NET]
Private Sub Thumbnail1_SelectFile(ByVal sender As Object, ByVal e As Newtone.ImageKit.Wpf.ThumbnailEventArgs) Handles Thumbnail1.SelectFile
    If e.ImageNumber = -1 Then Exit Sub  ' disabled cell
Label1.Text = e.FileName; End Sub [Visual C#.NET] private void thumbnail1_SelectFile(object sender, Newtone.ImageKit.Wpf.ThumbnailEventArgs e) { if (e.ImageNumber == -1) return; //disabled cell label1.Text = e.FileName; }

See Also

Thumbnail Members | Newtone.ImageKit.Wpf.Thumbnail

 

The ImageKit WPF is created by Newtone Corporation