0
我编写了一个程序,用户可以使用它来绘制形状,将实际的按钮和其他工具放在窗体上并使其处于活动状态。不过,我注意到这种形式的TButton和设计模式中的TButton看起来有很大的不同。看看下面的图片。如何让TButton看起来像3d?
constructor TMakerButton.Create(r:TRect;form:TForm);
begin
inherited Create(r,form);
myType := totButton;
name := 'Button';
caption := 'Button';
lines := TStringList.Create;
lines.Clear;
button := TButton.Create(form);
button.Parent := form;
button.caption := string(caption);
button.Tag := LongInt(Self);
if form is TMakerFrm then
begin
button.Enabled := false;
end;
button.OnClick := ButtonClick;
button.OnMouseMove := ButtonMove;
myControl := button;
with bounds do
button.SetBounds(left,top,right-left,bottom-top);
end;
这是在设计模式中一个TButton在Delphi编译器。看看它是如何看起来像3D,其抛光玻璃的外观:
有趣的是,我的程序的按钮和Delphi编译器的基类是TButton的那么,为什么他们看起来如此不同,以及如何你让我的Button看起来一样吗?
您是否在项目选项中启用了运行时主题? –
@RemyLebeau我刚刚检查并启用。 – ThN