Delphi 2009 之 TCategoryPanelGroup[5]: HeaderStyle


本文整理自网络,侵删。

 
本例效果图:



代码文件:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    CategoryPanelGroup1: TCategoryPanelGroup;
    CategoryPanel1: TCategoryPanel;
    CategoryPanel2: TCategoryPanel;
    CategoryPanel3: TCategoryPanel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  CategoryPanel1.Height := ClientHeight div 2;
  CategoryPanel2.Height := CategoryPanel1.Height;
  CategoryPanel3.Height := CategoryPanel1.Height;

  CategoryPanel1.Caption := 'CPanel1';
  CategoryPanel2.Caption := 'CPanel2';
  CategoryPanel3.Caption := 'CPanel3';

  Button1.Caption := 'HeaderStyle := hsGradient';
  Button2.Caption := 'HeaderStyle := hsImage';
  Button3.Caption := 'HeaderStyle := hsThemed';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  CategoryPanelGroup1.HeaderStyle := hsGradient;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  CategoryPanelGroup1.HeaderImage.LoadFromFile('c:\temp\hbg.bmp');
  CategoryPanelGroup1.HeaderStyle := hsImage;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  CategoryPanelGroup1.HeaderStyle := hsThemed;
end;

end.

相关阅读 >>

Delphi unicode转中文编码

Delphi xe 获取硬盘id序列号

Delphi indy 10.5.7的数据发送接收的用法

Delphi xe 横屏竖屏的管理

Delphi过程函数传递参数的八种方式

Delphi显示gif动画简单方法

win32全局钩子在Delphi下实现的关键技术

Delphi 几个实用的html解析函数

Delphi写进程管理器

Delphi 如何使用程序标识符检查程序是否已安装

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...