System.Windows.Forms.CommandBarItemCollection.IndexOf C# (CSharp) Method

IndexOf() public method

public IndexOf ( CommandBarItem item ) : int
item CommandBarItem
return int
        public int IndexOf(CommandBarItem item)
        {
            return this.items.IndexOf(item);
        }

Usage Example

        private bool PreProcessMnemonic(Keys keyCode)
        {
            char mnemonic = (char)(int)keyCode;

            CommandBarItem[] mnemonicHits = this.items[mnemonic];
            if (mnemonicHits.Length > 0)
            {
                int index = items.IndexOf(mnemonicHits[0]);
                this.TrackDropDown(index);
                return(true);
            }

            return(false);
        }