📄 controlemployees.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlServerCe;
namespace Microsoft.Sql.SqlCe.Samples.Cs.NorthwindCe {
/// <summary>
/// Summary description for ControlEmployees.
/// </summary>
public class ControlEmployees : System.Windows.Forms.Control {
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.Label labelAddress;
private System.Windows.Forms.Label labelEmployee;
private System.Windows.Forms.TextBox textBoxEmployeeID;
private System.Windows.Forms.Label labelEmployeeID;
private System.Windows.Forms.TextBox textBoxHireDate;
private System.Windows.Forms.TextBox textBoxTitle;
private System.Windows.Forms.TextBox textBoxHomePhone;
private System.Windows.Forms.Label labelHomePhone;
private System.Windows.Forms.TextBox textBoxPostalCode;
private System.Windows.Forms.TextBox textBoxRegion;
private System.Windows.Forms.TextBox textBoxCity;
private System.Windows.Forms.TextBox textBoxAddress;
private System.Windows.Forms.Label labelHireDate;
private System.Windows.Forms.Label labelTitle;
private System.Windows.Forms.ComboBox comboBoxEmployees;
private SqlCeDataAdapter daEmployees = null;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public ControlEmployees() {
// This call is required by the Windows.Forms Form Designer.
//
InitializeComponent();
}
/// <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 Component 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.buttonSave = new System.Windows.Forms.Button();
this.labelAddress = new System.Windows.Forms.Label();
this.labelEmployee = new System.Windows.Forms.Label();
this.textBoxEmployeeID = new System.Windows.Forms.TextBox();
this.labelEmployeeID = new System.Windows.Forms.Label();
this.textBoxHireDate = new System.Windows.Forms.TextBox();
this.textBoxTitle = new System.Windows.Forms.TextBox();
this.textBoxHomePhone = new System.Windows.Forms.TextBox();
this.labelHomePhone = new System.Windows.Forms.Label();
this.textBoxPostalCode = new System.Windows.Forms.TextBox();
this.textBoxRegion = new System.Windows.Forms.TextBox();
this.textBoxCity = new System.Windows.Forms.TextBox();
this.textBoxAddress = new System.Windows.Forms.TextBox();
this.labelHireDate = new System.Windows.Forms.Label();
this.labelTitle = new System.Windows.Forms.Label();
this.comboBoxEmployees = new System.Windows.Forms.ComboBox();
//
// buttonSave
//
this.buttonSave.Location = new System.Drawing.Point(152, 216);
this.buttonSave.Size = new System.Drawing.Size(72, 24);
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
this.buttonSave.Text = "Save";
//
// labelAddress
//
this.labelAddress.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold);
this.labelAddress.Location = new System.Drawing.Point(0, 80);
this.labelAddress.Size = new System.Drawing.Size(56, 16);
this.labelAddress.Text = "Address:";
this.labelAddress.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// labelEmployee
//
this.labelEmployee.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold);
this.labelEmployee.Location = new System.Drawing.Point(0, 16);
this.labelEmployee.Size = new System.Drawing.Size(56, 16);
this.labelEmployee.Text = "Name:";
this.labelEmployee.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textBoxEmployeeID
//
this.textBoxEmployeeID.Enabled = false;
this.textBoxEmployeeID.Location = new System.Drawing.Point(168, 184);
this.textBoxEmployeeID.Size = new System.Drawing.Size(56, 20);
this.textBoxEmployeeID.Text = "";
//
// labelEmployeeID
//
this.labelEmployeeID.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold);
this.labelEmployeeID.Location = new System.Drawing.Point(128, 184);
this.labelEmployeeID.Size = new System.Drawing.Size(32, 16);
this.labelEmployeeID.Text = "ID:";
this.labelEmployeeID.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textBoxHireDate
//
this.textBoxHireDate.Location = new System.Drawing.Point(64, 184);
this.textBoxHireDate.Size = new System.Drawing.Size(56, 20);
this.textBoxHireDate.Text = "";
this.textBoxHireDate.Enabled = false;
//
// textBoxTitle
//
this.textBoxTitle.BackColor = System.Drawing.SystemColors.Window;
this.textBoxTitle.Location = new System.Drawing.Point(64, 48);
this.textBoxTitle.Size = new System.Drawing.Size(160, 20);
this.textBoxTitle.Text = "";
//
// textBoxHomePhone
//
this.textBoxHomePhone.Location = new System.Drawing.Point(64, 152);
this.textBoxHomePhone.Size = new System.Drawing.Size(160, 20);
this.textBoxHomePhone.Text = "";
//
// labelHomePhone
//
this.labelHomePhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold);
this.labelHomePhone.Location = new System.Drawing.Point(32, 152);
this.labelHomePhone.Size = new System.Drawing.Size(24, 16);
this.labelHomePhone.Text = "Tel:";
this.labelHomePhone.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// textBoxPostalCode
//
this.textBoxPostalCode.Location = new System.Drawing.Point(176, 120);
this.textBoxPostalCode.Size = new System.Drawing.Size(48, 20);
this.textBoxPostalCode.Text = "";
//
// textBoxRegion
//
this.textBoxRegion.Location = new System.Drawing.Point(136, 120);
this.textBoxRegion.Size = new System.Drawing.Size(32, 20);
this.textBoxRegion.Text = "";
//
// textBoxCity
//
this.textBoxCity.Location = new System.Drawing.Point(64, 120);
this.textBoxCity.Size = new System.Drawing.Size(68, 20);
this.textBoxCity.Text = "";
//
// textBoxAddress
//
this.textBoxAddress.Location = new System.Drawing.Point(64, 80);
this.textBoxAddress.Multiline = true;
this.textBoxAddress.Size = new System.Drawing.Size(160, 35);
this.textBoxAddress.AcceptsReturn = true;
this.textBoxAddress.Text = "";
this.textBoxAddress.WordWrap = true;
//
// labelHireDate
//
this.labelHireDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold);
this.labelHireDate.Location = new System.Drawing.Point(24, 184);
this.labelHireDate.Size = new System.Drawing.Size(32, 16);
this.labelHireDate.Text = "Hire:";
this.labelHireDate.TextAlign = System.Drawing.ContentAlignment.TopRight;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -