예제 #1
0
        /// <summary>
        ///
        /// </summary>
        public CRichTextBoxEx() : base()
        {
            //加载contextMenuTrip的子项---消息显示的清楚和
            ToolStripItem tsItem;

            this.ContextMenuStrip = this.userContextMenuStrip;

            //---添加清除消息的功能
            tsItem = CContextMenuPlus.AddContextMenu("清除", this.userContextMenuStrip.Items, new EventHandler(this.Delete_Click));
            tsItem = CContextMenuPlus.AddContextMenu("复制", this.userContextMenuStrip.Items, new EventHandler(this.Copy_Click));
            tsItem = CContextMenuPlus.AddContextMenu("粘贴", this.userContextMenuStrip.Items, new EventHandler(this.Paste_Click));
            tsItem = CContextMenuPlus.AddContextMenu("剪切", this.userContextMenuStrip.Items, new EventHandler(this.Cut_Click));

            this.ContextMenuStrip.Width = 64;
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        public CRichTextBoxEx() : base()
        {
            //设置控件风格
            this.SetStyle(ControlStyles.AllPaintingInWmPaint |              //全部在窗口绘制消息中绘图
                          ControlStyles.OptimizedDoubleBuffer,              //使用双缓冲
                          true
                          );

            //加载contextMenuTrip的子项---消息显示的清楚和
            ToolStripItem tsItem;

            this.ContextMenuStrip = this.userContextMenuStrip;

            //---添加清除消息的功能
            tsItem = CContextMenuPlus.AddContextMenu("清除", this.userContextMenuStrip.Items, new EventHandler(this.Delete_Click));
            tsItem = CContextMenuPlus.AddContextMenu("复制", this.userContextMenuStrip.Items, new EventHandler(this.Copy_Click));
            tsItem = CContextMenuPlus.AddContextMenu("粘贴", this.userContextMenuStrip.Items, new EventHandler(this.Paste_Click));
            tsItem = CContextMenuPlus.AddContextMenu("剪切", this.userContextMenuStrip.Items, new EventHandler(this.Cut_Click));

            this.ContextMenuStrip.Width = 64;
        }