刚用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;

...全文
115 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iamduo 2004-11-16
  • 打赏
  • 举报
回复
动态数组纪录每个点的X,Y
togy 2004-11-12
  • 打赏
  • 举报
回复
有人知道吗?
  • 打赏
  • 举报
回复
学习
togy 2004-11-11
  • 打赏
  • 举报
回复
没有呀,我是用listbox控制图像的颜色,不是他本身的颜色。可以控制,问题是怎么选择下一个颜色的时候把以前的图像线段也随改成现在的颜色。
lian587 2004-11-11
  • 打赏
  • 举报
回复
楼主搞错了吧?listbox1是无法在运行时用手动的办法选择里面的值的,是不是应该换成combobox1啊?
togy 2004-11-11
  • 打赏
  • 举报
回复
怎么没人帮忙呢?很难嘛????

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