Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.ComponentModel;
Using System.Drawing;
Using System.Data;
Using System.Windows.Forms;
Namespace Efwcontrols.customcontrol
{
#region Textboxcard
<summary>
Matching mode
</summary>
public enum Matchmodes
{
<summary>
Any character
</summary>
byanystring = 0,
<summary>
by first character
</summary>
Byfirstchar = 1
}
public delegate void Afterselectedrowhandler (object sender, Object SelectedValue);
<summary>
Page Turn Event
</summary>
<param name= "Sender" > Objects </param>
<param name= "PageNo" > Current page </param>
<param name= "pageSize" > Page size </param>
public delegate void Pagertexteventhandler (object sender, int pageno, int pageSize, string fiterchar);
#endregion
#region Gridboxcard
//<summary>
//Datagridviewex the event delegate after the line is selected
///</summary>
// Lt;param name= "SelectedValue" ></PARAM>
//<param name= "Stop" > Stop jump </param>
//< param name= "Customnextcolumnindex" > Jump to the specified column </param>
public delegate void Onselectcardrowselectedhandle ( Object SelectedValue, ref bool stop, ref int customnextcolumnindex);
//<summary>
//Page Turn event
//</summary>
//<param name= "Sender" > object </param>
/ <param name= "index" >showcard data source index </PARAM>
//<param name= "PageNo" > Current page </param>
// /<param name= "pageSize" > Page size </param>
public delegate void Pagergrideventhandler (object sender, int index, int pageno, int pageSize, string fiterchar);
<summary>
Assign a DataRow value when a row is automatically added
</summary>
<param name= "DataRow" > New line Assignment </param>
public delegate void Useraddgirdrowhandler (DataRow DataRow);
<summary>
Automatically add a new line of custom rules
</summary>
<returns></returns>
Public delegate bool Useraddgridrowcustom ();
<summary>
Cell Carriage Return Event
</summary>
<param name= "Sender" ></param>
<param name= "Colindex" > Current column number </param>
<param name= "RowIndex" > Current line number </param>
<param name= "Jumpstop" > Stop jump </param>
public delegate void Ondatagridviewcellpressenterkeyhandle (object sender, int colindex, int rowIndex, ref bool jumpstop);
<summary>
Grid Tab Class
</summary>
public class Datagridviewselectioncard
{
Private datagridviewtextboxcolumn[] columns;
Private System.Data.DataTable DataSource;
Private System.Drawing.Size cardsize = new Size (350, 276);
Private Matchmodes Selectcardfiltertype;
private int bindcolumnindex;
Private datarow[] Filterresult;
Public Datagridviewselectioncard ()
{
}
private string _cardcolumn;
[Description ("option carré information, such as: code| encoded |80,name| name |120")]
public string Cardcolumn
{
get {return _cardcolumn;}
set {_cardcolumn = value;}
}
//<summary>
//Select card column information
//</summary>
Public datagridviewtextboxcolumn[] showcardcolumns< br> {
Get
{
return columns;
}
Set
{
columns = value;
}
}
///<summary>
//Select card data source
///</summary>
Public System.Data.DataTable DataSource
{ br> get
{
return dataSource;
}
Set
{
DataSource = value;
}
}
///<summary>
//Select card size
///</summary>
Public System.Drawing.Size cardsize
{
GE T
{
return cardsize;
}
Set
{
Cardsize = value;
}
}
<summary>
Set query fields, through "," split
</summary>
[Description ("Set query field, pass", "split")]
public string queryfieldsstring
{
Get
{
string strvalue = "";
if (queryfields! = null)
{
for (int i = 0; i < queryfields.length; i++)
{
if (strvalue = = "")
strvalue = Queryfields[i];
Else
strvalue + = "," + queryfields[i];
}
}
return strvalue;
}
Set
{
QueryFields = value. Split (', ');
}
}
<summary>
Gets or sets the query field
</summary>
Private string[] queryfields;
[Description ("Get or Set Query field")]
Public string[] QueryFields
{
Get
{
return queryfields;
}
Set
{
QueryFields = value;
}
}
<summary>
Select Card Record Filter mode
</summary>
Public Matchmodes Selectcardfiltertype
{
Get
{
return selectcardfiltertype;
}
Set
{
Selectcardfiltertype = value;
}
}
<summary>
Gets or sets the index of the column to which the tab is bound
</summary>
public int Bindcolumnindex
{
Get
{
return bindcolumnindex;
}
Set
{
Bindcolumnindex = value;
}
}
Public datarow[] Filterresult
{
Get
{
return filterresult;
}
Set
{
Filterresult = value;
}
}
private bool _ispage=true;
[Description ("Set whether internal part of the page, ispage=false when combined with Pagereventhandler event use")]
public bool Ispage
{
get {return _ispage;}
set {_ispage = value;}
}
private int _pagetotalrecord;
<summary>
Only used when the total number of records is Ispage=false
</summary>
public int Pagetotalrecord
{
get {return _pagetotalrecord;}
set {_pagetotalrecord = value;}
}
private string _memo;
[Description ("tab data source description")]
public string Memo
{
get {return _memo;}
set {_memo = value;}
}
}
<summary>
Grid numeric Keypad
</summary>
public class Datagridviewselectionnumerickeyboard
{
private int bindcolumnindex;
Public Datagridviewselectionnumerickeyboard ()
{
}
<summary>
Gets or sets the index of the column to which the tab is bound
</summary>
public int Bindcolumnindex
{
Get
{
return bindcolumnindex;
}
Set
{
Bindcolumnindex = value;
}
}
private string _memo;
[Description ("tab data source description")]
public string Memo
{
get {return _memo;}
set {_memo = value;}
}
}
#endregion
}
List control base class