Delphi-Quellcode:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm2 =
class(TForm)
Splitter1: TSplitter;
Panel1: TPanel;
Panel2: TPanel;
procedure FormCreate(Sender: TObject);
private
procedure Splitter1DblClick(Sender: TObject);
public
{ Public-Deklarationen }
end;
TDblClickSplitter =
class(TSplitter);
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Splitter1DblClick(Sender: TObject);
begin
Panel1.Width := Round(Form2.Width / 2);
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
TDblClickSplitter(Splitter1).OnDblClick := Splitter1DblClick;
end;
D2007 keine Probleme bei OnCreate tut was es soll
Edit hab grad gemerkt das es auf die Größe der Panels ankommt ist eins davon sehr schmal dann hakt es