Infragistics(R) NetAdvantage(R) Windows Forms
IsSelected Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.Misc Namespace > UltraNavigationBarRootLocation Class : IsSelected Property

Returns whether this Infragistics.Win.Misc.UltraNavigationBarRootLocation is currently in the selected state.

Syntax

Visual Basic (Declaration) 
Public Overrides ReadOnly Property IsSelected As Boolean
C# 
public override bool IsSelected {get;}

Example

The following code sample demonstrates how to use the state-related properties of the UltraNavigationBarLocation class:

Visual BasicCopy Code
Imports System
Imports System.Drawing
Imports System.IO
Imports System.Collections.Generic
Imports System.ComponentModel
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Misc
Imports Infragistics.Win.Misc.UltraWinNavigationBar

		Private Function GetLocationState(ByVal location As UltraNavigationBarLocation) As LocationUIState

        If (location Is Nothing) Then Throw New ArgumentNullException("location")

        Dim retVal As LocationUIState = LocationUIState.Normal

        If location.IsButtonActive Then retVal = retVal Or LocationUIState.ButtonActive
        If location.IsDropDownButtonHotTracked Then retVal = retVal Or LocationUIState.DropDownButtonHotTracked
        If location.IsExpanded Then retVal = retVal Or LocationUIState.Expanded
        If location.IsListItemActive Then retVal = retVal Or LocationUIState.ListItemActive
        If location.IsListItemHotTracked Then retVal = retVal Or LocationUIState.ListItemHotTracked
        If location.IsPressed Then retVal = retVal Or LocationUIState.Pressed
        If location.IsSelected Then retVal = retVal Or LocationUIState.Selected
        If location.IsTextButtonHotTracked Then retVal = retVal Or LocationUIState.TextButtonHotTracked

        Return retVal

		End Function
C#Copy Code
using System;
using System.Drawing;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;
using Infragistics.Win.Misc.UltraWinNavigationBar;

    private LocationUIState GetLocationState( UltraNavigationBarLocation location )
    {
        if ( location == null )
            throw new ArgumentNullException("location");

        LocationUIState retVal = LocationUIState.Normal;

        if ( location.IsButtonActive )
            retVal |= LocationUIState.ButtonActive;

        if ( location.IsDropDownButtonHotTracked )
            retVal |= LocationUIState.DropDownButtonHotTracked;

        if ( location.IsExpanded )
            retVal |= LocationUIState.Expanded;

        if ( location.IsListItemActive )
            retVal |= LocationUIState.ListItemActive;

        if ( location.IsListItemHotTracked )
            retVal |= LocationUIState.ListItemHotTracked;

        if ( location.IsPressed )
            retVal |= LocationUIState.Pressed;

        if ( location.IsSelected )
            retVal |= LocationUIState.Selected;

        if ( location.IsTextButtonHotTracked )
            retVal |= LocationUIState.TextButtonHotTracked;

        return retVal;
    }

Remarks

"Selected" in the context of an UltraNavigationBarLocation is defined as the one location referenced by its UltraNavigationBarLocation.Parent locations's Infragistics.Win.Misc.UltraNavigationBarLocation.SelectedLocation property. Any given location, including the RootLocation, can have only one of it child locations selected at any given time. The UltraNavigationBar's SelectedLocation property always returns the terminal location on the navigation path; this location is defined as the only member of the navigation path that returns null from its Infragistics.Win.Misc.UltraNavigationBarLocation.SelectedLocation property. All locations in the control's navigation path are the SelectedLocation of their parent location.

Since it is always present in the navigation path, the root location always returns true from the IsSelected property.

See Also