unit yanseU;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
ScrollBar1: TScrollBar;
ScrollBar2: TScrollBar;
ScrollBar3: TScrollBar;
TrackBar1: TTrackBar;
Panel1: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label9: TLabel;
BitBtn3: TBitBtn;
procedure ScrollBar1Change(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
procedure ScrollBar3Change(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
s1:array [1..1000] of integer;
s2:array[1..1000]of integer;
s3:array [1..1000] of integer;
i,j,k:integer;
end;
var
Form1: TForm1;
{s1:array [1..1000] of integer;
s2:array[1..1000]of integer;
s3:array [1..1000] of integer;
i,j,k:integer;}
implementation
{$R *.dfm}
procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
label5.Caption:=inttostr(scrollbar1.position);
panel1.Color:=RGB(scrollbar1.position,scrollbar2.position,scrollbar3.position);
panel1.font.Color:=RGB((255-scrollbar1.position),(255-scrollbar2.position),(255-scrollbar3.position));
end;
procedure TForm1.ScrollBar2Change(Sender: TObject);
begin
label6.Caption:=inttostr(scrollbar2.position);
panel1.Color:=RGB(scrollbar1.position,scrollbar2.position,scrollbar3.position);
panel1.font.Color:=RGB((255-scrollbar1.position),(255-scrollbar2.position),(255-scrollbar3.position));
end;
procedure TForm1.ScrollBar3Change(Sender: TObject);
begin
label7.Caption:=inttostr(scrollbar3.position);
panel1.Color:=RGB(scrollbar1.position,scrollbar2.position,scrollbar3.position);
panel1.font.Color:=RGB((255-scrollbar1.position),(255-scrollbar2.position),(255-scrollbar3.position));
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
label8.Caption:=inttostr(trackbar1.position);
scrollbar1.LargeChange:=trackbar1.position;
scrollbar2.LargeChange:=trackbar1.position;
scrollbar3.LargeChange:=trackbar1.position;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if (i=100) or (j=100) or (k=100) then
begin
application.MessageBox('已到达记录最大值','提示:',0);
i:=1;j:=1;k:=1;
end
else
begin
i:=i+1;j:=j+1;k:=k+1;
label9.font.color:=RGB(scrollbar1.position,scrollbar2.position,scrollbar3.position);
s1[i]:=scrollbar1.position ;
s2[j]:=scrollbar2.position ;
s3[k]:=scrollbar3.position;
end;
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
if i=1 then
application.MessageBox('这个已经是第一次的颜色了喔','提示:',0)
else
begin
i:=i-1;j:=j-1;k:=k-1;
label9.font.color:=RGB(s1[i],s2[j],s3[k]);
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
i:=0;j:=0;k:=0;
end;
end.