質問

の"開く"ボタンをファイルを開くダイアログ用のwindowsアプリケーションを含むドロップダウンの矢印の追加オプション、すなわちアプリケーションで開く..".

こんなにべてのwindowsアプリケーション、トライしなくてはならないだろう少していきたいですが、SQL Server Management Studioは、Visual Studio2005の双方のボタンをその場合はメニューを選択 File->Open->ファイル...

利用したいボタンを行えるということを内蔵したリストにも応用ができない、管理い利用できます。かを明確にしておくべきであることを探している特定のボタンで、全体のダイアログを表示します。意思い?

役に立ちましたか?

解決

を使用したdraggable検索パ++(インストールとの対)のsplit openボタンをファイルを開く"ダイアログのVS.

ここでは通常のwindowsのボタンのスタイルが含まれBS_DEFSPLITBUTTON.ことになる魔法のキーワードを取得しま面白い場所を含む

http://www.codeplex.com/windowsformsaero/SourceControl/FileView.aspx?itemId=212902&changeSetId=9930

ここでは

http://msdn.microsoft.com/en-us/library/bb775949.aspx#using_splits

これはお手伝いさせていただきます。

編集:

思ったことからコードをCodePlexならではの作成に分割ボタン-ページをご覧の皆様へいくんだセットボタンのFlatStyleには'System'よりも高い標準のデフォルトです。っせんをフックの取り扱いもののドロップダウンの対象は、MSDNのリンクだとは思います。

科学大学(ベトナム社会主義共和Vistaしみいただけなかなかできないので必要なエアロが有効にもかかわらず、名codeplex)-が必要な場合は以前のOSサポートまれる描画します。

他のヒント

ことを思い出し Ketarin は、ボタンをするようです。

を使用 リフレクタ 私もオープンソースの制御という wyDay.SplitButton. wyDay.SplitButton

いと思ったのはて探しているというtoolStripSplitButton.客さまがご利用いただけるtoolStrip.ものを追加することができますtoolStripContainerなどのフォームとしてのtoolStripとtoolStripSplitButton内容器です。

だいたいのは、本学での値にセットしてくださいおgripMargin=0になります。ように設定することもできますおautosize=trueのtoolstripに適合しておボタンを押します。ボタンだったように感じたので同じように通常のボタン以外の分割部分)。

私は使ったことのない方はどちらかのもののみを検索msdnのためのsplitbuttonはdropdownbutton.と思うようだ。

こちらは自分割ボタンの実装です。を描画しませんの矢印のものを重/unfocus行動は少し違います。

両鉱山の原本を扱う視覚スタイルや優れたエ.

に基づく http://wyday.com/splitbutton/

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.Drawing;
using System.ComponentModel;
using System.Diagnostics;

// Original: http://blogs.msdn.com/jfoscoding/articles/491523.aspx
// Wyatt's fixes: http://wyday.com/splitbutton/
// Trimmed down and redone significantly from that version (Nick 5/6/08)
namespace DF
{
    public class SplitButton : Button
    {
        private ContextMenuStrip m_SplitMenu = null;
        private const int SplitSectionWidth = 14;
        private static int BorderSize = SystemInformation.Border3DSize.Width * 2;
        private bool mBlockClicks = false;
        private Timer mTimer;

        public SplitButton()
        {
            this.AutoSize = true;
            mTimer = new Timer();
            mTimer.Interval = 100;
            mTimer.Tick += new EventHandler(mTimer_Tick);
        }

        private void mTimer_Tick(object sender, EventArgs e)
        {
            mBlockClicks = false;
            mTimer.Stop();
        }

        #region Properties
        [DefaultValue(null)]
        public ContextMenuStrip SplitMenu
        {
            get
            {
                return m_SplitMenu;
            }
            set
            {
                if (m_SplitMenu != null)
                    m_SplitMenu.Closing -= 
                        new ToolStripDropDownClosingEventHandler(m_SplitMenu_Closing);

                m_SplitMenu = value;

                if (m_SplitMenu != null)
                    m_SplitMenu.Closing += 
                        new ToolStripDropDownClosingEventHandler(m_SplitMenu_Closing);
            }
        }

        private void m_SplitMenu_Closing(object sender, ToolStripDropDownClosingEventArgs e)
        {
            HideContextMenuStrip();
            // block click events for 0.5 sec to prevent re-showing the menu

        }

        private PushButtonState _state;
        private PushButtonState State
        {
            get
            {
                return _state;
            }
            set
            {
                if (!_state.Equals(value))
                {
                    _state = value;
                    Invalidate();
                }
            }
        }

        #endregion Properties

        protected override void OnEnabledChanged(EventArgs e)
        {
            if (Enabled)
                State = PushButtonState.Normal;
            else
                State = PushButtonState.Disabled;

            base.OnEnabledChanged(e);
        }

        protected override void OnMouseClick(MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
                return;
            if (State.Equals(PushButtonState.Disabled))
                return;
            if (mBlockClicks)
                return;

            if (!State.Equals(PushButtonState.Pressed))
                ShowContextMenuStrip();
            else
                HideContextMenuStrip();
        }

        protected override void OnMouseEnter(EventArgs e)
        {
            if (!State.Equals(PushButtonState.Pressed) && !State.Equals(PushButtonState.Disabled))
            {
                State = PushButtonState.Hot;
            }
        }

        protected override void OnMouseLeave(EventArgs e)
        {
            if (!State.Equals(PushButtonState.Pressed) && !State.Equals(PushButtonState.Disabled))
            {
                if (Focused)
                {
                    State = PushButtonState.Default;
                }

                else
                {
                    State = PushButtonState.Normal;
                }
            }
        }

        protected override void OnPaint(PaintEventArgs pevent)
        {
            base.OnPaint(pevent);

            Graphics g = pevent.Graphics;
            Rectangle bounds = this.ClientRectangle;

            // draw the button background as according to the current state.
            if (State != PushButtonState.Pressed && IsDefault && !Application.RenderWithVisualStyles)
            {
                Rectangle backgroundBounds = bounds;
                backgroundBounds.Inflate(-1, -1);
                ButtonRenderer.DrawButton(g, backgroundBounds, State);

                // button renderer doesnt draw the black frame when themes are off =(
                g.DrawRectangle(SystemPens.WindowFrame, 0, 0, bounds.Width - 1, bounds.Height - 1);
            }
            else
            {
                ButtonRenderer.DrawButton(g, bounds, State);
            }

            StringFormat format = new StringFormat();
            format.Alignment = StringAlignment.Center;
            format.LineAlignment = StringAlignment.Center;

            g.DrawString(Text, Font, SystemBrushes.ControlText, bounds, format);
        }

        private void ShowContextMenuStrip()
        {
            State = PushButtonState.Pressed;
            if (m_SplitMenu != null)
            {
                m_SplitMenu.Show(this, new Point(0, Height), ToolStripDropDownDirection.BelowRight);
            }
        }

        private void HideContextMenuStrip()
        {
            State = PushButtonState.Normal;
            m_SplitMenu.Hide();
            mBlockClicks = true;
            mTimer.Start();
        }
    }
}

とは思わないが内蔵されて制御することができます。います。私の魅にMSDNは標準のWindowsのボタンで制御で見せていないのである。

見つか コードのプロジェクト第 ターで実施今ここに。

以降この制御はWindowsそのものつくろうと思いましたこれまでに建っていなかったとしても自分のコードベースを使用します。その分割ボタン このリンク (ためには、msdnの提案)に見える。

私が自分自身がわからないので取扱い映像メーカーです。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top