刚用delphi,请各位多多帮忙。。。(在线等)
togy 2004-11-11 02:28:45 (1)用listbox选择图像的颜色,可存在的问题是假设我选择红色,接着在选择黄色,图像线段就是一段红色一段黄色,用什么方法在我后来选择黄色的时候可以把以前的图像线段也随之成为黄色???
(2)用combobox添加线段的时候,能不能所添加的线段和原来的线段同时显示,而不现在我假设选择2,那么1就不显示了。。。。。
部分程序如下:
procedure TForm1.Timer1Timer(Sender: TObject);
var
t:Longint;
a,c:integer;
begin
randomize;
j:=random(50);
a:=random(20);
c:=random(10);
case listbox1.ItemIndex of
0: s := clAqua ;
1: s := clblue ;
2: s := clFuchsia ;
3: s := clGreen ;
4: s := clMaroon;
5: s:=clYellow;
6: s := clPurple ;
end;
inc(totali);
case combobox1.ItemIndex of
0: series1.Add(j,'',s);
1: series2.Add(a);
2: series3.Add(b);
3: series4.Add(c);
end;
if (totali>40) then
begin
With Chart1 do
begin
BottomAxis.Maximum := totali;
BottomAxis.Minimum := totali-40;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
listbox1.ItemIndex:=3;
combobox1.ItemIndex:=0;
s:=clgreen;
totali:=0;
With Chart1 do
begin
AllowPanning := pmHorizontal;
BottomAxis.Automatic := False;
BottomAxis.Maximum := 40;
BottomAxis.Minimum := 0;
end;
Chart1.LeftAxis.Automatic:=false;
Chart1.LeftAxis.Maximum:=50;
Chart1.LeftAxis.Minimum:=0;
end;