当前位置:编程学习 > Delphi >>

Delphi求帮编程

声明一个水果类TFruit ,私有成员为Fname(水果名,string类型),Fcolor(颜色,Tcolor类型),Ftaste(味道,Ttaste类型),公共属性为color,从Fcolor里获取属性值,通过Setcolor方法设置属性值,默认值为white,公共方法有Infor过程,没有参数。

答案:
1、假设Table_T1已打开,如果没有的话请加上 
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;
   Type
       TFruit=Class
       private
         FName:string;
         FColor: Tcolor;
         FTaste: Ttaste;
       public
         property  Color: string read  FColor write SetColor default ‘white’;
         procedure    Infor;
       end;

上一个:delphi出现错误问题
下一个:delphi树的使用

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,