Example #1
0
 /// <summary>
 /// 根据点击的历史记录按钮生成文本框的历史记录
 /// </summary>
 /// <param name="butName"></param>
 private void textHistoryRecord(string butName)
 {
     if (普通_行首历史but.Name.Equals(butName))
     {
         if (textHistory.ContainsKey(0) && textHistory[0].Length > 0)
         {
             Panel p = ControlsUtils.GetHistoricalPanel(普通_行首text
                                                        , 普通_行首历史but.FindForm().Controls
                                                        , true
                                                        , textHistory[0]
                                                        , 普通_行首text.Width + 普通_行首历史but.Width
                                                        , 18);
             p.Location = new Point(tab容器.Location.X + 普通_行首text.Location.X
                                    , tab容器.Location.Y + tab容器.ItemSize.Height + 普通_行首text.Height + 12);
         }
     }
     if (普通_行尾历史but.Name.Equals(butName))
     {
         if (textHistory.ContainsKey(1) && textHistory[1].Length > 0)
         {
             Panel p = ControlsUtils.GetHistoricalPanel(普通_行尾text
                                                        , 普通_行尾历史but.FindForm().Controls
                                                        , true
                                                        , textHistory[1]
                                                        , 普通_行尾text.Width + 普通_行尾历史but.Width
                                                        , 18);
             p.Location = new Point(tab容器.Location.X + 普通_行尾text.Location.X
                                    , tab容器.Location.Y + tab容器.ItemSize.Height + 普通_行尾text.Height + 12);
         }
     }
 }
        // 下拉按钮的点击事件
        private void but_Click(object sender, EventArgs e)
        {
            Button but = (Button)sender;
            int    x   = ControlsUtils.LocationOnClient(this.拉按钮_pan).X;

            if (this.button1.Name.Equals(but.Name))
            {
                if (historicalPanel == null || historicalPanel.IsDisposed)
                {
                    historicalPanel = ControlsUtils.GetHistoricalPanel(拉按钮_but
                                                                       , 拉按钮_pan.Parent.FindForm().Controls
                                                                       , false
                                                                       , history
                                                                       , 拉按钮_but.Width + this.button1.Width, 23);
                    historicalPanel.Location = new Point(x, 拉按钮_pan.Location.Y + 拉按钮_pan.Height + 5);
                }
                else
                {
                    historicalPanel.Dispose();
                    historicalPanel = null;
                }
            }
        }
Example #3
0
        /// <summary>
        /// 历史记录按钮的点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void historyBut_Click(object sender, EventArgs e)
        {
            Button but = (Button)sender;

            if (查找历史B.Name.Equals(but.Name))
            {
                ControlsUtils.GetHistoricalPanel(查找内容T
                                                 , but.FindForm().Controls
                                                 , true
                                                 , findHistorical.ToArray()
                                                 , 查找内容T.Width + but.Width
                                                 , 22);
            }
            if (替换历史B.Name.Equals(but.Name))
            {
                ControlsUtils.GetHistoricalPanel(替换内容T
                                                 , but.FindForm().Controls
                                                 , true
                                                 , repHistorical.ToArray()
                                                 , 替换内容T.Width + but.Width
                                                 , 22);
            }
        }