Hallo,
ich würde es so versuchen:
Delphi-Quellcode:
procedure TDemoFrom.FormCreate(Sender: TObject);
var
page: TJvOutlookBarPage;
button: TJvOutlookBarButton;
begin
with Query do
begin
SQL.Text := '
SELECT ID, JAHR, NAME FROM JN ORDER BY JAHR, NAME';
Open;
page :=
nil;
while not Eof
do
begin
if not Assigned(page)
or not SameText(page.Caption, FieldByName('
JAHR').AsString)
then
begin
page := OutlookBar.Pages.Add;
page.Caption := FieldByName('
JAHR').Text;
end;
with page.Buttons.Add
do
begin
Caption := FieldByName('
NAME').Text;
// Tag := FieldByName('ID').AsInteger;
end;
Next;
end;
Close;
end;
end;
Grüße vom marabu