zoukankan      html  css  js  c++  java
  • MDI窗体的工具栏合并(ToolStrip Merging)

    http://www.cnitblog.com/MartinYao/archive/2007/08/01/31114.html

     

    在MDI窗体定义

            public interface ICipherInputForm
            {
                ToolStrip CipherToolStrip
                {
                    get;
                }
            }

    在MdiChildActivate事件中加入

             private void MainFrame_MdiChildActivate(object sender, EventArgs e)
            {

    //CTools为MDI窗体工具栏
                ToolStripManager.RevertMerge(CTools);
                if (this.ActiveMdiChild != null)
                {
                    if ((ActiveMdiChild as ICipherInputForm).CipherToolStrip != null)
                    {
                        ToolStripManager.Merge((ActiveMdiChild as ICipherInputForm).CipherToolStrip,CTools);
                    }
                }
                //若子窗体无工具栏时,隐藏该工具栏
                if (CTools.Items.Count > 0)
                    CTools.Visible = true;
                else
                    CTools.Visible = false;
             }

    在子窗体

        public partial class FrmPowerTeam : Form,MainFrame.ICipherInputForm
        {

    //Tools为你子窗体的工具栏.注意将其Visible = false;
            public ToolStrip CipherToolStrip
            {
                get
                {
                    return Tools;
                }
            }

       }
  • 相关阅读:
    数组的操作
    数据类型的判断
    插入排序法
    数组
    文件路径
    POJ 1149 PIGS(最大流)
    POJ 2186 Popular Cows(强联通+缩点)
    POJ 1463 Strategic game(二分图最大匹配)
    POJ 2761 Feed the dogs(平衡树or划分树or主席树)
    POJ 2528 Mayor's posters(线段树)
  • 原文地址:https://www.cnblogs.com/chirs888888/p/2076523.html
Copyright © 2011-2022 走看看