Skybound AutoComplete

QueryImageEventArgs Class

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

[Visual Basic]
Public Class QueryImageEventArgs
    Inherits AutoCompleteEventArgs
[C#]
public class QueryImageEventArgs : AutoCompleteEventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

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.

Example

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

Requirements

Namespace: Skybound.AutoComplete

Assembly: Skybound.AutoComplete (in Skybound.AutoComplete.dll)

See Also

QueryImageEventArgs Members | Skybound.AutoComplete Namespace