System.Windows.Forms.CommandBar.NotifyNeedTextA C# (CSharp) Method

NotifyNeedTextA() private method

private NotifyNeedTextA ( Message &message ) : void
message Message
return void
        private void NotifyNeedTextA(ref Message message)
        {
            if (this.Style != CommandBarStyle.Menu)
            {
                NativeMethods.TOOLTIPTEXTA toolTipText = (NativeMethods.TOOLTIPTEXTA) message.GetLParam(typeof(NativeMethods.TOOLTIPTEXTA));
                CommandBarItem item = (CommandBarItem) this.items[toolTipText.hdr.idFrom];
                toolTipText.szText = item.Text;

                CommandBarButtonBase buttonBase = item as CommandBarButtonBase;
                if ((buttonBase != null) && (buttonBase.Shortcut != Keys.None))
                {
                    toolTipText.szText += " (" + TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(null, CultureInfo.InvariantCulture, buttonBase.Shortcut) + ")";
                }

                toolTipText.hinst = IntPtr.Zero;
                if (RightToLeft == RightToLeft.Yes)
                {
                    toolTipText.uFlags |= NativeMethods.TTF_RTLREADING;
                }

                Marshal.StructureToPtr(toolTipText, message.LParam, true);
                message.Result = (IntPtr) 1;
            }
        }