新建一个Unit,将下面的代码全部拷贝进去,保存为MultiLinePaletteExpert.pas文件,
新建一个Package,Add刚刚保存的MultiLinePaletteExpert.pas文件,编译、安装。
想卸载该Package,在Delphi菜单项选择Component/Install Pacgage,找到我们的bpl,
remove它就可以了,
//一下为Unit源文件
unit MultiLinePaletteExpert;
interface
uses
Forms, Controls, ComCtrls;
implementation
type
TMultiLinePalette = class
public
procedure ResizeComponentPalette(Sender : TObject);
end;
var
MultiLinePalette : TMultiLinePalette;
procedure TMultiLinePalette.ResizeComponentPalette(Sender : TObject);
var
AHeight : integer;
begin
with (Sender as TTabControl) do begin
AHeight := Height + DisplayRect.Top - DisplayRect.Bottom + 29;
Constraints.MinHeight := AHeight;
Parent.Constraints.MaxHeight := AHeight;
end;
end;{ResizeMultiLineComponentPalette}
procedure SetMultiLineComponentPalette(MultiLine : boolean);
var
AppBuilder : TForm;
TabControl : TTabControl;
begin
AppBuilder := TForm(Application.FindComponent('AppBuilder'));
if (AppBuilder <> nil) then
begin
TabControl := TTabControl(AppBuilder.FindComponent('TabControl'));
if (TabControl <> nil) then
begin
TabControl.MultiLine := MultiLine;
if MultiLine then
TabControl.OnResize := MultiLinePalette.ResizeComponentPalette
else
TabControl.OnResize := nil;
end;
end;
end; {SetMultiLineComponentPalette}
initialization
MultiLinePalette := TMultiLinePalette.Create;
SetMultiLineComponentPalette(true);
finalization
SetMultiLineComponentPalette(false);
MultiLinePalette.Free;
end.