📄 winform1.pas.~4~
字号:
unit WinForm1;
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
TWinForm2 = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
DataGrid1: System.Windows.Forms.DataGrid;
GroupBox2: System.Windows.Forms.GroupBox;
Button1: System.Windows.Forms.Button;
TextBox1: System.Windows.Forms.TextBox;
Label2: System.Windows.Forms.Label;
ComboBox1: System.Windows.Forms.ComboBox;
Label1: System.Windows.Forms.Label;
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;
DataGridTableStyle1: System.Windows.Forms.DataGridTableStyle;
Column1: System.Windows.Forms.DataGridTextBoxColumn;
Column2: System.Windows.Forms.DataGridTextBoxColumn;
Column3: System.Windows.Forms.DataGridTextBoxColumn;
Column4: System.Windows.Forms.DataGridTextBoxColumn;
Column5: System.Windows.Forms.DataGridTextBoxColumn;
Column6: System.Windows.Forms.DataGridTextBoxColumn;
dataSet1: System.Data.DataSet;
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;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure QueryBtn_Click(sender: System.Object; e: System.EventArgs);
procedure TWinForm2_Load(sender: System.Object; e: System.EventArgs);
procedure ComboBox1_SelectedIndexChanged(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 }
SearchField : String;
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(TWinForm2))]
implementation
{$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 TWinForm2.InitializeComponent;
type
TArrayOfSystem_Windows_Forms_DataGridTableStyle = array of System.Windows.Forms.DataGridTableStyle;
TArrayOfSystem_Data_DataTable = array of System.Data.DataTable;
TArrayOfSystem_Data_DataColumn = array of System.Data.DataColumn;
TArrayOfSystem_Data_Constraint = array of System.Data.Constraint;
TArrayOfString = array of string;
TArrayOfSystem_Windows_Forms_DataGridColumnStyle = array of System.Windows.Forms.DataGridColumnStyle;
TArrayOfSystem_Object = array of System.Object;
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.DataGridTableStyle1 := System.Windows.Forms.DataGridTableStyle.Create;
Self.Column1 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.Column2 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.Column3 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.Column4 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.Column5 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.Column6 := System.Windows.Forms.DataGridTextBoxColumn.Create;
Self.GroupBox2 := System.Windows.Forms.GroupBox.Create;
Self.Button1 := System.Windows.Forms.Button.Create;
Self.TextBox1 := System.Windows.Forms.TextBox.Create;
Self.Label2 := System.Windows.Forms.Label.Create;
Self.ComboBox1 := System.Windows.Forms.ComboBox.Create;
Self.Label1 := System.Windows.Forms.Label.Create;
Self.BdpConnection1 := Borland.Data.Provider.BdpConnection.Create;
Self.bdpSelectCommand1 := Borland.Data.Provider.BdpCommand.Create;
Self.bdpInsertCommand1 := Borland.Data.Provider.BdpCommand.Create;
Self.bdpUpdateCommand1 := Borland.Data.Provider.BdpCommand.Create;
Self.bdpDeleteCommand1 := Borland.Data.Provider.BdpCommand.Create;
Self.BdpDataAdapter1 := Borland.Data.Provider.BdpDataAdapter.Create;
(System.ComponentModel.ISupportInitialize(Self.DataGrid1)).BeginInit;
(System.ComponentModel.ISupportInitialize(Self.dataSet1)).BeginInit;
(System.ComponentModel.ISupportInitialize(Self.DataTable1)).BeginInit;
Self.GroupBox2.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, 63);
Self.DataGrid1.Name := 'DataGrid1';
Self.DataGrid1.Size := System.Drawing.Size.Create(413, 238);
Self.DataGrid1.TabIndex := 8;
Self.DataGrid1.TableStyles.AddRange(TArrayOfSystem_Windows_Forms_DataGridTableStyle.Create(Self.DataGridTableStyle1));
//
// 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.Constraints.AddRange(TArrayOfSystem_Data_Constraint.Create(System.Data.UniqueConstraint.Create('C' +
'onstraint1', TArrayOfString.Create('ID'), True)));
Self.DataTable1.PrimaryKey := TArrayOfSystem_Data_DataColumn.Create(Self.DataColumn4);
Self.DataTable1.TableName := 'Score';
//
// DataColumn1
//
Self.DataColumn1.ColumnName := 'Class';
Self.DataColumn1.MaxLength := 20;
//
// DataColumn2
//
Self.DataColumn2.ColumnName := 'CourseID';
Self.DataColumn2.MaxLength := 10;
//
// DataColumn3
//
Self.DataColumn3.ColumnName := 'CourseName';
Self.DataColumn3.MaxLength := 30;
//
// DataColumn4
//
Self.DataColumn4.AllowDBNull := False;
Self.DataColumn4.ColumnName := 'ID';
Self.DataColumn4.DataType := TypeOf(Integer);
//
// DataColumn5
//
Self.DataColumn5.ColumnName := 'Other';
Self.DataColumn5.MaxLength := 50;
//
// DataColumn6
//
Self.DataColumn6.ColumnName := 'Scores';
Self.DataColumn6.DataType := TypeOf(Integer);
//
// DataColumn7
//
Self.DataColumn7.ColumnName := 'StudentID';
Self.DataColumn7.MaxLength := 10;
//
// DataColumn8
//
Self.DataColumn8.ColumnName := 'StudentName';
Self.DataColumn8.MaxLength := 10;
//
// DataGridTableStyle1
//
Self.DataGridTableStyle1.DataGrid := Self.DataGrid1;
Self.DataGridTableStyle1.GridColumnStyles.AddRange(TArrayOfSystem_Windows_Forms_DataGridColumnStyle.Create(Self.Column1,
Self.Column2, Self.Column3, Self.Column4, Self.Column5, Self.Column6));
Self.DataGridTableStyle1.HeaderForeColor := System.Drawing.SystemColors.ControlText;
Self.DataGridTableStyle1.MappingName := 'Score';
//
// Column1
//
Self.Column1.Format := '';
Self.Column1.FormatInfo := nil;
Self.Column1.HeaderText := '学号';
Self.Column1.MappingName := 'StudentID';
Self.Column1.Width := 75;
//
// Column2
//
Self.Column2.Format := '';
Self.Column2.FormatInfo := nil;
Self.Column2.HeaderText := '姓名';
Self.Column2.MappingName := 'StudentName';
Self.Column2.Width := 75;
//
// Column3
//
Self.Column3.Format := '';
Self.Column3.FormatInfo := nil;
Self.Column3.HeaderText := '班级';
Self.Column3.MappingName := 'Class';
Self.Column3.Width := 75;
//
// Column4
//
Self.Column4.Format := '';
Self.Column4.FormatInfo := nil;
Self.Column4.HeaderText := '课程号';
Self.Column4.MappingName := 'CourseID';
Self.Column4.Width := 75;
//
// Column5
//
Self.Column5.Format := '';
Self.Column5.FormatInfo := nil;
Self.Column5.HeaderText := '课程名称';
Self.Column5.MappingName := 'CourseName';
Self.Column5.Width := 75;
//
// Column6
//
Self.Column6.Format := '';
Self.Column6.FormatInfo := nil;
Self.Column6.HeaderText := '成绩';
Self.Column6.MappingName := 'Scores';
Self.Column6.Width := 75;
//
// GroupBox2
//
Self.GroupBox2.Controls.Add(Self.Button1);
Self.GroupBox2.Controls.Add(Self.TextBox1);
Self.GroupBox2.Controls.Add(Self.Label2);
Self.GroupBox2.Controls.Add(Self.ComboBox1);
Self.GroupBox2.Controls.Add(Self.Label1);
Self.GroupBox2.Dock := System.Windows.Forms.DockStyle.Top;
Self.GroupBox2.Location := System.Drawing.Point.Create(0, 0);
Self.GroupBox2.Name := 'GroupBox2';
Self.GroupBox2.Size := System.Drawing.Size.Create(413, 52);
Self.GroupBox2.TabIndex := 9;
Self.GroupBox2.TabStop := False;
Self.GroupBox2.Text := '查询条件';
//
// Button1
//
Self.Button1.Location := System.Drawing.Point.Create(327, 22);
Self.Button1.Name := 'Button1';
Self.Button1.Size := System.Drawing.Size.Create(62, 22);
Self.Button1.TabIndex := 9;
Self.Button1.Text := '查询';
Include(Self.Button1.Click, Self.QueryBtn_Click);
//
// TextBox1
//
Self.TextBox1.Location := System.Drawing.Point.Create(229, 23);
Self.TextBox1.Name := 'TextBox1';
Self.TextBox1.Size := System.Drawing.Size.Create(83, 20);
Self.TextBox1.TabIndex := 8;
Self.TextBox1.Text := '';
//
// Label2
//
Self.Label2.Location := System.Drawing.Point.Create(187, 22);
Self.Label2.Name := 'Label2';
Self.Label2.Size := System.Drawing.Size.Create(44, 22);
Self.Label2.TabIndex := 7;
Self.Label2.Text := '查询值';
//
// ComboBox1
//
Self.ComboBox1.Items.AddRange(TArrayOfSystem_Object.Create('学号', '学生姓名', '班' +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -