Codigo:
delphi
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls; type TForm1 = class(TForm) Panel1: TPanel; BitBtn1: TBitBtn; BitBtn2: TBitBtn; ColorDialog1: TColorDialog; BitBtn3: TBitBtn; procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.BitBtn1Click(Sender: TObject); begin ColorDialog1.Color:=Panel1.Color; if ColorDialog1.Execute then Panel1.Color:=ColorDialog1.Color; end; procedure TForm1.BitBtn2Click(Sender: TObject); begin Close; end; procedure TForm1.BitBtn3Click(Sender: TObject); begin ColorDialog1.Color:=Form1.Color; if ColorDialog1.Execute then Form1.Color:=ColorDialog1.Color; end; end.
Esto es para novatos y no me refiero a Caral "El ya tiene certificado" y es un gran Maestro.
Un Saludo.