Provides data for the QueryImageEventHandler event.
For a list of all members of this type, see QueryImageEventArgs Members.
System.Object
System.EventArgs
Skybound.AutoComplete.AutoCompleteEventArgs
Skybound.AutoComplete.QueryImageEventArgs
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The QueryImage event is raised by the AutoCompleteManager component when it needs to determine which image to display beside an item in the list. When you handle the MeasureItem event, you should set the value of the ImageIndex property before you leave the event handler to specify which image is used.
This example chooses one of two images, depending on whether a user is online. For this example, we need to assume a few things: an array of UserInfo objects is being used as the data source for autocompletion, and that an ImageList with two images has been created and assigned to the control.
[C#]
private void autoComplete1_QueryImage(object sender,
Skybound.AutoComplete.QueryImageEventArgs e)
{
// determine whether the user is online
if ((e.ItemValue as UserInfo).IsOnline)
e.ImageIndex = 0; // the first image in the list is used for online users
else
e.ImageIndex = 1; // the second image is used for offline users
}
[Visual Basic]
Private Sub autoComplete1_QueryImage(ByVal sender As Object, _
ByVal e As Skybound.AutoComplete.QueryImageEventArgs)
' determine whether the user is online
If CType(e.ItemValue,UserInfo).IsOnline Then
' the first image in the ImageList is used for online users
e.ImageIndex = 0
Else
' the second image is used for offline users
e.ImageIndex = 1
End If
End Sub
Namespace: Skybound.AutoComplete
Assembly: Skybound.AutoComplete (in Skybound.AutoComplete.dll)
QueryImageEventArgs Members | Skybound.AutoComplete Namespace