Version

IsSelected Property (GalleryToolItem)

Gets the value indicating whether this item is active.
Syntax
'Declaration
 
Public ReadOnly Property IsSelected As Boolean
public bool IsSelected {get;}
Example
The sample demonstrates how to handle the GalleryToolItemClick to determine when and item is clicked or selected.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.UltraWinToolbars

Private Sub UltraToolbarsManager1_GalleryToolItemClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.GalleryToolItemEventArgs) Handles UltraToolbarsManager1.GalleryToolItemClick
	' Use the event arguments to construct a message describing the item that was clicked.
	Dim message As String = e.Item.Title & " has been clicked in the " & e.ItemLocation.ToString() & " area. "

	' If the item is selected, include that in the message also. IsSelected will 
	' be true when the ItemStyle of the gallery owning the item is set to StateButton.
	' Otherwise, it will be false.
	If e.Item.IsSelected Then
		message = message & "It is now the selected item."
	End If

	MessageBox.Show(message)
End Sub
using System.Windows.Forms;
using Infragistics.Win.UltraWinToolbars;

private void ultraToolbarsManager1_GalleryToolItemClick( object sender, GalleryToolItemEventArgs e )
{
	// Use the event arguments to construct a message describing the item that was clicked.
	string message = e.Item.Title + " has been clicked in the " + e.ItemLocation.ToString() + " area. ";

	// If the item is selected, include that in the message also. IsSelected will 
	// be true when the ItemStyle of the gallery owning the item is set to StateButton.
	// Otherwise, it will be false.
	if ( e.Item.IsSelected )
		message += "It is now the selected item.";

	MessageBox.Show( message );			
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also