2017-06-02 118 views
0

我编写了一个程序,用户可以使用它来绘制形状,将实际的按钮和其他工具放在窗体上并使其处于活动状态。不过,我注意到这种形式的TButton和设计模式中的TButton看起来有很大的不同。看看下面的图片。如何让TButton看起来像3d?

这个按钮是从我的程序和右下面的图片是我这个窗体上创建按钮: enter image description here

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,其抛光玻璃的外观:

enter image description here

有趣的是,我的程序的按钮和Delphi编译器的基类是TButton的那么,为什么他们看起来如此不同,以及如何你让我的Button看起来一样吗?

+0

您是否在项目选项中启用了运行时主题? –

+0

@RemyLebeau我刚刚检查并启用。 – ThN

回答

5

该按钮被禁用。这些应该是不同外观的原因。

+2

真的! OMG ...所有这些年与德尔福合作,我都不知道....它的工作原理... – ThN

相关问题