用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - c#代码库

多功能的表格控件

2016-08-14 作者: 小章举报

[c#]代码库

//定制的ListView,它必须能够在列中插入图像、下拉框、可上下调整的数字、进度条等等。
 
//EventsDemoForm.cs
 
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
 
using XPTable;
using XPTable.Models;
 
namespace XPTableDemo.Events
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class EventsDemoForm : System.Windows.Forms.Form
    {
        private XPTable.Models.Table table;
        private System.Windows.Forms.CheckBox cellMouseEnterCheckBox;
        private System.Windows.Forms.CheckBox cellMouseLeaveCheckBox;
        private System.Windows.Forms.CheckBox cellMouseMoveCheckBox;
        private System.Windows.Forms.CheckBox cellMouseUpCheckBox;
        private System.Windows.Forms.CheckBox cellMouseDownCheckBox;
        private System.Windows.Forms.CheckBox cellGotFocusCheckBox;
        private System.Windows.Forms.CheckBox cellLostFocusCheckBox;
        private System.Windows.Forms.CheckBox headerMouseDownCheckBox;
        private System.Windows.Forms.CheckBox headerMouseUpCheckBox;
        private System.Windows.Forms.CheckBox headerMouseMoveCheckBox;
        private System.Windows.Forms.CheckBox headerMouseLeaveCheckBox;
        private System.Windows.Forms.CheckBox headerMouseEnterCheckBox;
        private System.Windows.Forms.CheckBox cellPropertyChangedCheckBox;
        private XPTable.Models.ColumnModel columnModel;
        private XPTable.Models.TableModel tableModel;
        private System.Windows.Forms.GroupBox eventFilterGroupBox;
        private System.Windows.Forms.TextBox eventsTextBox;
        private System.Windows.Forms.CheckBox selectionChangedCheckBox;
        private System.Windows.Forms.CheckBox cellCheckChangedCheckBox;
        private System.Windows.Forms.CheckBox cellButtonClickedCheckBox;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;
 
        /// <summary>
        ///
        /// </summary>
        public EventsDemoForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
 
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
 
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }
 
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.table = new XPTable.Models.Table();
            this.columnModel = new XPTable.Models.ColumnModel();
            this.tableModel = new XPTable.Models.TableModel();
            this.eventFilterGroupBox = new System.Windows.Forms.GroupBox();
            this.cellCheckChangedCheckBox = new System.Windows.Forms.CheckBox();
            this.cellButtonClickedCheckBox = new System.Windows.Forms.CheckBox();
            this.selectionChangedCheckBox = new System.Windows.Forms.CheckBox();
            this.cellPropertyChangedCheckBox = new System.Windows.Forms.CheckBox();
            this.headerMouseDownCheckBox = new System.Windows.Forms.CheckBox();
            this.headerMouseUpCheckBox = new System.Windows.Forms.CheckBox();
            this.headerMouseMoveCheckBox = new System.Windows.Forms.CheckBox();
            this.headerMouseLeaveCheckBox = new System.Windows.Forms.CheckBox();
            this.headerMouseEnterCheckBox = new System.Windows.Forms.CheckBox();
            this.cellLostFocusCheckBox = new System.Windows.Forms.CheckBox();
            this.cellGotFocusCheckBox = new System.Windows.Forms.CheckBox();
            this.cellMouseDownCheckBox = new System.Windows.Forms.CheckBox();
            this.cellMouseUpCheckBox = new System.Windows.Forms.CheckBox();
            this.cellMouseMoveCheckBox = new System.Windows.Forms.CheckBox();
            this.cellMouseLeaveCheckBox = new System.Windows.Forms.CheckBox();
            this.cellMouseEnterCheckBox = new System.Windows.Forms.CheckBox();
            this.eventsTextBox = new System.Windows.Forms.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this.table)).BeginInit();
            this.eventFilterGroupBox.SuspendLayout();
            this.SuspendLayout();
            //
            // table
            //
            this.table.ColumnModel = this.columnModel;
            this.table.GridLines = XPTable.Models.GridLines.Both;
            this.table.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.table.Location = new System.Drawing.Point(16, 16);
            this.table.Name = "table";
            this.table.SelectionStyle = XPTable.Models.SelectionStyle.Grid;
            this.table.Size = new System.Drawing.Size(352, 144);
            this.table.TabIndex = 0;
            this.table.TableModel = this.tableModel;
            this.table.Text = "table1";
            this.table.CellMouseEnter += new XPTable.Events.CellMouseEventHandler(this.table_CellMouseEnter);
            this.table.SelectionChanged += new XPTable.Events.SelectionEventHandler(this.table_SelectionChanged);
            this.table.CellCheckChanged += new XPTable.Events.CellCheckBoxEventHandler(this.table_CellCheckChanged);
            this.table.CellMouseDown += new XPTable.Events.CellMouseEventHandler(this.table_CellMouseDown);
            this.table.CellMouseLeave += new XPTable.Events.CellMouseEventHandler(this.table_CellMouseLeave);
            this.table.HeaderMouseEnter += new XPTable.Events.HeaderMouseEventHandler(this.table_HeaderMouseEnter);
            this.table.CellLostFocus += new XPTable.Events.CellFocusEventHandler(this.table_CellLostFocus);
            this.table.HeaderMouseUp += new XPTable.Events.HeaderMouseEventHandler(this.table_HeaderMouseUp);
            this.table.HeaderMouseMove += new XPTable.Events.HeaderMouseEventHandler(this.table_HeaderMouseMove);
            this.table.CellGotFocus += new XPTable.Events.CellFocusEventHandler(this.table_CellGotFocus);
            this.table.CellMouseMove += new XPTable.Events.CellMouseEventHandler(this.table_CellMouseMove);
            this.table.HeaderMouseLeave += new XPTable.Events.HeaderMouseEventHandler(this.table_HeaderMouseLeave);
            this.table.CellButtonClicked += new XPTable.Events.CellButtonEventHandler(this.table_CellButtonClicked);
            this.table.CellMouseUp += new XPTable.Events.CellMouseEventHandler(this.table_CellMouseUp);
            this.table.CellPropertyChanged += new XPTable.Events.CellEventHandler(this.table_CellPropertyChanged);
            this.table.HeaderMouseDown += new XPTable.Events.HeaderMouseEventHandler(this.table_HeaderMouseDown);
            //
            // tableModel
            //
            this.tableModel.RowHeight = 20;
            //
            // eventFilterGroupBox
            //
            this.eventFilterGroupBox.Controls.Add(this.cellCheckChangedCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellButtonClickedCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.selectionChangedCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellPropertyChangedCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.headerMouseDownCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.headerMouseUpCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.headerMouseMoveCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.headerMouseLeaveCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.headerMouseEnterCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellLostFocusCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellGotFocusCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellMouseDownCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellMouseUpCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellMouseMoveCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellMouseLeaveCheckBox);
            this.eventFilterGroupBox.Controls.Add(this.cellMouseEnterCheckBox);
            this.eventFilterGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.eventFilterGroupBox.Location = new System.Drawing.Point(16, 168);
            this.eventFilterGroupBox.Name = "eventFilterGroupBox";
            this.eventFilterGroupBox.Size = new System.Drawing.Size(352, 224);
            this.eventFilterGroupBox.TabIndex = 1;
            this.eventFilterGroupBox.TabStop = false;
            this.eventFilterGroupBox.Text = "Event Filters";
            //
            // cellCheckChangedCheckBox
            //
            this.cellCheckChangedCheckBox.Checked = true;
            this.cellCheckChangedCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellCheckChangedCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellCheckChangedCheckBox.Location = new System.Drawing.Point(200, 192);
            this.cellCheckChangedCheckBox.Name = "cellCheckChangedCheckBox";
            this.cellCheckChangedCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellCheckChangedCheckBox.TabIndex = 15;
            this.cellCheckChangedCheckBox.Text = "CellCheckChanged";
            //
            // cellButtonClickedCheckBox
            //
            this.cellButtonClickedCheckBox.Checked = true;
            this.cellButtonClickedCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellButtonClickedCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellButtonClickedCheckBox.Location = new System.Drawing.Point(200, 168);
            this.cellButtonClickedCheckBox.Name = "cellButtonClickedCheckBox";
            this.cellButtonClickedCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellButtonClickedCheckBox.TabIndex = 14;
            this.cellButtonClickedCheckBox.Text = "CellButtonClicked";
            //
            // selectionChangedCheckBox
            //
            this.selectionChangedCheckBox.Checked = true;
            this.selectionChangedCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.selectionChangedCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.selectionChangedCheckBox.Location = new System.Drawing.Point(200, 144);
            this.selectionChangedCheckBox.Name = "selectionChangedCheckBox";
            this.selectionChangedCheckBox.Size = new System.Drawing.Size(128, 16);
            this.selectionChangedCheckBox.TabIndex = 13;
            this.selectionChangedCheckBox.Text = "SelectionChanged";
            //
            // cellPropertyChangedCheckBox
            //
            this.cellPropertyChangedCheckBox.Checked = true;
            this.cellPropertyChangedCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellPropertyChangedCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellPropertyChangedCheckBox.Location = new System.Drawing.Point(16, 24);
            this.cellPropertyChangedCheckBox.Name = "cellPropertyChangedCheckBox";
            this.cellPropertyChangedCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellPropertyChangedCheckBox.TabIndex = 0;
            this.cellPropertyChangedCheckBox.Text = "CellPropertyChanged";
            //
            // headerMouseDownCheckBox
            //
            this.headerMouseDownCheckBox.Checked = true;
            this.headerMouseDownCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.headerMouseDownCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.headerMouseDownCheckBox.Location = new System.Drawing.Point(200, 120);
            this.headerMouseDownCheckBox.Name = "headerMouseDownCheckBox";
            this.headerMouseDownCheckBox.Size = new System.Drawing.Size(128, 16);
            this.headerMouseDownCheckBox.TabIndex = 12;
            this.headerMouseDownCheckBox.Text = "HeaderMouseDown";
            //
            // headerMouseUpCheckBox
            //
            this.headerMouseUpCheckBox.Checked = true;
            this.headerMouseUpCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.headerMouseUpCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.headerMouseUpCheckBox.Location = new System.Drawing.Point(200, 96);
            this.headerMouseUpCheckBox.Name = "headerMouseUpCheckBox";
            this.headerMouseUpCheckBox.Size = new System.Drawing.Size(128, 16);
            this.headerMouseUpCheckBox.TabIndex = 11;
            this.headerMouseUpCheckBox.Text = "HeaderMouseUp";
            //
            // headerMouseMoveCheckBox
            //
            this.headerMouseMoveCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.headerMouseMoveCheckBox.Location = new System.Drawing.Point(200, 72);
            this.headerMouseMoveCheckBox.Name = "headerMouseMoveCheckBox";
            this.headerMouseMoveCheckBox.Size = new System.Drawing.Size(128, 16);
            this.headerMouseMoveCheckBox.TabIndex = 10;
            this.headerMouseMoveCheckBox.Text = "HeaderMouseMove";
            //
            // headerMouseLeaveCheckBox
            //
            this.headerMouseLeaveCheckBox.Checked = true;
            this.headerMouseLeaveCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.headerMouseLeaveCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.headerMouseLeaveCheckBox.Location = new System.Drawing.Point(200, 48);
            this.headerMouseLeaveCheckBox.Name = "headerMouseLeaveCheckBox";
            this.headerMouseLeaveCheckBox.Size = new System.Drawing.Size(128, 16);
            this.headerMouseLeaveCheckBox.TabIndex = 9;
            this.headerMouseLeaveCheckBox.Text = "HeaderMouseLeave";
            //
            // headerMouseEnterCheckBox
            //
            this.headerMouseEnterCheckBox.Checked = true;
            this.headerMouseEnterCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.headerMouseEnterCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.headerMouseEnterCheckBox.Location = new System.Drawing.Point(200, 24);
            this.headerMouseEnterCheckBox.Name = "headerMouseEnterCheckBox";
            this.headerMouseEnterCheckBox.Size = new System.Drawing.Size(128, 16);
            this.headerMouseEnterCheckBox.TabIndex = 8;
            this.headerMouseEnterCheckBox.Text = "HeaderMouseEnter";
            //
            // cellLostFocusCheckBox
            //
            this.cellLostFocusCheckBox.Checked = true;
            this.cellLostFocusCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellLostFocusCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellLostFocusCheckBox.Location = new System.Drawing.Point(16, 192);
            this.cellLostFocusCheckBox.Name = "cellLostFocusCheckBox";
            this.cellLostFocusCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellLostFocusCheckBox.TabIndex = 7;
            this.cellLostFocusCheckBox.Text = "CellLostFocus";
            //
            // cellGotFocusCheckBox
            //
            this.cellGotFocusCheckBox.Checked = true;
            this.cellGotFocusCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellGotFocusCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellGotFocusCheckBox.Location = new System.Drawing.Point(16, 168);
            this.cellGotFocusCheckBox.Name = "cellGotFocusCheckBox";
            this.cellGotFocusCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellGotFocusCheckBox.TabIndex = 6;
            this.cellGotFocusCheckBox.Text = "CellGotFocus";
            //
            // cellMouseDownCheckBox
            //
            this.cellMouseDownCheckBox.Checked = true;
            this.cellMouseDownCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellMouseDownCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellMouseDownCheckBox.Location = new System.Drawing.Point(16, 144);
            this.cellMouseDownCheckBox.Name = "cellMouseDownCheckBox";
            this.cellMouseDownCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellMouseDownCheckBox.TabIndex = 5;
            this.cellMouseDownCheckBox.Text = "CellMouseDown";
            //
            // cellMouseUpCheckBox
            //
            this.cellMouseUpCheckBox.Checked = true;
            this.cellMouseUpCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellMouseUpCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellMouseUpCheckBox.Location = new System.Drawing.Point(16, 120);
            this.cellMouseUpCheckBox.Name = "cellMouseUpCheckBox";
            this.cellMouseUpCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellMouseUpCheckBox.TabIndex = 4;
            this.cellMouseUpCheckBox.Text = "CellMouseUp";
            //
            // cellMouseMoveCheckBox
            //
            this.cellMouseMoveCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellMouseMoveCheckBox.Location = new System.Drawing.Point(16, 96);
            this.cellMouseMoveCheckBox.Name = "cellMouseMoveCheckBox";
            this.cellMouseMoveCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellMouseMoveCheckBox.TabIndex = 3;
            this.cellMouseMoveCheckBox.Text = "CellMouseMove";
            //
            // cellMouseLeaveCheckBox
            //
            this.cellMouseLeaveCheckBox.Checked = true;
            this.cellMouseLeaveCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellMouseLeaveCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellMouseLeaveCheckBox.Location = new System.Drawing.Point(16, 72);
            this.cellMouseLeaveCheckBox.Name = "cellMouseLeaveCheckBox";
            this.cellMouseLeaveCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellMouseLeaveCheckBox.TabIndex = 2;
            this.cellMouseLeaveCheckBox.Text = "CellMouseLeave";
            //
            // cellMouseEnterCheckBox
            //
            this.cellMouseEnterCheckBox.Checked = true;
            this.cellMouseEnterCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cellMouseEnterCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.cellMouseEnterCheckBox.Location = new System.Drawing.Point(16, 48);
            this.cellMouseEnterCheckBox.Name = "cellMouseEnterCheckBox";
            this.cellMouseEnterCheckBox.Size = new System.Drawing.Size(128, 16);
            this.cellMouseEnterCheckBox.TabIndex = 1;
            this.cellMouseEnterCheckBox.Text = "CellMouseEnter";
            //
            // eventsTextBox
            //
            this.eventsTextBox.Location = new System.Drawing.Point(16, 400);
            this.eventsTextBox.Multiline = true;
            this.eventsTextBox.Name = "eventsTextBox";
            this.eventsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.eventsTextBox.Size = new System.Drawing.Size(352, 128);
            this.eventsTextBox.TabIndex = 2;
            this.eventsTextBox.Text = "";
            //
            // EventsDemoForm
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(384, 542);
            this.Controls.Add(this.eventsTextBox);
            this.Controls.Add(this.table);
            this.Controls.Add(this.eventFilterGroupBox);
            this.Name = "EventsDemoForm";
            this.Text = "XPTable - Events Demo";
            ((System.ComponentModel.ISupportInitialize)(this.table)).EndInit();
            this.eventFilterGroupBox.ResumeLayout(false);
            this.ResumeLayout(false);
 
        }
        #endregion
 
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.Run(new EventsDemoForm());
        }
 
 
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
 
            this.table.BeginUpdate();
 
            TextColumn textColumn1 = new TextColumn();
            textColumn1.Editable = false;
            textColumn1.Sortable = false;
            textColumn1.Text = "Text";
 
            CheckBoxColumn checkBoxColumn1 = new CheckBoxColumn();
            checkBoxColumn1.Sortable = false;
            checkBoxColumn1.Text = "CheckBox";
            checkBoxColumn1.Width = 94;
 
            TextColumn textColumn2 = new TextColumn();
            textColumn2.Editable = false;
            textColumn2.Sortable = false;
            textColumn2.Text = "Text";
 
            ButtonColumn buttonColumn1 = new ButtonColumn();
            buttonColumn1.Sortable = false;
            buttonColumn1.Text = "Button";
 
            this.columnModel.Columns.AddRange(new Column[] {textColumn1, checkBoxColumn1, textColumn2, buttonColumn1});
 
            this.table.TableModel.Rows.AddRange(new Row[] { new Row(new Cell[] {new Cell("Item 1"),
                                                                                   new Cell("CheckBox 1"),
                                                                                   new Cell("Item 2"),
                                                                                   new Cell("Button 1")}),
                                                              new Row(new Cell[] {new Cell("Item 3"),
                                                                                     new Cell("CheckBox 2"),
                                                                                     new Cell("Item 4"),
                                                                                     new Cell("Button 2")}),
                                                              new Row(new Cell[] {new Cell("Item 5"),
                                                                                     new Cell("CheckBox 3"),
                                                                                     new Cell("Item 6"),
                                                                                     new Cell("Button 3")}),
                                                              new Row(new Cell[] {new Cell("Item 7"),
                                                                                     new Cell("CheckBox 4"),
                                                                                     new Cell("Item 8"),
                                                                                     new Cell("Button 4")}),
                                                              new Row(new Cell[] {new Cell("Item 9"),
                                                                                     new Cell("CheckBox 5"),
                                                                                     new Cell("Item 10"),
                                                                                     new Cell("Button 5")})});
 
            this.table.EndUpdate();
        }
 
 
        private void table_CellGotFocus(object sender, XPTable.Events.CellFocusEventArgs e)
        {
            if (this.cellGotFocusCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellGotFocus\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellLostFocus(object sender, XPTable.Events.CellFocusEventArgs e)
        {
            if (this.cellLostFocusCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellLostFocus\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellMouseDown(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            if (this.cellMouseDownCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellMouseDown\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellMouseEnter(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            if (this.cellMouseEnterCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellMouseEnter\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellMouseLeave(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            if (this.cellMouseLeaveCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellMouseLeave\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellMouseMove(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            if (this.cellMouseMoveCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellMouseMove\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellMouseUp(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            if (this.cellMouseUpCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellMouseUp\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellPropertyChanged(object sender, XPTable.Events.CellEventArgs e)
        {
            if (this.cellPropertyChangedCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellPropertyChanged\r\n", e.Row, e.Column));
            }
        }
 
        private void table_HeaderMouseDown(object sender, XPTable.Events.HeaderMouseEventArgs e)
        {
            if (this.headerMouseDownCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}) HeaderMouseDown\r\n", e.Column));
            }
        }
 
        private void table_HeaderMouseEnter(object sender, XPTable.Events.HeaderMouseEventArgs e)
        {
            if (this.headerMouseEnterCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}) HeaderMouseEnter\r\n", e.Column));
            }
        }
 
        private void table_HeaderMouseLeave(object sender, XPTable.Events.HeaderMouseEventArgs e)
        {
            if (this.headerMouseLeaveCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}) HeaderMouseLeave\r\n", e.Column));
            }
        }
 
        private void table_HeaderMouseMove(object sender, XPTable.Events.HeaderMouseEventArgs e)
        {
            if (this.headerMouseMoveCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}) HeaderMouseMove\r\n", e.Column));
            }
        }
 
        private void table_HeaderMouseUp(object sender, XPTable.Events.HeaderMouseEventArgs e)
        {
            if (this.headerMouseUpCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}) HeaderMouseUp\r\n", e.Column));
            }
        }
 
        private void table_SelectionChanged(object sender, XPTable.Events.SelectionEventArgs e)
        {
            if (this.selectionChangedCheckBox.Checked)
            {
                this.eventsTextBox.AppendText("SelectionChanged\r\n");
            }
        }
 
        private void table_CellButtonClicked(object sender, XPTable.Events.CellButtonEventArgs e)
        {
            if (this.cellButtonClickedCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellButtonClicked\r\n", e.Row, e.Column));
            }
        }
 
        private void table_CellCheckChanged(object sender, XPTable.Events.CellCheckBoxEventArgs e)
        {
            if (this.cellCheckChangedCheckBox.Checked)
            {
                this.eventsTextBox.AppendText(String.Format("({0}, {1}) CellCheckChanged\r\n", e.Row, e.Column));
            }
        }
    }
}

[源代码打包下载]




网友评论    (发表评论)

共1 条评论 1/1页

发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...