⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winform.pas.~1~

📁 Delphi 2005程序设计教程_实例源文件和教学课件
💻 ~1~
📖 第 1 页 / 共 5 页
字号:
unit WinForm;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, Borland.Data.Provider, Borland.Data.Common, 
  System.Globalization, dsAdminUnit, dsStuUnit;

type
  frmMain = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
                TabControl1: System.Windows.Forms.TabControl;
                TabPage1: System.Windows.Forms.TabPage;
                TabPage2: System.Windows.Forms.TabPage;
                GroupBox1: System.Windows.Forms.GroupBox;
                dgStu: System.Windows.Forms.DataGrid;
                rbStuID: System.Windows.Forms.RadioButton;
                rbStuName: System.Windows.Forms.RadioButton;
                Label1: System.Windows.Forms.Label;
                txtKey: System.Windows.Forms.TextBox;
                btnSearch: System.Windows.Forms.Button;
                rbStuDorm: System.Windows.Forms.RadioButton;
                TabPage3: System.Windows.Forms.TabPage;
                BdpConnection1: Borland.Data.Provider.BdpConnection;
                Label2: System.Windows.Forms.Label;
                txtStuID: System.Windows.Forms.TextBox;
                Label3: System.Windows.Forms.Label;
                txtStuName: System.Windows.Forms.TextBox;
                Label5: System.Windows.Forms.Label;
                Label6: System.Windows.Forms.Label;
                Label7: System.Windows.Forms.Label;
                txtDorm: System.Windows.Forms.TextBox;
                GroupBox2: System.Windows.Forms.GroupBox;
                Label8: System.Windows.Forms.Label;
                dgCls: System.Windows.Forms.DataGrid;
                dgDep: System.Windows.Forms.DataGrid;
                Label9: System.Windows.Forms.Label;
                btnAdminSave: System.Windows.Forms.Button;
                daCls: Borland.Data.Provider.BdpDataAdapter;
                bdpSelectCommand1: Borland.Data.Provider.BdpCommand;
                bdpInsertCommand1: Borland.Data.Provider.BdpCommand;
                bdpUpdateCommand1: Borland.Data.Provider.BdpCommand;
                bdpDeleteCommand1: Borland.Data.Provider.BdpCommand;
                daDep: Borland.Data.Provider.BdpDataAdapter;
                bdpSelectCommand2: Borland.Data.Provider.BdpCommand;
                bdpInsertCommand2: Borland.Data.Provider.BdpCommand;
                bdpUpdateCommand2: Borland.Data.Provider.BdpCommand;
                bdpDeleteCommand2: Borland.Data.Provider.BdpCommand;
                dsAdmin1: dsAdminUnit.dsAdmin;
                dgtsDep: System.Windows.Forms.DataGridTableStyle;
                colDepID: System.Windows.Forms.DataGridTextBoxColumn;
                colDepName: System.Windows.Forms.DataGridTextBoxColumn;
                dgtsCls: System.Windows.Forms.DataGridTableStyle;
                colClsID: System.Windows.Forms.DataGridTextBoxColumn;
                colClsDepID: System.Windows.Forms.DataGridTextBoxColumn;
                colClsSubject: System.Windows.Forms.DataGridTextBoxColumn;
                daStu: Borland.Data.Provider.BdpDataAdapter;
                bdpSelectCommand3: Borland.Data.Provider.BdpCommand;
                bdpInsertCommand3: Borland.Data.Provider.BdpCommand;
                bdpUpdateCommand3: Borland.Data.Provider.BdpCommand;
                bdpDeleteCommand3: Borland.Data.Provider.BdpCommand;
                dsStu1: dsStuUnit.dsStu;
                dgtsStu: System.Windows.Forms.DataGridTableStyle;
                colStuID: System.Windows.Forms.DataGridTextBoxColumn;
                colStuName: System.Windows.Forms.DataGridTextBoxColumn;
                colStuBirth: System.Windows.Forms.DataGridTextBoxColumn;
                colStuClsID: System.Windows.Forms.DataGridTextBoxColumn;
                colStuDorm: System.Windows.Forms.DataGridTextBoxColumn;
                btnAdd: System.Windows.Forms.Button;
                btnDel: System.Windows.Forms.Button;
                btnStuSave: System.Windows.Forms.Button;
                btnFirst: System.Windows.Forms.Button;
                btnPrevious: System.Windows.Forms.Button;
                btnNext: System.Windows.Forms.Button;
                btnLast: System.Windows.Forms.Button;
                dtpBirth: System.Windows.Forms.DateTimePicker;
                btnViewAll: System.Windows.Forms.Button;
                txtClsID: System.Windows.Forms.TextBox;
                btnSelCls: System.Windows.Forms.Button;
                Label4: System.Windows.Forms.Label;
                txtDepName: System.Windows.Forms.TextBox;
                GroupBox3: System.Windows.Forms.GroupBox;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
                procedure btnAdminSave_Click(sender: System.Object; e: System.EventArgs);
                procedure frmMain_Load(sender: System.Object; e: System.EventArgs);
                procedure btnSearch_Click(sender: System.Object; e: System.EventArgs);
                procedure btnFirst_Click(sender: System.Object; e: System.EventArgs);
                procedure btnPrevious_Click(sender: System.Object; e: System.EventArgs);
                procedure btnNext_Click(sender: System.Object; e: System.EventArgs);
                procedure btnLast_Click(sender: System.Object; e: System.EventArgs);
                procedure BtnAdd_Click(sender: System.Object; e: System.EventArgs);
                procedure btnViewAll_Click(sender: System.Object; e: System.EventArgs);
                procedure btnStuSave_Click(sender: System.Object; e: System.EventArgs);
                procedure btnDel_Click(sender: System.Object; e: System.EventArgs);
                procedure txtClsID_TextChanged(sender: System.Object; e: System.EventArgs);
                procedure btnSelCls_Click(sender: System.Object; e: System.EventArgs);
                procedure dgStu_DoubleClick(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private Declarations }
    myBind:BindingManagerBase;
    procedure AdminSetRelation;
    procedure StuDataBinding;
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(frmMain))]

implementation

uses SelClass;

{$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>
procedure frmMain.InitializeComponent;
type
        TSystem_Windows_Forms_DataGridTableStyleArray = array of System.Windows.Forms.DataGridTableStyle;
        TSystem_Windows_Forms_DataGridColumnStyleArray = array of System.Windows.Forms.DataGridColumnStyle;
begin
        Self.TabControl1 := System.Windows.Forms.TabControl.Create;
        Self.TabPage1 := System.Windows.Forms.TabPage.Create;
        Self.btnViewAll := System.Windows.Forms.Button.Create;
        Self.btnSearch := System.Windows.Forms.Button.Create;
        Self.txtKey := System.Windows.Forms.TextBox.Create;
        Self.Label1 := System.Windows.Forms.Label.Create;
        Self.dgStu := System.Windows.Forms.DataGrid.Create;
        Self.dgtsStu := System.Windows.Forms.DataGridTableStyle.Create;
        Self.colStuID := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colStuName := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colStuBirth := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colStuClsID := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colStuDorm := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.GroupBox1 := System.Windows.Forms.GroupBox.Create;
        Self.rbStuDorm := System.Windows.Forms.RadioButton.Create;
        Self.rbStuName := System.Windows.Forms.RadioButton.Create;
        Self.rbStuID := System.Windows.Forms.RadioButton.Create;
        Self.TabPage2 := System.Windows.Forms.TabPage.Create;
        Self.GroupBox3 := System.Windows.Forms.GroupBox.Create;
        Self.txtDepName := System.Windows.Forms.TextBox.Create;
        Self.Label4 := System.Windows.Forms.Label.Create;
        Self.btnSelCls := System.Windows.Forms.Button.Create;
        Self.txtClsID := System.Windows.Forms.TextBox.Create;
        Self.dtpBirth := System.Windows.Forms.DateTimePicker.Create;
        Self.txtDorm := System.Windows.Forms.TextBox.Create;
        Self.Label7 := System.Windows.Forms.Label.Create;
        Self.Label6 := System.Windows.Forms.Label.Create;
        Self.Label5 := System.Windows.Forms.Label.Create;
        Self.txtStuName := System.Windows.Forms.TextBox.Create;
        Self.Label3 := System.Windows.Forms.Label.Create;
        Self.txtStuID := System.Windows.Forms.TextBox.Create;
        Self.Label2 := System.Windows.Forms.Label.Create;
        Self.GroupBox2 := System.Windows.Forms.GroupBox.Create;
        Self.btnLast := System.Windows.Forms.Button.Create;
        Self.btnNext := System.Windows.Forms.Button.Create;
        Self.btnPrevious := System.Windows.Forms.Button.Create;
        Self.btnFirst := System.Windows.Forms.Button.Create;
        Self.btnStuSave := System.Windows.Forms.Button.Create;
        Self.btnDel := System.Windows.Forms.Button.Create;
        Self.btnAdd := System.Windows.Forms.Button.Create;
        Self.TabPage3 := System.Windows.Forms.TabPage.Create;
        Self.btnAdminSave := System.Windows.Forms.Button.Create;
        Self.dgDep := System.Windows.Forms.DataGrid.Create;
        Self.dgtsDep := System.Windows.Forms.DataGridTableStyle.Create;
        Self.colDepID := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colDepName := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.Label9 := System.Windows.Forms.Label.Create;
        Self.dgCls := System.Windows.Forms.DataGrid.Create;
        Self.dgtsCls := System.Windows.Forms.DataGridTableStyle.Create;
        Self.colClsID := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colClsDepID := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.colClsSubject := System.Windows.Forms.DataGridTextBoxColumn.Create;
        Self.Label8 := System.Windows.Forms.Label.Create;
        Self.dsStu1 := dsStuUnit.dsStu.Create;
        Self.dsAdmin1 := dsAdminUnit.dsAdmin.Create;
        Self.BdpConnection1 := Borland.Data.Provider.BdpConnection.Create;
        Self.daCls := Borland.Data.Provider.BdpDataAdapter.Create;
        Self.bdpDeleteCommand1 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpInsertCommand1 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpSelectCommand1 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpUpdateCommand1 := Borland.Data.Provider.BdpCommand.Create;
        Self.daDep := Borland.Data.Provider.BdpDataAdapter.Create;
        Self.bdpDeleteCommand2 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpInsertCommand2 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpSelectCommand2 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpUpdateCommand2 := Borland.Data.Provider.BdpCommand.Create;
        Self.daStu := Borland.Data.Provider.BdpDataAdapter.Create;
        Self.bdpDeleteCommand3 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpInsertCommand3 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpSelectCommand3 := Borland.Data.Provider.BdpCommand.Create;
        Self.bdpUpdateCommand3 := Borland.Data.Provider.BdpCommand.Create;
        Self.TabControl1.SuspendLayout;
        Self.TabPage1.SuspendLayout;
        (System.ComponentModel.ISupportInitialize(Self.dgStu)).BeginInit;
        Self.GroupBox1.SuspendLayout;
        Self.TabPage2.SuspendLayout;
        Self.GroupBox3.SuspendLayout;
        Self.GroupBox2.SuspendLayout;
        Self.TabPage3.SuspendLayout;
        (System.ComponentModel.ISupportInitialize(Self.dgDep)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.dgCls)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.dsStu1)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.dsAdmin1)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.daCls)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.daDep)).BeginInit;
        (System.ComponentModel.ISupportInitialize(Self.daStu)).BeginInit;
        Self.SuspendLayout;
        // 
        // TabControl1
        // 
        Self.TabControl1.Controls.Add(Self.TabPage1);
        Self.TabControl1.Controls.Add(Self.TabPage2);
        Self.TabControl1.Controls.Add(Self.TabPage3);
        Self.TabControl1.Dock := System.Windows.Forms.DockStyle.Fill;
        Self.TabControl1.Location := System.Drawing.Point.Create(0, 0);
        Self.TabControl1.Name := 'TabControl1';
        Self.TabControl1.SelectedIndex := 0;
        Self.TabControl1.Size := System.Drawing.Size.Create(544, 389);
        Self.TabControl1.TabIndex := 0;
        // 
        // TabPage1
        // 
        Self.TabPage1.Controls.Add(Self.btnViewAll);
        Self.TabPage1.Controls.Add(Self.btnSearch);
        Self.TabPage1.Controls.Add(Self.txtKey);
        Self.TabPage1.Controls.Add(Self.Label1);
        Self.TabPage1.Controls.Add(Self.dgStu);
        Self.TabPage1.Controls.Add(Self.GroupBox1);
        Self.TabPage1.Location := System.Drawing.Point.Create(4, 21);
        Self.TabPage1.Name := 'TabPage1';
        Self.TabPage1.Size := System.Drawing.Size.Create(536, 364);
        Self.TabPage1.TabIndex := 0;
        Self.TabPage1.Text := '查找学生信息';
        // 
        // btnViewAll
        // 
        Self.btnViewAll.Location := System.Drawing.Point.Create(16, 256);
        Self.btnViewAll.Name := 'btnViewAll';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -