?? testform.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.OleDb;
using ControlLib;
namespace TestControls
{
/// <summary>
/// Summary description for Form2.
/// </summary>
public class TestForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panelTop;
private ControlLib.dbTreeViewCtrl bookTree;
private System.Windows.Forms.TextBox txtBookID;
private System.Windows.Forms.Button btnFind;
private System.Data.DataSet dsBooks;
private System.Data.DataView bookDataView;
private System.Data.OleDb.OleDbConnection accessConn;
private System.Data.OleDb.OleDbCommand cmdGetAuthors;
private System.Windows.Forms.Splitter splitter2;
private System.Windows.Forms.Panel panelContainer;
private System.Windows.Forms.Panel panelPublisher;
private System.Windows.Forms.TextBox txtPubContry;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtPubState;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtPubCity;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtPubName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panelAuthor;
private System.Windows.Forms.TextBox txtAuthAddress;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox txtAuthLastName;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtAuthZip;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtAuthState;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtAuthCity;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtAuthFirstName;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Panel panelTitle;
private System.Windows.Forms.Label lblTitleID;
private System.Windows.Forms.TextBox txtBookAdvPaid;
private System.Windows.Forms.TextBox txtBookRoylaty;
private System.Windows.Forms.TextBox txtBookPrice;
private System.Windows.Forms.TextBox txtBookYTDSales;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.TextBox txtBookTitleNodes;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.TextBox txtBookPubDate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.TextBox txtBookType;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox txtBookTitle;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label13;
private ControlLib.dbImageBox imgBookCover;
private System.Windows.Forms.ImageList imgList;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuPublisher;
private System.Windows.Forms.MenuItem menuAuthor;
private System.Windows.Forms.MenuItem menuTitle;
private System.Windows.Forms.Label lblLocate;
private System.Windows.Forms.Label lblAuthorID;
private System.Windows.Forms.Label lblPublisherID;
private System.ComponentModel.IContainer components;
public TestForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.SetUpDataBinding ();
}
/// <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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TestForm));
this.panelTop = new System.Windows.Forms.Panel();
this.btnFind = new System.Windows.Forms.Button();
this.txtBookID = new System.Windows.Forms.TextBox();
this.lblLocate = new System.Windows.Forms.Label();
this.bookTree = new ControlLib.dbTreeViewCtrl();
this.imgList = new System.Windows.Forms.ImageList(this.components);
this.accessConn = new System.Data.OleDb.OleDbConnection();
this.dsBooks = new System.Data.DataSet();
this.bookDataView = new System.Data.DataView();
this.cmdGetAuthors = new System.Data.OleDb.OleDbCommand();
this.splitter2 = new System.Windows.Forms.Splitter();
this.panelContainer = new System.Windows.Forms.Panel();
this.panelAuthor = new System.Windows.Forms.Panel();
this.lblAuthorID = new System.Windows.Forms.Label();
this.txtAuthAddress = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.txtAuthLastName = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtAuthZip = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.txtAuthState = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.txtAuthCity = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.txtAuthFirstName = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.panelPublisher = new System.Windows.Forms.Panel();
this.lblPublisherID = new System.Windows.Forms.Label();
this.txtPubContry = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtPubState = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.txtPubCity = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtPubName = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.panelTitle = new System.Windows.Forms.Panel();
this.lblTitleID = new System.Windows.Forms.Label();
this.txtBookTitleNodes = new System.Windows.Forms.TextBox();
this.imgBookCover = new ControlLib.dbImageBox();
this.txtBookAdvPaid = new System.Windows.Forms.TextBox();
this.txtBookRoylaty = new System.Windows.Forms.TextBox();
this.txtBookPrice = new System.Windows.Forms.TextBox();
this.txtBookYTDSales = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.txtBookPubDate = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.txtBookType = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.txtBookTitle = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuPublisher = new System.Windows.Forms.MenuItem();
this.menuAuthor = new System.Windows.Forms.MenuItem();
this.menuTitle = new System.Windows.Forms.MenuItem();
this.panelTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dsBooks)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bookDataView)).BeginInit();
this.panelContainer.SuspendLayout();
this.panelAuthor.SuspendLayout();
this.panelPublisher.SuspendLayout();
this.panelTitle.SuspendLayout();
this.SuspendLayout();
//
// panelTop
//
this.panelTop.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(215)), ((System.Byte)(215)), ((System.Byte)(255)));
this.panelTop.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panelTop.Controls.Add(this.btnFind);
this.panelTop.Controls.Add(this.txtBookID);
this.panelTop.Controls.Add(this.lblLocate);
this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
this.panelTop.Location = new System.Drawing.Point(0, 0);
this.panelTop.Name = "panelTop";
this.panelTop.Size = new System.Drawing.Size(584, 56);
this.panelTop.TabIndex = 0;
//
// btnFind
//
this.btnFind.Location = new System.Drawing.Point(384, 16);
this.btnFind.Name = "btnFind";
this.btnFind.TabIndex = 2;
this.btnFind.Text = "Find";
this.btnFind.Click += new System.EventHandler(this.btnFind_Click);
//
// txtBookID
//
this.txtBookID.Location = new System.Drawing.Point(272, 16);
this.txtBookID.Name = "txtBookID";
this.txtBookID.TabIndex = 1;
this.txtBookID.Text = "";
//
// lblLocate
//
this.lblLocate.AutoSize = true;
this.lblLocate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(177)));
this.lblLocate.Location = new System.Drawing.Point(48, 16);
this.lblLocate.Name = "lblLocate";
this.lblLocate.Size = new System.Drawing.Size(216, 18);
this.lblLocate.TabIndex = 0;
this.lblLocate.Text = "Locate Publisher By Publisher ID :";
this.lblLocate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// bookTree
//
this.bookTree.AutoBuildTree = true;
this.bookTree.DataSource = null;
this.bookTree.DisplayMember = "title";
this.bookTree.Dock = System.Windows.Forms.DockStyle.Left;
this.bookTree.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.bookTree.ImageIndex = 2;
this.bookTree.ImageList = this.imgList;
this.bookTree.Location = new System.Drawing.Point(0, 56);
this.bookTree.Name = "bookTree";
this.bookTree.SelectedImageIndex = 2;
this.bookTree.Size = new System.Drawing.Size(216, 374);
this.bookTree.TabIndex = 1;
this.bookTree.ValueMember = "title_id";
this.bookTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.bookTree_AfterSelect);
//
// imgList
//
this.imgList.ImageSize = new System.Drawing.Size(16, 16);
this.imgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList.ImageStream")));
this.imgList.TransparentColor = System.Drawing.Color.Transparent;
//
// accessConn
//
this.accessConn.ConnectionString = @"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data Source=""TheSample.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security info=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1";
//
// dsBooks
//
this.dsBooks.DataSetName = "Books";
this.dsBooks.Locale = new System.Globalization.CultureInfo("en-US");
//
// cmdGetAuthors
//
this.cmdGetAuthors.CommandText = "SELECT GetAuthors.* FROM GetAuthors";
this.cmdGetAuthors.Connection = this.accessConn;
//
// splitter2
//
this.splitter2.Location = new System.Drawing.Point(216, 56);
this.splitter2.Name = "splitter2";
this.splitter2.Size = new System.Drawing.Size(2, 374);
this.splitter2.TabIndex = 4;
this.splitter2.TabStop = false;
//
// panelContainer
//
this.panelContainer.Controls.Add(this.panelAuthor);
this.panelContainer.Controls.Add(this.panelPublisher);
this.panelContainer.Controls.Add(this.panelTitle);
this.panelContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelContainer.Location = new System.Drawing.Point(218, 56);
this.panelContainer.Name = "panelContainer";
this.panelContainer.Size = new System.Drawing.Size(366, 374);
this.panelContainer.TabIndex = 5;
//
// panelAuthor
//
this.panelAuthor.BackColor = System.Drawing.SystemColors.Control;
this.panelAuthor.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panelAuthor.Controls.Add(this.lblAuthorID);
this.panelAuthor.Controls.Add(this.txtAuthAddress);
this.panelAuthor.Controls.Add(this.label12);
this.panelAuthor.Controls.Add(this.txtAuthLastName);
this.panelAuthor.Controls.Add(this.label11);
this.panelAuthor.Controls.Add(this.txtAuthZip);
this.panelAuthor.Controls.Add(this.label6);
this.panelAuthor.Controls.Add(this.txtAuthState);
this.panelAuthor.Controls.Add(this.label7);
this.panelAuthor.Controls.Add(this.txtAuthCity);
this.panelAuthor.Controls.Add(this.label8);
this.panelAuthor.Controls.Add(this.txtAuthFirstName);
this.panelAuthor.Controls.Add(this.label9);
this.panelAuthor.Controls.Add(this.label10);
this.panelAuthor.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelAuthor.Location = new System.Drawing.Point(0, 0);
this.panelAuthor.Name = "panelAuthor";
this.panelAuthor.Size = new System.Drawing.Size(366, 374);
this.panelAuthor.TabIndex = 11;
//
// lblAuthorID
//
this.lblAuthorID.Cursor = System.Windows.Forms.Cursors.IBeam;
this.lblAuthorID.Location = new System.Drawing.Point(240, 344);
this.lblAuthorID.Name = "lblAuthorID";
this.lblAuthorID.Size = new System.Drawing.Size(112, 16);
this.lblAuthorID.TabIndex = 22;
this.lblAuthorID.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// txtAuthAddress
//
this.txtAuthAddress.Location = new System.Drawing.Point(112, 152);
this.txtAuthAddress.Name = "txtAuthAddress";
this.txtAuthAddress.Size = new System.Drawing.Size(224, 20);
this.txtAuthAddress.TabIndex = 21;
this.txtAuthAddress.Text = "";
//
// label12
//
this.label12.Location = new System.Drawing.Point(32, 152);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(72, 23);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -