包含图形、动画、进度条等等的状态栏

 

{
在Delphi中,一个控件上能否成为其它控件的父控件取决于此控件的ControlStyle属性。
ControlStyle属性是集合类型的,如果此集合包含csAcceptsControls元素,
则它能接受其它控件;否则,它就不能成为其它控件的父控件。
ControlStyle属性只能在控件的构造函数(Constructor)中指定,
在程序运行时它是不能被改变的。所以如果希望窗口状态条上面能包含其它控件,
我们只需要在继承类中重载TStatusBar控件的Constructor函数,
并且让控件的集合属性ControlStyle中包含csAcceptsControls即可。
}

unit StatusBarEx;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics,
 Controls, Forms, Dialogs, ComCtrls;

type
 TStatusBarEx = class(TStatusBar)
 public
   constructor Create(AOwner: TComponent); override;
 end;

procedure Register;

implementation

constructor TStatusBarEx.Create(AOwner: TComponent);
begin
 inherited Create(AOwner);
 {为了让TStatusBarEx控件能接受其它控件,必须
 使ControlStyle属性(集合类型)包含csAcceptsControls元素}
 ControlStyle:= ControlStyle + [csAcceptsControls];
end;

procedure Register;
begin
 RegisterComponents('Win32', [TStatusBarEx]);
end;

end.

转载于:https://www.cnblogs.com/piaoliuxia/archive/2008/09/07/1937307.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值