⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statusbarex.pas

📁 中式财务栏 表格式录入 运行时设置可显示列、列名、列宽
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       扩展状态栏控件                                  }
{                                                       }
{       版权所有 (C) 2008 咏南工作室(陈新光)            }
{                                                       }
{*******************************************************}

{
在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

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

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

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -