Delphi求帮编程
声明一个水果类TFruit ,私有成员为Fname(水果名,string类型),Fcolor(颜色,Tcolor类型),Ftaste(味道,Ttaste类型),公共属性为color,从Fcolor里获取属性值,通过Setcolor方法设置属性值,默认值为white,公共方法有Infor过程,没有参数。
声明一个水果类TFruit ,私有成员为Fname(水果名,string类型),Fcolor(颜色,Tcolor类型),Ftaste(味道,Ttaste类型),公共属性为color,从Fcolor里获取属性值,通过Setcolor方法设置属性值,默认值为white,公共方法有Infor过程,没有参数。
答案:1、假设Table_T1已打开,如果没有的话请加上Type
Table_T1.open;
With Table_T1,treeView1 do
begin
first;
while not eof do
begin
Items.Add(nil,Fieldbyname('T102').AsString);
Next;
end;
end;
2、if FontDialog1.Execute then
With RichEdit1.SelAttributes do
begin
Size:=FontDialog1.Font.Size;
Name:=FontDialog1.Font.Name;
Color:=FontDialog1.Font.Color;
Style:=FontDialog1.Font.style;
end;
3、
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
if strtointDef(Edit1.text,0)<StrtointDef(Edit2.text,0) then
begin
for i:=strtointDef(Edit1.text,0) to StrtointDef(Edit2.text,0) do
begin
if i mod 3=0 then Memo1.Lines.Add(Inttostr(i));
end;
end;
end;
TFruit=Class
private
FName:string;
FColor: Tcolor;
FTaste: Ttaste;
public
property Color: string read FColor write SetColor default ‘white’;
procedure Infor;
end;
上一个:delphi出现错误问题
下一个:delphi树的使用