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

📄 winform.pas.~2~

📁 《Delphi 2005程序设计及其应用开发》源代码
💻 ~2~
📖 第 1 页 / 共 2 页
字号:
unit WinForm;

interface

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

type
  TWinForm = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
    BdpConnection1: Borland.Data.Provider.BdpConnection;
    BdpDataAdapter1: Borland.Data.Provider.BdpDataAdapter;
    bdpSelectCommand1: Borland.Data.Provider.BdpCommand;
    bdpInsertCommand1: Borland.Data.Provider.BdpCommand;
    bdpUpdateCommand1: Borland.Data.Provider.BdpCommand;
    bdpDeleteCommand1: Borland.Data.Provider.BdpCommand;
    dataSet1: System.Data.DataSet;
    DataGrid1: System.Windows.Forms.DataGrid;
    Label3: System.Windows.Forms.Label;
    Label1: System.Windows.Forms.Label;
    Label2: System.Windows.Forms.Label;
    Panel1: System.Windows.Forms.Panel;
    TextBox1: System.Windows.Forms.TextBox;
    TextBox2: System.Windows.Forms.TextBox;
    TextBox3: System.Windows.Forms.TextBox;
    TextBox4: System.Windows.Forms.TextBox;
    Label4: System.Windows.Forms.Label;
    Label5: System.Windows.Forms.Label;
    Label6: System.Windows.Forms.Label;
    TextBox5: System.Windows.Forms.TextBox;
    TextBox6: System.Windows.Forms.TextBox;
    Button1: System.Windows.Forms.Button;
    Button2: System.Windows.Forms.Button;
    Button3: System.Windows.Forms.Button;
    DataTable1: System.Data.DataTable;
    DataColumn1: System.Data.DataColumn;
    DataColumn2: System.Data.DataColumn;
    DataColumn3: System.Data.DataColumn;
    DataColumn4: System.Data.DataColumn;
    DataColumn5: System.Data.DataColumn;
    DataColumn6: System.Data.DataColumn;
    DataColumn7: System.Data.DataColumn;
    DataColumn8: System.Data.DataColumn;
    Button4: System.Windows.Forms.Button;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
    procedure UpdateBtn_Click(sender: System.Object; e: System.EventArgs);
    procedure SelectBtn_Click(sender: System.Object; e: System.EventArgs);
    procedure DeleteBtn_Click(sender: System.Object; e: System.EventArgs);
    procedure InserBtn_Click(sender: System.Object; e: System.EventArgs);
    procedure TextBox1_TextChanged(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 }
  public
    constructor Create;
    Procedure UpdateDataSource(ChangedDataset: DataSet);
    Procedure UpdateDataSet();
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]

