色板+颜色字。。。

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值