谁有使用过这样的控件?(50分)

  • 主题发起人 czx_china
  • 开始时间
C

czx_china

Unregistered / Unconfirmed
GUEST, unregistred user!
像BUTTON一样,但是BUTTON上显示的是颜色,当点BUTTON就会出现个颜色选择对话框.
这种有没有现成的,或者该怎么做?
 
我发现,一般都是这样是实现的!
用一个edit,设置edit的color属性为颜色就行了,响应onclick!弹出
颜色选择对话框,delphi自带!
例:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Buttons, StdCtrls;
type
TForm2 = class(TForm)
ColorDialog1: TColorDialog;
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure Edit1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Edit1Click(Sender: TObject);
begin
if ColorDialog1.Execute() then
Edit1.Color:=ColorDialog1.Color;
end;
end.
 
不是这样的,你可以看看XP显示属性里桌面标签页里面有个颜色选择的组件
 
mmtools系列控件里有个叫TMMColorButton的,就是楼主想要的东西
 
不如自己写个Button
 
businessformSkin,
 
自己写个就是了 , 又花不了多少时间
 
同意 自己写,
 
RxLib控件包里有,你可以试试。
 
支持自己写,因为Delphi本身提供有颜色对话框
 
接受答案了.
 
顶部