implementation
uses WinForm1;
var NewWinForm : TWinForm2;
{$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 TWinForm.InitializeComponent;
type
  TArrayOfSystem_Data_DataTable = array of System.Data.DataTable;
  TArrayOfSystem_Data_DataColumn = array of System.Data.DataColumn;
  TArrayOfSystem_Data_Common_DataTableMapping = array of System.Data.Common.DataTableMapping;
  TArrayOfSystem_Data_Common_DataColumnMapping = array of System.Data.Common.DataColumnMapping;
begin
  Self.DataGrid1 := System.Windows.Forms.DataGrid.Create;
  Self.dataSet1 := System.Data.DataSet.Create;
  Self.DataTable1 := System.Data.DataTable.Create;
  Self.DataColumn1 := System.Data.DataColumn.Create;
  Self.DataColumn2 := System.Data.DataColumn.Create;
  Self.DataColumn3 := System.Data.DataColumn.Create;
  Self.DataColumn4 := System.Data.DataColumn.Create;
  Self.DataColumn5 := System.Data.DataColumn.Create;
  Self.DataColumn6 := System.Data.DataColumn.Create;
  Self.DataColumn7 := System.Data.DataColumn.Create;
  Self.DataColumn8 := System.Data.DataColumn.Create;
  Self.Panel1 := System.Windows.Forms.Panel.Create;
  Self.Button4 := System.Windows.Forms.Button.Create;
  Self.Button3 := System.Windows.Forms.Button.Create;
  Self.Button2 := System.Windows.Forms.Button.Create;
  Self.Button1 := System.Windows.Forms.Button.Create;
  Self.TextBox6 := System.Windows.Forms.TextBox.Create;
  Self.TextBox5 := System.Windows.Forms.TextBox.Create;
  Self.Label6 := System.Windows.Forms.Label.Create;
  Self.Label5 := System.Windows.Forms.Label.Create;
  Self.Label4 := System.Windows.Forms.Label.Create;
  Self.TextBox4 := System.Windows.Forms.TextBox.Create;
  Self.TextBox3 := System.Windows.Forms.TextBox.Create;
  Self.TextBox2 := System.Windows.Forms.TextBox.Create;
  Self.TextBox1 := System.Windows.Forms.TextBox.Create;
  Self.Label3 := System.Windows.Forms.Label.Create;
  Self.Label2 := System.Windows.Forms.Label.Create;
  Self.Label1 := System.Windows.Forms.Label.Create;
  Self.BdpConnection1 := Borland.Data.Provider.BdpConnection.Create;
  Self.BdpDataAdapter1 := 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;
  (System.ComponentModel.ISupportInitialize(Self.DataGrid1)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.dataSet1)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.DataTable1)).BeginInit;
  Self.Panel1.SuspendLayout;
  (System.ComponentModel.ISupportInitialize(Self.BdpDataAdapter1)).BeginInit;
  Self.SuspendLayout;
  // 
  // DataGrid1
  // 
  Self.DataGrid1.DataMember := 'Score';
  Self.DataGrid1.DataSource := Self.dataSet1;
  Self.DataGrid1.Dock := System.Windows.Forms.DockStyle.Bottom;
  Self.DataGrid1.HeaderForeColor := System.Drawing.SystemColors.ControlText;
  Self.DataGrid1.Location := System.Drawing.Point.Create(0, 152);
  Self.DataGrid1.Name := 'DataGrid1';
  Self.DataGrid1.Size := System.Drawing.Size.Create(433, 305);
  Self.DataGrid1.TabIndex := 5;
  // 
  // dataSet1
  // 
  Self.dataSet1.DataSetName := 'NewDataSet';
  Self.dataSet1.Locale := System.Globalization.CultureInfo.Create('zh-CN');
  Self.dataSet1.Tables.AddRange(TArrayOfSystem_Data_DataTable.Create(Self.DataTable1));
  // 
  // DataTable1
  // 
  Self.DataTable1.Columns.AddRange(TArrayOfSystem_Data_DataColumn.Create(Self.DataColumn1, 
          Self.DataColumn2, Self.DataColumn3, Self.DataColumn4, Self.DataColumn5, 
          Self.DataColumn6, Self.DataColumn7, Self.DataColumn8));
  Self.DataTable1.TableName := 'Score';
  // 
  // DataColumn1
  // 
  Self.DataColumn1.ColumnName := 'ID';
  Self.DataColumn1.DataType := TypeOf(Integer);
  // 
  // DataColumn2
  // 
  Self.DataColumn2.ColumnName := 'StudentID';
  // 
  // DataColumn3
  // 
  Self.DataColumn3.ColumnName := 'StudentName';
  // 
  // DataColumn4
  // 
  Self.DataColumn4.ColumnName := 'Class';
  // 
  // DataColumn5
  // 
  Self.DataColumn5.ColumnName := 'CourseID';
  // 
  // DataColumn6
  // 
  Self.DataColumn6.ColumnName := 'CourseName';
  // 
  // DataColumn7
  // 
  Self.DataColumn7.ColumnName := 'Scores';
  Self.DataColumn7.DataType := TypeOf(Integer);
  // 
  // DataColumn8
  // 
  Self.DataColumn8.ColumnName := 'Other';
  // 
  // Panel1
  // 
  Self.Panel1.Controls.Add(Self.Button4);
  Self.Panel1.Controls.Add(Self.Button3);
  Self.Panel1.Controls.Add(Self.Button2);
  Self.Panel1.Controls.Add(Self.Button1);
  Self.Panel1.Controls.Add(Self.TextBox6);
  Self.Panel1.Controls.Add(Self.TextBox5);
  Self.Panel1.Controls.Add(Self.Label6);
  Self.Panel1.Controls.Add(Self.Label5);
  Self.Panel1.Controls.Add(Self.Label4);
  Self.Panel1.Controls.Add(Self.TextBox4);
  Self.Panel1.Controls.Add(Self.TextBox3);
  Self.Panel1.Controls.Add(Self.TextBox2);
  Self.Panel1.Controls.Add(Self.TextBox1);
  Self.Panel1.Controls.Add(Self.Label3);
  Self.Panel1.Controls.Add(Self.Label2);
  Self.Panel1.Controls.Add(Self.Label1);
  Self.Panel1.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel1.Location := System.Drawing.Point.Create(0, 0);
  Self.Panel1.Name := 'Panel1';
  Self.Panel1.Size := System.Drawing.Size.Create(433, 149);
  Self.Panel1.TabIndex := 9;
  // 
  // Button4
  // 
  Self.Button4.Location := System.Drawing.Point.Create(127, 111);
  Self.Button4.Name := 'Button4';
  Self.Button4.Size := System.Drawing.Size.Create(62, 22);
  Self.Button4.TabIndex := 24;
  Self.Button4.Text := '删除';
  Include(Self.Button4.Click, Self.DeleteBtn_Click);
  // 
  // Button3
  // 
  Self.Button3.Location := System.Drawing.Point.Create(320, 111);
  Self.Button3.Name := 'Button3';
  Self.Button3.Size := System.Drawing.Size.Create(62, 22);
  Self.Button3.TabIndex := 23;
  Self.Button3.Text := '查询';
  Include(Self.Button3.Click, Self.SelectBtn_Click);
  // 
  // Button2
  // 
  Self.Button2.Location := System.Drawing.Point.Create(227, 111);
  Self.Button2.Name := 'Button2';
  Self.Button2.Size := System.Drawing.Size.Create(62, 22);
  Self.Button2.TabIndex := 22;
  Self.Button2.Text := '更新';
  Include(Self.Button2.Click, Self.UpdateBtn_Click);
  // 
  // Button1
  // 
  Self.Button1.Location := System.Drawing.Point.Create(27, 111);
  Self.Button1.Name := 'Button1';
  Self.Button1.Size := System.Drawing.Size.Create(62, 22);
  Self.Button1.TabIndex := 21;
  Self.Button1.Text := '插入';
  Include(Self.Button1.Click, Self.InserBtn_Click);
  // 
  // TextBox6
  // 
  Self.TextBox6.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.Scores'));
  Self.TextBox6.Location := System.Drawing.Point.Create(267, 74);
  Self.TextBox6.Name := 'TextBox6';
  Self.TextBox6.Size := System.Drawing.Size.Create(83, 20);
  Self.TextBox6.TabIndex := 20;
  Self.TextBox6.Text := 'TextBox6';
  // 
  // TextBox5
  // 
  Self.TextBox5.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.CourseName'));
  Self.TextBox5.Location := System.Drawing.Point.Create(267, 45);
  Self.TextBox5.Name := 'TextBox5';
  Self.TextBox5.Size := System.Drawing.Size.Create(120, 20);
  Self.TextBox5.TabIndex := 19;
  Self.TextBox5.Text := 'TextBox5';
  // 
  // Label6
  // 
  Self.Label6.Location := System.Drawing.Point.Create(200, 74);
  Self.Label6.Name := 'Label6';
  Self.Label6.Size := System.Drawing.Size.Create(83, 22);
  Self.Label6.TabIndex := 18;
  Self.Label6.Text := '成绩';
  // 
  // Label5
  // 
  Self.Label5.Location := System.Drawing.Point.Create(200, 45);
  Self.Label5.Name := 'Label5';
  Self.Label5.Size := System.Drawing.Size.Create(83, 22);
  Self.Label5.TabIndex := 17;
  Self.Label5.Text := '课程名称';
  // 
  // Label4
  // 
  Self.Label4.Location := System.Drawing.Point.Create(200, 15);
  Self.Label4.Name := 'Label4';
  Self.Label4.Size := System.Drawing.Size.Create(67, 21);
  Self.Label4.TabIndex := 16;
  Self.Label4.Text := '课程号';
  // 
  // TextBox4
  // 
  Self.TextBox4.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.CourseID'));
  Self.TextBox4.Location := System.Drawing.Point.Create(267, 15);
  Self.TextBox4.Name := 'TextBox4';
  Self.TextBox4.Size := System.Drawing.Size.Create(83, 20);
  Self.TextBox4.TabIndex := 15;
  Self.TextBox4.Text := 'TextBox4';
  // 
  // TextBox3
  // 
  Self.TextBox3.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.Class'));
  Self.TextBox3.Location := System.Drawing.Point.Create(67, 74);
  Self.TextBox3.Name := 'TextBox3';
  Self.TextBox3.Size := System.Drawing.Size.Create(83, 20);
  Self.TextBox3.TabIndex := 14;
  Self.TextBox3.Text := 'TextBox3';
  // 
  // TextBox2
  // 
  Self.TextBox2.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.StudentName'));
  Self.TextBox2.Location := System.Drawing.Point.Create(67, 45);
  Self.TextBox2.Name := 'TextBox2';
  Self.TextBox2.Size := System.Drawing.Size.Create(83, 20);
  Self.TextBox2.TabIndex := 13;
  Self.TextBox2.Text := 'TextBox2';
  // 
  // TextBox1
  // 
  Self.TextBox1.DataBindings.Add(System.Windows.Forms.Binding.Create('Text', 
        Self.dataSet1, 'Score.StudentID'));
  Self.TextBox1.Location := System.Drawing.Point.Create(67, 15);
  Self.TextBox1.Name := 'TextBox1';
  Self.TextBox1.Size := System.Drawing.Size.Create(83, 20);
  Self.TextBox1.TabIndex := 12;
  Self.TextBox1.Text := 'TextBox1';
  Include(Self.TextBox1.TextChanged, Self.TextBox1_TextChanged);
  // 
  // Label3
  // 

⌨️ 快捷键说明

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