delphi with do的用法Delphi With Do 在Delphi中,with关键字与do的用法主要是为了简化代码,减少重复输入。使用with可以指定一个代码块中的字段、属性和方法属于某个特定的对象或记录。 例如,下面的代码片段使用with关键字来简化对Button对象的访问: delphi var Button: TButton; begin But
with ..do 简化语句使用 访问对象的简化语句可以用with; 通常访问对象的属性和方法需要在前面加上对象的名称; 如: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 procedureTForm2.btn1Click(Sender: TObject);...
with do 的用法如:with edit1 do begin text :='hello';caption :='hello';end;可以省略edit1 for do是循环用 for i:=0 to 11 do begin ...end;
with类中的变量和外部变量如果重名,会将外部变量覆盖,这点需要注意!!!
var i:integer;begin SetLength(a,200);for i := 0 to 199 do begin with A[i] do begin TEdit.Create(self);Parent := self;AutoSize := False;Height := (ClientHeight-Button1.Height-20)div 10;Width := ClientWidth div 20;Top := (i div 20)*a[i].Height;Left := (i ...
with adoProc do begin ProcedureName := 'HOCRM_SCF1_Update'; Parameters.Clear; Parameters.CreateParameter('P1', ftstring, pdInput, 4000,thexml); // 用户输入参数 Parameters.CreateParameter('SCF01', ftstring, pdOutput, 20, scf01); // 存储过程返回参数 ...
with TMyCustomerDBGrid(Sender) do begin Cjts:=DataLink.Fields[5].AsString; sQjts:=DataLink.Fields[9].AsString; if sCjts<>‘‘ then //春季退书数量>0的用红色显示 Canvas.Brush.Color := clRed else if sQjts<>‘‘ then //秋季退书数量>0的用黄色显示 ...
Delphi中的ADOquery用法 都知道Delphi在数据库操作是非常好用的,delphi把ADO一些方法属性都集成了,以下是我的 一些总结: *** 通过sql的存储过程来实现: 添加 WithADOQuery1do begin Close; SQL.Clear; SQL.Add('InsertIntoTable1(Field1,Field2)') SQL.Add...
以上事件是一个死循环,所以永远看不到显示的内容;不知道楼上几位回答的时候有没看到?这段代码应该是放在ComboBox1dropdown事件中;因为你的ComboBox1.Clear; 和ComboBox1.Items.Add都在触发ComboBox1Change事件,所以程序不出现假死已经算好的了 ...