Exemplo n.º 1
0
        /// <summary>
        /// 初始化公式工具栏
        /// </summary>
        protected void InitFunctionsStrip()
        {
            formulaTextBox             = new FormulaTextBox();
            formulaTextBox.Size        = new Size(650, 20);
            formulaTextBox.Dock        = DockStyle.Fill;
            formulaTextBox.BorderStyle = BorderStyle.FixedSingle;
            formulaTextBox.Attach(FpSpread);
            formulaTextBox.Disposed += new EventHandler(formulaTextBox_Disposed);
            formulaTextBox.GotFocus += new EventHandler(formulaTextBox_GotFocus);

            ToolStripControlHost ctlHost = new ToolStripControlHost(formulaTextBox, "FormulaTextBox");

            ctlHost.AutoSize = false;
            ctlHost.Anchor   = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
            ctlHost.Dock     = DockStyle.Fill;

            FunctionStrip.Items.Add(ctlHost);
        }
Exemplo n.º 2
0
        void formulaTextBox_Disposed(object sender, EventArgs e)
        {
            FormulaTextBox formulaTextBox = sender as FormulaTextBox;

            formulaTextBox.Detach();
        }