Registriert seit: 5. Feb 2010
Ort: Bad Kissingen
293 Beiträge
Delphi XE Architect
|
AW: Eigene Komponente (Toolbar) programmieren
7. Mär 2011, 13:27
mein aktueller Stand:
Delphi-Quellcode:
unit Testtoolbar2;
interface
uses
SysUtils, Classes, Controls, ToolWin, ComCtrls;
type TTestBars = set of (Standard1, Standard2, Standard3, Standard4, Standard5);
type
TTestToolbar = class(TToolBar)
public
constructor create(aOwner: TComponent); override;
//Bars: TTestBars;
//Buttons: TToolButton;
{ Private-Deklarationen }
private
Button : TToolbutton;
end;
procedure Register;
implementation
constructor TTestToolbar.Create;
var
iButtons: Integer;
begin
inherited Create(aOwner);
TRY
for iButtons := 0 to 9 do
Button := TToolbutton.Create(self);
Button.Caption := ' Button'+IntToStr(iButtons+1);
Button.Parent := TTestToolbar;
Button.Show;
EXCEPT
Button.Free;
END;
end;
{
destructor TTestToolbar.
begin
if Button <> nil then
begin
Button.Free;
Button := nil;
end;
inherited Destroy;
end;
}
procedure Register;
begin
RegisterComponents(' ZTestKomponenten', [TTestToolbar]);
end;
end.
Fehler: Inkompatible Typen : "TWinControl" und "Class Reference"
|
|
Zitat
|