Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Coolbar Band hinzufügen (https://www.delphipraxis.net/107232-coolbar-band-hinzufuegen.html)

fLaSh11 25. Jan 2008 12:30

Re: Coolbar Band hinzufügen
 
Ja, erst erstellen, dann drauf zugreifen.

Larsi 25. Jan 2008 13:09

Re: Coolbar Band hinzufügen
 
ich bekomms immernoch nicht hin :(
bin echt bald am durchdrehen :(

Delphi-Quellcode:
coolbar1.bands.add;
CoolBar1.Bands['irgendne integer zahl hab aber keine ahnnung wie ich das machen kann dass da immer ne andere drin steht!'].caption := edit1.text;
so geht nicht!
MFG Lars Wiltfang

DeddyH 25. Jan 2008 13:11

Re: Coolbar Band hinzufügen
 
Hast Du Dir mal Count angesehen?

Larsi 25. Jan 2008 13:32

Re: Coolbar Band hinzufügen
 
ja aber damit habe ich ncihts richtiges himbekommen kannste mir da mal n beispiel für geben (code???). Wäre darüber sehr sehr sehr dankbar :)

DeddyH 25. Jan 2008 13:36

Re: Coolbar Band hinzufügen
 
Und ich wäre Dir sehr dankbar, wenn Du mal ab und zu die OH bemühen würdest :stupid: . Aber ich will mal nicht so sein. Das "letzte" Band müsste sein
Delphi-Quellcode:
CoolBar1.Bands[Pred(CoolBar1.Bands.Count)]

Reinhold 25. Jan 2008 13:39

Re: Coolbar Band hinzufügen
 
Hallo Larsi,

in der Hilfe von Delphi2007 habe ich folgenden Code gefunden.

Delphi-Quellcode:
{
To run this example, add the example code to a new project.
The example code dynamically creates a TCoolBar and three
TCoolBand objects populated with a windowed control in each
TCoolBand.
}
procedure AddBand(CoolBar: TCoolBar; Const ControlClasses: array of TControlClass);
var
  CurrentControl: TControl;
  I: Integer;
begin
  for I := 0 to High(ControlClasses) do
    begin
      CurrentControl := ControlClasses[i].Create(CoolBar);
      if (CurrentControl is TWinControl) then
      begin
        { Placing the control onto the CoolBar causes the TCoolBar object to create a TCoolBand and place the control within the band. }
        CurrentControl.Parent := Coolbar;
        { Get the reference of the last TCoolBand created and assign text. }
        with CoolBar.Bands do
          Items[count - 1].Text := CurrentControl.ClassName;
      end;
    end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  CoolBar: TCoolBar;
begin
  CoolBar := TCoolBar.Create(Self);
  CoolBar.Parent := Self;
  CoolBar.Align := alClient;
  AddBand(CoolBar, [TCheckBox, TEdit, TButton]);
end;
Vielleicht hilft er dir weiter.

gruß Reinhold


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:29 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz