怎样能把button画成圆形外观? 怎样能把button画成圆形外观?谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TButtonTest = class(TGraphicControl)public constructor Create(aOwner: TComponent); override;protected procedure Paint; override;end;constructor TButtonTest.Create(aOwner: TComponent);begin inherited; Height:=50; Width:=100;end;procedure TButtonTest.Paint;begin inherited; Canvas.Brush.Style:=bsClear; Canvas.Pen.Color:=clBlue; Canvas.Brush.Color:=clGreen; Canvas.RoundRect(0,0,Width,Height,8,8);//圆角矩形 Canvas.Ellipse(0,0,Width,Height);//椭圆end;var Btn:TButtonTest;Btn:=TButtonTest.Create(self);Btn.Parent:=Self; 椭圆形按钮:type TRbutton=class(TButton)private .......protected procedure CreateWnd;override; ........ ........procedure TRbutton.CreateWnd;//在控件一建立就设置var hRgn :THandle;begin inherited CreateWnd; hRgn:=CreateEllipticRgn(0,0,Width,Height);//创建一个椭圆剪裁域; SetWindowRgn(Handle,hRgn,True);end; 如何调试delphi帮助中提供的DefianeProperties的例子? 有关获取窗口座标的问题 源代码编辑器的问题?? 怎样得到CPU的序列号? 'like'查找匹配字符串的问题 关于editmask(时间)设置 有关SQL语句中返回值,谢谢大家帮忙! 急!急 如何在Delphi5中自动进入Excel,且打开指定Excel文件名。 加进度条? 条形码的问题? 请问为什么在调用DLL文件是会出错? goomoo(古木) 來來拿分
TButtonTest = class(TGraphicControl)
public
constructor Create(aOwner: TComponent); override;
protected
procedure Paint; override;
end;constructor TButtonTest.Create(aOwner: TComponent);
begin
inherited;
Height:=50;
Width:=100;
end;procedure TButtonTest.Paint;
begin
inherited;
Canvas.Brush.Style:=bsClear;
Canvas.Pen.Color:=clBlue;
Canvas.Brush.Color:=clGreen;
Canvas.RoundRect(0,0,Width,Height,8,8);//圆角矩形
Canvas.Ellipse(0,0,Width,Height);//椭圆
end;var Btn:TButtonTest;Btn:=TButtonTest.Create(self);
Btn.Parent:=Self;
椭圆形按钮:
type
TRbutton=class(TButton)
private
.......
protected
procedure CreateWnd;override;
........
........
procedure TRbutton.CreateWnd;//在控件一建立就设置
var
hRgn :THandle;
begin
inherited CreateWnd;
hRgn:=CreateEllipticRgn(0,0,Width,Height);//创建一个椭圆剪裁域;
SetWindowRgn(Handle,hRgn,True);
end;