Example #1
0
        internal System.Windows.Forms.NativeMethods.TBBUTTON GetTBBUTTON(int commandId)
        {
            System.Windows.Forms.NativeMethods.TBBUTTON tbbutton = new System.Windows.Forms.NativeMethods.TBBUTTON {
                iBitmap = this.ImageIndexer.ActualIndex,
                fsState = 0
            };
            if (this.enabled)
            {
                tbbutton.fsState = (byte)(tbbutton.fsState | 4);
            }
            if (this.partialPush && (this.style == ToolBarButtonStyle.ToggleButton))
            {
                tbbutton.fsState = (byte)(tbbutton.fsState | 0x10);
            }
            if (this.pushed)
            {
                tbbutton.fsState = (byte)(tbbutton.fsState | 1);
            }
            if (!this.visible)
            {
                tbbutton.fsState = (byte)(tbbutton.fsState | 8);
            }
            switch (this.style)
            {
            case ToolBarButtonStyle.PushButton:
                tbbutton.fsStyle = 0;
                break;

            case ToolBarButtonStyle.ToggleButton:
                tbbutton.fsStyle = 2;
                break;

            case ToolBarButtonStyle.Separator:
                tbbutton.fsStyle = 1;
                break;

            case ToolBarButtonStyle.DropDownButton:
                tbbutton.fsStyle = 8;
                break;
            }
            tbbutton.dwData    = IntPtr.Zero;
            tbbutton.iString   = this.stringIndex;
            this.commandId     = commandId;
            tbbutton.idCommand = commandId;
            return(tbbutton);
        }
        internal System.Windows.Forms.NativeMethods.TBBUTTON GetTBBUTTON(int commandId)
        {
            System.Windows.Forms.NativeMethods.TBBUTTON tbbutton = new System.Windows.Forms.NativeMethods.TBBUTTON {
                iBitmap = this.ImageIndexer.ActualIndex,
                fsState = 0
            };
            if (this.enabled)
            {
                tbbutton.fsState = (byte) (tbbutton.fsState | 4);
            }
            if (this.partialPush && (this.style == ToolBarButtonStyle.ToggleButton))
            {
                tbbutton.fsState = (byte) (tbbutton.fsState | 0x10);
            }
            if (this.pushed)
            {
                tbbutton.fsState = (byte) (tbbutton.fsState | 1);
            }
            if (!this.visible)
            {
                tbbutton.fsState = (byte) (tbbutton.fsState | 8);
            }
            switch (this.style)
            {
                case ToolBarButtonStyle.PushButton:
                    tbbutton.fsStyle = 0;
                    break;

                case ToolBarButtonStyle.ToggleButton:
                    tbbutton.fsStyle = 2;
                    break;

                case ToolBarButtonStyle.Separator:
                    tbbutton.fsStyle = 1;
                    break;

                case ToolBarButtonStyle.DropDownButton:
                    tbbutton.fsStyle = 8;
                    break;
            }
            tbbutton.dwData = IntPtr.Zero;
            tbbutton.iString = this.stringIndex;
            this.commandId = commandId;
            tbbutton.idCommand = commandId;
            return tbbutton;
        }