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

📄 splitf.pas

📁 外国人写的各种类型的源代码,有兴趣的朋友看看吧!是学习的好东西哟
💻 PAS
字号:
unit SplitF;

interface

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

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    ListBox2: TListBox;
    ListBox3: TListBox;
    FontDialog1: TFontDialog;
    HeaderControl1: THeaderControl;
    procedure ListBoxDblClick(Sender: TObject);
    procedure HeaderControl1SectionResize(HeaderControl: THeaderControl;
      Section: THeaderSection);
    procedure FormResize(Sender: TObject);
    procedure HeaderControl1SectionClick(HeaderControl: THeaderControl;
      Section: THeaderSection);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ListBoxDblClick(Sender: TObject);
begin
  with Sender as TListbox do
  begin
    FontDialog1.Font := Font;
    if FontDialog1.Execute then
      Font := FontDialog1.Font;
  end;
end;

procedure TForm1.HeaderControl1SectionResize(HeaderControl: THeaderControl;
  Section: THeaderSection);
begin
  ListBox1.Width := HeaderControl1.Sections[0].Width;
  ListBox2.Left := ListBox1.Width;
  ListBox2.Width := HeaderControl1.Sections[1].Width;
  ListBox3.Left := ListBox2.Width + ListBox2.Left;
  ListBox3.Width := self.Width -
    HeaderControl1.Sections[0].Width -
    HeaderControl1.Sections[1].Width;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  ListBox2.Height := ListBox1.Height;
  ListBox3.Height := ListBox1.Height;
  HeaderControl1SectionResize(HeaderControl1,
    HeaderControl1.Sections [0]);
end;

procedure TForm1.HeaderControl1SectionClick(HeaderControl: THeaderControl;
  Section: THeaderSection);
begin
  if Section = HeaderControl1.Sections[0] then
    ListBox1.Sorted := True;
  if Section = HeaderControl1.Sections[1] then
    ListBox2.Sorted := True;
  if Section = HeaderControl1.Sections[2] then
    ListBox3.Sorted := True;
end;

end.

⌨️ 快捷键说明

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