ado.net c#.net2005 From第一讲(BindingDemoForm8)
来源:互联网 发布:java 支付宝转账 编辑:程序博客网 时间:2024/05/17 18:27
数据库见:ado.net c#.net2005 From第一讲(BindingDemoForm2)
运行界面:
cs代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace ch1
...{
public partial class BindingDemoForm8 : Form
...{
public BindingDemoForm8()
...{
InitializeComponent();
}
// 資料集物件的類別層級建立
DataSet ds = new DataSet();
// CurrencyManager 物件的類別層級宣告
BindingManagerBase bmFoxStudio;
// 定義一個內含 EveryDepartment 物件的陣列來作為 ComboBox 控制項的資料來源
EveryDepartment[] AllDepartments = new EveryDepartment[] ...{ new EveryDepartment("生產製造部"), new EveryDepartment("行銷部"), new EveryDepartment("財務部"), new EveryDepartment("會計部"), new EveryDepartment("業務部"), new EveryDepartment("資訊部") };
private void BindingDemoForm8_Load(object sender, System.EventArgs e)
...{
// 設定表單的最小大小
this.MinimumSize = new Size(512, 494);
// 建立一個連接字串
string strConnection = "Server=(local);Database=ch1;uid=sa;pwd=";
// 建立一個查詢命令字串
string strSql = "SELECT 身份證字號,姓名,員工性別,住家地址,出生日期,目前薪資,部門,自傳 FROM 飛狐工作室";
// 建立一個資料連接
SqlConnection myConnection = new SqlConnection(strConnection);
// 建立一個資料配接器以便針對資料來源執行 SELECT 陳述式來提取出要填入資料集的資料記錄
SqlDataAdapter myAD = new SqlDataAdapter(strSql, myConnection);
// 將資料填入資料集
myAD.Fill(ds, "飛狐工作室");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「身份證字號」欄位
TextBoxID.DataBindings.Add("Text", ds, "飛狐工作室.身份證字號");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「姓名」欄位
TextBoxName.DataBindings.Add("Text", ds, "飛狐工作室.姓名");
// 將 CheckBox 控制項的 Checked 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「員工性別」欄位
CheckBoxGender.DataBindings.Add("Checked", ds, "飛狐工作室.員工性別");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「住家地址」欄位
TextBoxAddress.DataBindings.Add("Text", ds, "飛狐工作室.住家地址");
// 將 DateTimePicker 控制項的 Value 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「出生日期」欄位
DateTimePickerBirthday.DataBindings.Add("Value", ds, "飛狐工作室.出生日期");
// 將 NumericUpDown 控制項的 Value 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「目前薪資」欄位
NumericUpDownSalary.DataBindings.Add("Value", ds, "飛狐工作室.目前薪資");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「自傳」欄位
TextBoxContent.DataBindings.Add("Text", ds, "飛狐工作室.自傳");
// 將 ComboBox 控制項的資料來源設定成 AllDepartments 陣列
ComboBoxDepartment.DataSource = AllDepartments;
// 將 DisplayMember 屬性設定為 EveryDepartment 物件的 DepartmentName 屬性(EveryDepartment.DepartmentName)
ComboBoxDepartment.DisplayMember = "DepartmentName";
// 設定 EveryDepartment 物件的 DepartmentName 屬性值將被寫入稍後所繫結的欄位
ComboBoxDepartment.ValueMember = "DepartmentName";
// 將 SelectedValue 屬性繫結至「飛狐工作室」資料表的「部門」欄位,如此一來,
// 使用者所選取之選項的 DepartmentName 屬性值便會寫入「飛狐工作室」資料表的「部門」欄位。
ComboBoxDepartment.DataBindings.Add("SelectedValue", ds, "飛狐工作室.部門");
// 取得代表「飛狐工作室」資料表的 CurrencyManager 物件
bmFoxStudio = this.BindingContext[ds, "飛狐工作室"];
// 設定當引發 PositionChanged 事件時便執行事件處理常式 飛狐工作室_PositionChanged
bmFoxStudio.PositionChanged += 飛狐工作室_PositionChanged;
// 設定資料記錄目前位置訊息的初值
TextBoxPosition.Text = string.Format("資料記錄:目前位置 {0} 總數 {1}", bmFoxStudio.Position + 1, bmFoxStudio.Count);
// 關閉對資料庫的連接
myConnection.Close();
}
// 更新資料記錄目前位置的訊息
protected void 飛狐工作室_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxPosition.Text = string.Format("資料記錄:目前位置 {0} 總數 {1}", bmFoxStudio.Position + 1, bmFoxStudio.Count);
}
// 按下「第一筆」按鈕
private void btnFirst_Click(object sender, System.EventArgs e)
...{
// 將 Position 屬性設定成 0
bmFoxStudio.Position = 0;
}
// 按下「上一筆」按鈕
private void btnBack_Click(object sender, System.EventArgs e)
...{
if (bmFoxStudio.Position > 0)
...{
// 將 Position 屬性遞減 1
bmFoxStudio.Position -= 1;
}
}
// 按下「下一筆」按鈕
private void btnNext_Click(object sender, System.EventArgs e)
...{
if (bmFoxStudio.Position < bmFoxStudio.Count - 1)
...{
// 將 Position 屬性遞增 1
bmFoxStudio.Position += 1;
}
}
// 按下「最後一筆」按鈕
private void btnEnd_Click(object sender, System.EventArgs e)
...{
bmFoxStudio.Position = bmFoxStudio.Count - 1;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace ch1
...{
public partial class BindingDemoForm8 : Form
...{
public BindingDemoForm8()
...{
InitializeComponent();
}
// 資料集物件的類別層級建立
DataSet ds = new DataSet();
// CurrencyManager 物件的類別層級宣告
BindingManagerBase bmFoxStudio;
// 定義一個內含 EveryDepartment 物件的陣列來作為 ComboBox 控制項的資料來源
EveryDepartment[] AllDepartments = new EveryDepartment[] ...{ new EveryDepartment("生產製造部"), new EveryDepartment("行銷部"), new EveryDepartment("財務部"), new EveryDepartment("會計部"), new EveryDepartment("業務部"), new EveryDepartment("資訊部") };
private void BindingDemoForm8_Load(object sender, System.EventArgs e)
...{
// 設定表單的最小大小
this.MinimumSize = new Size(512, 494);
// 建立一個連接字串
string strConnection = "Server=(local);Database=ch1;uid=sa;pwd=";
// 建立一個查詢命令字串
string strSql = "SELECT 身份證字號,姓名,員工性別,住家地址,出生日期,目前薪資,部門,自傳 FROM 飛狐工作室";
// 建立一個資料連接
SqlConnection myConnection = new SqlConnection(strConnection);
// 建立一個資料配接器以便針對資料來源執行 SELECT 陳述式來提取出要填入資料集的資料記錄
SqlDataAdapter myAD = new SqlDataAdapter(strSql, myConnection);
// 將資料填入資料集
myAD.Fill(ds, "飛狐工作室");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「身份證字號」欄位
TextBoxID.DataBindings.Add("Text", ds, "飛狐工作室.身份證字號");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「姓名」欄位
TextBoxName.DataBindings.Add("Text", ds, "飛狐工作室.姓名");
// 將 CheckBox 控制項的 Checked 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「員工性別」欄位
CheckBoxGender.DataBindings.Add("Checked", ds, "飛狐工作室.員工性別");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「住家地址」欄位
TextBoxAddress.DataBindings.Add("Text", ds, "飛狐工作室.住家地址");
// 將 DateTimePicker 控制項的 Value 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「出生日期」欄位
DateTimePickerBirthday.DataBindings.Add("Value", ds, "飛狐工作室.出生日期");
// 將 NumericUpDown 控制項的 Value 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「目前薪資」欄位
NumericUpDownSalary.DataBindings.Add("Value", ds, "飛狐工作室.目前薪資");
// 將 TextBox 控制項的 Text 屬性繫結至資料集 ds 內之「飛狐工作室」資料表的「自傳」欄位
TextBoxContent.DataBindings.Add("Text", ds, "飛狐工作室.自傳");
// 將 ComboBox 控制項的資料來源設定成 AllDepartments 陣列
ComboBoxDepartment.DataSource = AllDepartments;
// 將 DisplayMember 屬性設定為 EveryDepartment 物件的 DepartmentName 屬性(EveryDepartment.DepartmentName)
ComboBoxDepartment.DisplayMember = "DepartmentName";
// 設定 EveryDepartment 物件的 DepartmentName 屬性值將被寫入稍後所繫結的欄位
ComboBoxDepartment.ValueMember = "DepartmentName";
// 將 SelectedValue 屬性繫結至「飛狐工作室」資料表的「部門」欄位,如此一來,
// 使用者所選取之選項的 DepartmentName 屬性值便會寫入「飛狐工作室」資料表的「部門」欄位。
ComboBoxDepartment.DataBindings.Add("SelectedValue", ds, "飛狐工作室.部門");
// 取得代表「飛狐工作室」資料表的 CurrencyManager 物件
bmFoxStudio = this.BindingContext[ds, "飛狐工作室"];
// 設定當引發 PositionChanged 事件時便執行事件處理常式 飛狐工作室_PositionChanged
bmFoxStudio.PositionChanged += 飛狐工作室_PositionChanged;
// 設定資料記錄目前位置訊息的初值
TextBoxPosition.Text = string.Format("資料記錄:目前位置 {0} 總數 {1}", bmFoxStudio.Position + 1, bmFoxStudio.Count);
// 關閉對資料庫的連接
myConnection.Close();
}
// 更新資料記錄目前位置的訊息
protected void 飛狐工作室_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxPosition.Text = string.Format("資料記錄:目前位置 {0} 總數 {1}", bmFoxStudio.Position + 1, bmFoxStudio.Count);
}
// 按下「第一筆」按鈕
private void btnFirst_Click(object sender, System.EventArgs e)
...{
// 將 Position 屬性設定成 0
bmFoxStudio.Position = 0;
}
// 按下「上一筆」按鈕
private void btnBack_Click(object sender, System.EventArgs e)
...{
if (bmFoxStudio.Position > 0)
...{
// 將 Position 屬性遞減 1
bmFoxStudio.Position -= 1;
}
}
// 按下「下一筆」按鈕
private void btnNext_Click(object sender, System.EventArgs e)
...{
if (bmFoxStudio.Position < bmFoxStudio.Count - 1)
...{
// 將 Position 屬性遞增 1
bmFoxStudio.Position += 1;
}
}
// 按下「最後一筆」按鈕
private void btnEnd_Click(object sender, System.EventArgs e)
...{
bmFoxStudio.Position = bmFoxStudio.Count - 1;
}
}
}
窗体代码:
namespace ch1
...{
partial class BindingDemoForm8
...{
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
...{
if (disposing && (components != null))
...{
components.Dispose();
}
base.Dispose(disposing);
}
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
...{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BindingDemoForm8));
this.ComboBoxDepartment = new System.Windows.Forms.ComboBox();
this.lblHeader = new System.Windows.Forms.Label();
this.btnEnd = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnBack = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.TextBoxPosition = new System.Windows.Forms.TextBox();
this.NumericUpDownSalary = new System.Windows.Forms.NumericUpDown();
this.lblContent = new System.Windows.Forms.Label();
this.TextBoxContent = new System.Windows.Forms.TextBox();
this.DateTimePickerBirthday = new System.Windows.Forms.DateTimePicker();
this.CheckBoxGender = new System.Windows.Forms.CheckBox();
this.lblDepartment = new System.Windows.Forms.Label();
this.lblSalary = new System.Windows.Forms.Label();
this.lblBirthday = new System.Windows.Forms.Label();
this.lblAddress = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.lblName = new System.Windows.Forms.Label();
this.lblID = new System.Windows.Forms.Label();
this.TextBoxAddress = new System.Windows.Forms.TextBox();
this.TextBoxName = new System.Windows.Forms.TextBox();
this.TextBoxID = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.NumericUpDownSalary)).BeginInit();
this.SuspendLayout();
//
// ComboBoxDepartment
//
this.ComboBoxDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ComboBoxDepartment.Location = new System.Drawing.Point(113, 200);
this.ComboBoxDepartment.Name = "ComboBoxDepartment";
this.ComboBoxDepartment.Size = new System.Drawing.Size(121, 20);
this.ComboBoxDepartment.TabIndex = 104;
//
// lblHeader
//
this.lblHeader.AutoSize = true;
this.lblHeader.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.lblHeader.ForeColor = System.Drawing.Color.Red;
this.lblHeader.Location = new System.Drawing.Point(58, 19);
this.lblHeader.Name = "lblHeader";
this.lblHeader.Size = new System.Drawing.Size(302, 16);
this.lblHeader.TabIndex = 103;
this.lblHeader.Text = "使用 ComboBox 控制項來編輯欄位資料";
//
// btnEnd
//
this.btnEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnEnd.Image")));
this.btnEnd.Location = new System.Drawing.Point(329, 374);
this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(75, 21);
this.btnEnd.TabIndex = 102;
this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
//
// btnNext
//
this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
this.btnNext.Location = new System.Drawing.Point(241, 374);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(75, 21);
this.btnNext.TabIndex = 101;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnBack
//
this.btnBack.Image = ((System.Drawing.Image)(resources.GetObject("btnBack.Image")));
this.btnBack.Location = new System.Drawing.Point(153, 374);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(75, 21);
this.btnBack.TabIndex = 100;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// btnFirst
//
this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
this.btnFirst.Location = new System.Drawing.Point(57, 374);
this.btnFirst.Name = "btnFirst";
this.btnFirst.Size = new System.Drawing.Size(75, 21);
this.btnFirst.TabIndex = 99;
this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
//
// TextBoxPosition
//
this.TextBoxPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxPosition.Location = new System.Drawing.Point(65, 337);
this.TextBoxPosition.Name = "TextBoxPosition";
this.TextBoxPosition.Size = new System.Drawing.Size(333, 21);
this.TextBoxPosition.TabIndex = 98;
this.TextBoxPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// NumericUpDownSalary
//
this.NumericUpDownSalary.DecimalPlaces = 2;
this.NumericUpDownSalary.Location = new System.Drawing.Point(113, 175);
this.NumericUpDownSalary.Maximum = new decimal(new int[] ...{
300000,
0,
0,
0});
this.NumericUpDownSalary.Name = "NumericUpDownSalary";
this.NumericUpDownSalary.Size = new System.Drawing.Size(120, 21);
this.NumericUpDownSalary.TabIndex = 94;
this.NumericUpDownSalary.ThousandsSeparator = true;
//
// lblContent
//
this.lblContent.AutoSize = true;
this.lblContent.Location = new System.Drawing.Point(65, 231);
this.lblContent.Name = "lblContent";
this.lblContent.Size = new System.Drawing.Size(35, 12);
this.lblContent.TabIndex = 96;
this.lblContent.Text = "自傳:";
//
// TextBoxContent
//
this.TextBoxContent.ForeColor = System.Drawing.Color.Blue;
this.TextBoxContent.Location = new System.Drawing.Point(113, 231);
this.TextBoxContent.Multiline = true;
this.TextBoxContent.Name = "TextBoxContent";
this.TextBoxContent.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TextBoxContent.Size = new System.Drawing.Size(349, 88);
this.TextBoxContent.TabIndex = 97;
//
// DateTimePickerBirthday
//
this.DateTimePickerBirthday.Location = new System.Drawing.Point(113, 150);
this.DateTimePickerBirthday.Name = "DateTimePickerBirthday";
this.DateTimePickerBirthday.Size = new System.Drawing.Size(200, 21);
this.DateTimePickerBirthday.TabIndex = 92;
//
// CheckBoxGender
//
this.CheckBoxGender.Location = new System.Drawing.Point(113, 100);
this.CheckBoxGender.Name = "CheckBoxGender";
this.CheckBoxGender.Size = new System.Drawing.Size(16, 19);
this.CheckBoxGender.TabIndex = 88;
//
// lblDepartment
//
this.lblDepartment.AutoSize = true;
this.lblDepartment.Location = new System.Drawing.Point(65, 200);
this.lblDepartment.Name = "lblDepartment";
this.lblDepartment.Size = new System.Drawing.Size(35, 12);
this.lblDepartment.TabIndex = 95;
this.lblDepartment.Text = "部門:";
//
// lblSalary
//
this.lblSalary.AutoSize = true;
this.lblSalary.Location = new System.Drawing.Point(41, 175);
this.lblSalary.Name = "lblSalary";
this.lblSalary.Size = new System.Drawing.Size(59, 12);
this.lblSalary.TabIndex = 93;
this.lblSalary.Text = "目前薪資:";
//
// lblBirthday
//
this.lblBirthday.AutoSize = true;
this.lblBirthday.Location = new System.Drawing.Point(41, 150);
this.lblBirthday.Name = "lblBirthday";
this.lblBirthday.Size = new System.Drawing.Size(59, 12);
this.lblBirthday.TabIndex = 91;
this.lblBirthday.Text = "出生日期:";
//
// lblAddress
//
this.lblAddress.AutoSize = true;
this.lblAddress.Location = new System.Drawing.Point(65, 125);
this.lblAddress.Name = "lblAddress";
this.lblAddress.Size = new System.Drawing.Size(35, 12);
this.lblAddress.TabIndex = 89;
this.lblAddress.Text = "地址:";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(65, 100);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(35, 12);
this.Label1.TabIndex = 87;
this.Label1.Text = "性別:";
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.Location = new System.Drawing.Point(65, 75);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(35, 12);
this.lblName.TabIndex = 85;
this.lblName.Text = "姓名:";
//
// lblID
//
this.lblID.AutoSize = true;
this.lblID.Location = new System.Drawing.Point(29, 50);
this.lblID.Name = "lblID";
this.lblID.Size = new System.Drawing.Size(71, 12);
this.lblID.TabIndex = 83;
this.lblID.Text = "身份證字號:";
//
// TextBoxAddress
//
this.TextBoxAddress.Location = new System.Drawing.Point(113, 125);
this.TextBoxAddress.Name = "TextBoxAddress";
this.TextBoxAddress.Size = new System.Drawing.Size(344, 21);
this.TextBoxAddress.TabIndex = 90;
//
// TextBoxName
//
this.TextBoxName.Location = new System.Drawing.Point(113, 75);
this.TextBoxName.Name = "TextBoxName";
this.TextBoxName.Size = new System.Drawing.Size(100, 21);
this.TextBoxName.TabIndex = 86;
//
// TextBoxID
//
this.TextBoxID.Location = new System.Drawing.Point(113, 50);
this.TextBoxID.Name = "TextBoxID";
this.TextBoxID.Size = new System.Drawing.Size(100, 21);
this.TextBoxID.TabIndex = 84;
//
// BindingDemoForm8
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(522, 470);
this.Controls.Add(this.ComboBoxDepartment);
this.Controls.Add(this.lblHeader);
this.Controls.Add(this.btnEnd);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.btnFirst);
this.Controls.Add(this.TextBoxPosition);
this.Controls.Add(this.NumericUpDownSalary);
this.Controls.Add(this.lblContent);
this.Controls.Add(this.TextBoxContent);
this.Controls.Add(this.DateTimePickerBirthday);
this.Controls.Add(this.CheckBoxGender);
this.Controls.Add(this.lblDepartment);
this.Controls.Add(this.lblSalary);
this.Controls.Add(this.lblBirthday);
this.Controls.Add(this.lblAddress);
this.Controls.Add(this.Label1);
this.Controls.Add(this.lblName);
this.Controls.Add(this.lblID);
this.Controls.Add(this.TextBoxAddress);
this.Controls.Add(this.TextBoxName);
this.Controls.Add(this.TextBoxID);
this.Name = "BindingDemoForm8";
this.Text = "BindingDemoForm8";
this.Load += new System.EventHandler(this.BindingDemoForm8_Load);
((System.ComponentModel.ISupportInitialize)(this.NumericUpDownSalary)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.ComboBox ComboBoxDepartment;
internal System.Windows.Forms.Label lblHeader;
internal System.Windows.Forms.Button btnEnd;
internal System.Windows.Forms.Button btnNext;
internal System.Windows.Forms.Button btnBack;
internal System.Windows.Forms.Button btnFirst;
internal System.Windows.Forms.TextBox TextBoxPosition;
internal System.Windows.Forms.NumericUpDown NumericUpDownSalary;
internal System.Windows.Forms.Label lblContent;
internal System.Windows.Forms.TextBox TextBoxContent;
internal System.Windows.Forms.DateTimePicker DateTimePickerBirthday;
internal System.Windows.Forms.CheckBox CheckBoxGender;
internal System.Windows.Forms.Label lblDepartment;
internal System.Windows.Forms.Label lblSalary;
internal System.Windows.Forms.Label lblBirthday;
internal System.Windows.Forms.Label lblAddress;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.Label lblName;
internal System.Windows.Forms.Label lblID;
internal System.Windows.Forms.TextBox TextBoxAddress;
internal System.Windows.Forms.TextBox TextBoxName;
internal System.Windows.Forms.TextBox TextBoxID;
}
}
...{
partial class BindingDemoForm8
...{
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
...{
if (disposing && (components != null))
...{
components.Dispose();
}
base.Dispose(disposing);
}
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
...{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BindingDemoForm8));
this.ComboBoxDepartment = new System.Windows.Forms.ComboBox();
this.lblHeader = new System.Windows.Forms.Label();
this.btnEnd = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnBack = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.TextBoxPosition = new System.Windows.Forms.TextBox();
this.NumericUpDownSalary = new System.Windows.Forms.NumericUpDown();
this.lblContent = new System.Windows.Forms.Label();
this.TextBoxContent = new System.Windows.Forms.TextBox();
this.DateTimePickerBirthday = new System.Windows.Forms.DateTimePicker();
this.CheckBoxGender = new System.Windows.Forms.CheckBox();
this.lblDepartment = new System.Windows.Forms.Label();
this.lblSalary = new System.Windows.Forms.Label();
this.lblBirthday = new System.Windows.Forms.Label();
this.lblAddress = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.lblName = new System.Windows.Forms.Label();
this.lblID = new System.Windows.Forms.Label();
this.TextBoxAddress = new System.Windows.Forms.TextBox();
this.TextBoxName = new System.Windows.Forms.TextBox();
this.TextBoxID = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.NumericUpDownSalary)).BeginInit();
this.SuspendLayout();
//
// ComboBoxDepartment
//
this.ComboBoxDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ComboBoxDepartment.Location = new System.Drawing.Point(113, 200);
this.ComboBoxDepartment.Name = "ComboBoxDepartment";
this.ComboBoxDepartment.Size = new System.Drawing.Size(121, 20);
this.ComboBoxDepartment.TabIndex = 104;
//
// lblHeader
//
this.lblHeader.AutoSize = true;
this.lblHeader.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.lblHeader.ForeColor = System.Drawing.Color.Red;
this.lblHeader.Location = new System.Drawing.Point(58, 19);
this.lblHeader.Name = "lblHeader";
this.lblHeader.Size = new System.Drawing.Size(302, 16);
this.lblHeader.TabIndex = 103;
this.lblHeader.Text = "使用 ComboBox 控制項來編輯欄位資料";
//
// btnEnd
//
this.btnEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnEnd.Image")));
this.btnEnd.Location = new System.Drawing.Point(329, 374);
this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(75, 21);
this.btnEnd.TabIndex = 102;
this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
//
// btnNext
//
this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
this.btnNext.Location = new System.Drawing.Point(241, 374);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(75, 21);
this.btnNext.TabIndex = 101;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnBack
//
this.btnBack.Image = ((System.Drawing.Image)(resources.GetObject("btnBack.Image")));
this.btnBack.Location = new System.Drawing.Point(153, 374);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(75, 21);
this.btnBack.TabIndex = 100;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// btnFirst
//
this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
this.btnFirst.Location = new System.Drawing.Point(57, 374);
this.btnFirst.Name = "btnFirst";
this.btnFirst.Size = new System.Drawing.Size(75, 21);
this.btnFirst.TabIndex = 99;
this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
//
// TextBoxPosition
//
this.TextBoxPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxPosition.Location = new System.Drawing.Point(65, 337);
this.TextBoxPosition.Name = "TextBoxPosition";
this.TextBoxPosition.Size = new System.Drawing.Size(333, 21);
this.TextBoxPosition.TabIndex = 98;
this.TextBoxPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// NumericUpDownSalary
//
this.NumericUpDownSalary.DecimalPlaces = 2;
this.NumericUpDownSalary.Location = new System.Drawing.Point(113, 175);
this.NumericUpDownSalary.Maximum = new decimal(new int[] ...{
300000,
0,
0,
0});
this.NumericUpDownSalary.Name = "NumericUpDownSalary";
this.NumericUpDownSalary.Size = new System.Drawing.Size(120, 21);
this.NumericUpDownSalary.TabIndex = 94;
this.NumericUpDownSalary.ThousandsSeparator = true;
//
// lblContent
//
this.lblContent.AutoSize = true;
this.lblContent.Location = new System.Drawing.Point(65, 231);
this.lblContent.Name = "lblContent";
this.lblContent.Size = new System.Drawing.Size(35, 12);
this.lblContent.TabIndex = 96;
this.lblContent.Text = "自傳:";
//
// TextBoxContent
//
this.TextBoxContent.ForeColor = System.Drawing.Color.Blue;
this.TextBoxContent.Location = new System.Drawing.Point(113, 231);
this.TextBoxContent.Multiline = true;
this.TextBoxContent.Name = "TextBoxContent";
this.TextBoxContent.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TextBoxContent.Size = new System.Drawing.Size(349, 88);
this.TextBoxContent.TabIndex = 97;
//
// DateTimePickerBirthday
//
this.DateTimePickerBirthday.Location = new System.Drawing.Point(113, 150);
this.DateTimePickerBirthday.Name = "DateTimePickerBirthday";
this.DateTimePickerBirthday.Size = new System.Drawing.Size(200, 21);
this.DateTimePickerBirthday.TabIndex = 92;
//
// CheckBoxGender
//
this.CheckBoxGender.Location = new System.Drawing.Point(113, 100);
this.CheckBoxGender.Name = "CheckBoxGender";
this.CheckBoxGender.Size = new System.Drawing.Size(16, 19);
this.CheckBoxGender.TabIndex = 88;
//
// lblDepartment
//
this.lblDepartment.AutoSize = true;
this.lblDepartment.Location = new System.Drawing.Point(65, 200);
this.lblDepartment.Name = "lblDepartment";
this.lblDepartment.Size = new System.Drawing.Size(35, 12);
this.lblDepartment.TabIndex = 95;
this.lblDepartment.Text = "部門:";
//
// lblSalary
//
this.lblSalary.AutoSize = true;
this.lblSalary.Location = new System.Drawing.Point(41, 175);
this.lblSalary.Name = "lblSalary";
this.lblSalary.Size = new System.Drawing.Size(59, 12);
this.lblSalary.TabIndex = 93;
this.lblSalary.Text = "目前薪資:";
//
// lblBirthday
//
this.lblBirthday.AutoSize = true;
this.lblBirthday.Location = new System.Drawing.Point(41, 150);
this.lblBirthday.Name = "lblBirthday";
this.lblBirthday.Size = new System.Drawing.Size(59, 12);
this.lblBirthday.TabIndex = 91;
this.lblBirthday.Text = "出生日期:";
//
// lblAddress
//
this.lblAddress.AutoSize = true;
this.lblAddress.Location = new System.Drawing.Point(65, 125);
this.lblAddress.Name = "lblAddress";
this.lblAddress.Size = new System.Drawing.Size(35, 12);
this.lblAddress.TabIndex = 89;
this.lblAddress.Text = "地址:";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Location = new System.Drawing.Point(65, 100);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(35, 12);
this.Label1.TabIndex = 87;
this.Label1.Text = "性別:";
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.Location = new System.Drawing.Point(65, 75);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(35, 12);
this.lblName.TabIndex = 85;
this.lblName.Text = "姓名:";
//
// lblID
//
this.lblID.AutoSize = true;
this.lblID.Location = new System.Drawing.Point(29, 50);
this.lblID.Name = "lblID";
this.lblID.Size = new System.Drawing.Size(71, 12);
this.lblID.TabIndex = 83;
this.lblID.Text = "身份證字號:";
//
// TextBoxAddress
//
this.TextBoxAddress.Location = new System.Drawing.Point(113, 125);
this.TextBoxAddress.Name = "TextBoxAddress";
this.TextBoxAddress.Size = new System.Drawing.Size(344, 21);
this.TextBoxAddress.TabIndex = 90;
//
// TextBoxName
//
this.TextBoxName.Location = new System.Drawing.Point(113, 75);
this.TextBoxName.Name = "TextBoxName";
this.TextBoxName.Size = new System.Drawing.Size(100, 21);
this.TextBoxName.TabIndex = 86;
//
// TextBoxID
//
this.TextBoxID.Location = new System.Drawing.Point(113, 50);
this.TextBoxID.Name = "TextBoxID";
this.TextBoxID.Size = new System.Drawing.Size(100, 21);
this.TextBoxID.TabIndex = 84;
//
// BindingDemoForm8
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(522, 470);
this.Controls.Add(this.ComboBoxDepartment);
this.Controls.Add(this.lblHeader);
this.Controls.Add(this.btnEnd);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.btnFirst);
this.Controls.Add(this.TextBoxPosition);
this.Controls.Add(this.NumericUpDownSalary);
this.Controls.Add(this.lblContent);
this.Controls.Add(this.TextBoxContent);
this.Controls.Add(this.DateTimePickerBirthday);
this.Controls.Add(this.CheckBoxGender);
this.Controls.Add(this.lblDepartment);
this.Controls.Add(this.lblSalary);
this.Controls.Add(this.lblBirthday);
this.Controls.Add(this.lblAddress);
this.Controls.Add(this.Label1);
this.Controls.Add(this.lblName);
this.Controls.Add(this.lblID);
this.Controls.Add(this.TextBoxAddress);
this.Controls.Add(this.TextBoxName);
this.Controls.Add(this.TextBoxID);
this.Name = "BindingDemoForm8";
this.Text = "BindingDemoForm8";
this.Load += new System.EventHandler(this.BindingDemoForm8_Load);
((System.ComponentModel.ISupportInitialize)(this.NumericUpDownSalary)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.ComboBox ComboBoxDepartment;
internal System.Windows.Forms.Label lblHeader;
internal System.Windows.Forms.Button btnEnd;
internal System.Windows.Forms.Button btnNext;
internal System.Windows.Forms.Button btnBack;
internal System.Windows.Forms.Button btnFirst;
internal System.Windows.Forms.TextBox TextBoxPosition;
internal System.Windows.Forms.NumericUpDown NumericUpDownSalary;
internal System.Windows.Forms.Label lblContent;
internal System.Windows.Forms.TextBox TextBoxContent;
internal System.Windows.Forms.DateTimePicker DateTimePickerBirthday;
internal System.Windows.Forms.CheckBox CheckBoxGender;
internal System.Windows.Forms.Label lblDepartment;
internal System.Windows.Forms.Label lblSalary;
internal System.Windows.Forms.Label lblBirthday;
internal System.Windows.Forms.Label lblAddress;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.Label lblName;
internal System.Windows.Forms.Label lblID;
internal System.Windows.Forms.TextBox TextBoxAddress;
internal System.Windows.Forms.TextBox TextBoxName;
internal System.Windows.Forms.TextBox TextBoxID;
}
}
- ado.net c#.net2005 From第一讲(BindingDemoForm8)
- ado.net c#.net2005 From第一讲(BindingDemoForm1)
- ado.net c#.net2005 From第一讲(BindingDemoForm2)
- ado.net c#.net2005 From第一讲(BindingDemoForm3)
- ado.net c#.net2005 From第一讲(BindingDemoForm4)
- ado.net c#.net2005 From第一讲(BindingDemoForm5)
- ado.net c#.net2005 From第一讲(BindingDemoForm6)
- ado.net c#.net2005 From第一讲(BindingDemoForm7)
- ado.net c#.net2005 From第一讲(BindingDemoForm9)
- ado.net c#.net2005 From第一讲(BindingDemoForm10)
- ado.net c#.net2005 From第一讲(BindingDemoForm11)
- ado.net c#.net2005 From第一讲(BindingDemoForm12)
- ado.net c#.net2005 From第一讲(BindingDemoForm13)
- ado.net c#.net2005 From第一讲(BindingDemoForm14)
- ado.net c#.net2005 From第一讲(BindingDemoForm15)
- C语言第一讲
- [C#]ado.net 转 ado
- C#:ADO.NET简介
- 这两天在外地,暂时不更新blog了哈
- linux环境变量
- 线程与进程
- 淘宝MMVS张博士(水木特快)
- 已知顶点求多边行面积
- ado.net c#.net2005 From第一讲(BindingDemoForm8)
- 1000门课程中英互译
- 与老外吵架必会的100句英语
- 在注册表中找到你的dns服务器
- 在ubuntu英文环境下使用中文输入法
- 象形文字--中文自然语言理解的突破
- RDL(C) Report Design Step by Step
- hibernate二级缓存的配置
- Linux那些事儿之我是Hub(3)一样的精灵不一样的API