var Form1:
TForm1; SelectedColor:TColor;//clBlack;
//Default implementation {$R *.dfm}
procedure TForm1.FormCreate(Sender:
TObject); begin SelectedColor:=clBlack; //Default end; //将这些控件全部选中然后使用双击
OnClick事件 //OnClick获得返回值 procedure TForm1.img11Click(Sender:
TObject); begin if TImage(Sender)=img1 then SelectedColor:=clBlack; if TImage(Sender)=img2 then SelectedColor:=$00002AA5; if TImage(Sender)=img3 then SelectedColor:=$00404000; if TImage(Sender)=img4 then SelectedColor:=$00005500; if TImage(Sender)=img5 then SelectedColor:=$005E0000; if TImage(Sender)=img6 then SelectedColor:=clNavy; if TImage(Sender)=img7 then SelectedColor:=$00993333; if TImage(Sender)=img8 then SelectedColor:=$00282828; if TImage(Sender)=img9 then SelectedColor:=$0000008B; if TImage(Sender)=img10
then SelectedColor:=$002068FF; if TImage(Sender)=img11
then SelectedColor:=$00008B8B; if TImage(Sender)=img12
then SelectedColor:=$00009300; if TImage(Sender)=img13
then SelectedColor:=$008E8E38; if TImage(Sender)=img14
then SelectedColor:=clBlue; if TImage(Sender)=img15
then SelectedColor:=$00996666; if TImage(Sender)=img16
then SelectedColor:=$00666666; if TImage(Sender)=img17
then SelectedColor:=clRed; if TImage(Sender)=img18
then SelectedColor:=$005BADFF; if TImage(Sender)=img19
then SelectedColor:=$0032CD32; if TImage(Sender)=img20
then SelectedColor:=$0071B33C; if TImage(Sender)=img21
then SelectedColor:=$00D4FF7F; if TImage(Sender)=img22
then SelectedColor:=$00FF6633; if TImage(Sender)=img23
then SelectedColor:=clPurple; if TImage(Sender)=img24
then SelectedColor:=$007F7F7F; if TImage(Sender)=img25
then SelectedColor:=clFuchsia; if TImage(Sender)=img26
then SelectedColor:=$0000D7FF; if TImage(Sender)=img27
then SelectedColor:=clYellow; if TImage(Sender)=img28
then SelectedColor:=clLime; if TImage(Sender)=img29
then SelectedColor:=$00D0E040; if TImage(Sender)=img30
then SelectedColor:=$00FFFFC0; if TImage(Sender)=img31
then SelectedColor:=$00663399; if TImage(Sender)=img32
then SelectedColor:=clSilver; if TImage(Sender)=img33
then SelectedColor:=$00CC99FF; if TImage(Sender)=img34
then SelectedColor:=$008CB4D2; if TImage(Sender)=img35
then SelectedColor:=$0099FFFF; if TImage(Sender)=img36
then SelectedColor:=$0098FB98; if TImage(Sender)=img37
then SelectedColor:=$00EEEEAF; if TImage(Sender)=img38
then SelectedColor:=$00FFCC00; if TImage(Sender)=img39
then SelectedColor:=$00FF99CC; if TImage(Sender)=img40
then SelectedColor:=clWhite;
请发表评论