Autor Beitrag
Asgar
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Do 19.05.05 09:22 
Hi, mein Problem ist folgendes:
in meinem programm wird eine Group Box zur Laufzeit erstellt, darin sollen dann Listboxne seien und labels, Die Listboxen zeigt er an, aber die Labels verschwinden irgendwie hinter der GroupBox.
Wie kann ich das ändern?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 19.05.05 09:23 
Labelx.BringToFront
bzw.
GroupBox1.SendToBack

edit:
Aber ich vermute mal, dass die Parent-Eigenschaft der Labels nicht richtig gesetzt ist, und die Labels daher direkt im Formular erzeugt werden und nicht in der GroupBox, ich gehe mal davon aus, dass du das gemeint hast.
Weshalb das falsch läuft, kann ich ohne Source natürlich nicht beantworten...


Zuletzt bearbeitet von jaenicke am Do 19.05.05 09:36, insgesamt 6-mal bearbeitet
Asgar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Do 19.05.05 09:25 
beide Befehle helfen nicht, wenn ich dir group box in den hintergrund lege verdeckt sie immer noch die labels, das gleiche passiert wenn ich die labels in den Vordergrund setze
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 19.05.05 09:26 
Siehe Edit, wie sieht der Source zum Erstellen aus?
Asgar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Do 19.05.05 09:27 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
with TLabel.create(pagecontrol4)do
begin
 parent:=(pagecontrol4.pages[a]);
 SetBounds(500,30,40,10);
 caption:='vorhanden';

end;
Asgar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Do 19.05.05 09:31 
aber wenn ich als parent die groupbox nehme geht es immernoch nicht
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 19.05.05 09:32 
Wie stehts mit TLabel.Create(GroupBoxx)?
Asgar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Do 19.05.05 09:41 
hab ich schon probiert. die labels sind immernoch im Hintergrund.
Aber komischerweise immer nur die labels, die List Boxen werden genauso erstellt und werden nicht verdeckt
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 21.05.05 10:13 
Bei mir funktionierts mit folgendem Code...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var GroupBox1: TGroupBox;
    Anzeige: TLabel;

...

GroupBox1:= TGroupBox.Create(Form1);
GroupBox1.Parent := Form1;
GroupBox1.SetBounds(20,20,500,500);
GroupBox1.Caption := 'Hier kommt das Label rein';

Anzeige:= TLabel.Create(GroupBox1);
ANzeige.Parent := GroupBox1;
Anzeige.SetBounds(50,50,10,10);
Anzeige.Caption := 'Siehst du mich?';



EDIT: Aber auch nur mit diesem, genau mit diesem.
Asgar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Mo 23.05.05 08:25 
naja, eure codes gehen bei mir, aber nicht wenn ich sie in meinem programm ausprobiere. is auch egal, hab ne andere Lösung gefunden
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Do 22.09.05 16:13 
Wäre interessant zu Erfahren, was hier die Lösung war....
Habe ein ähnliches (um nicht zu sagen das gleiche) Problem.
Ich will ein Label über einer Progressbar darstellen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TfrmAWLEdit.ShowProgressAcitivity(s: string);
begin
  lbDoInfo.Parent := ProgressBar;
  lbDoInfo.Width := lbDoInfo.Canvas.TextWidth(s);
  lbDoInfo.Left := ProgressBar.Left + (ProgressBar.Width - lbDoInfo.Width) div 2;
  lbDoInfo.Top := ProgressBar.Top + (ProgressBar.Height - lbDoInfo.Height) div 2;
  lbDoInfo.Caption := s;
  ProgressBar.SendToBack();
  lbDoInfo.BringToFront();
  lbDoInfo.Show();
end;


Aber ich bringe das Label einfach nicht in den Vordergrund!!

StaticText dagegen lässt sich in den Vordergrund bringen, der hat jedoch nicht die Transparenzeigenschaft und auch keinen Canvas....
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 24.09.05 15:33 
Eine Progressbar kann (Graphisch) kein Label enthalten.

Ich würde beides in ein TPanel (ohne Rand und Caption) packen.

Wenn du allerdings, wie ich vermute, eine Prozentanzeige in der Mitte der ProgressBar haben willst, empfehle ich die Komponente TGauge (Registerkarte "Samples").

_________________
Das Leben auf der Erde mag zwar teuer sein, aber eine jährliche Rundreise um die Sonne ist gratis mit dabei.
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Sa 24.09.05 17:52 
Wieso sollte man kein Label über eine ProgressBar legen können?
Es sind ja zwei getrennte Komponenten, die so eigentlich nichts miteinander zu tun haben, nur dass es anscheinend nicht möglich ist, das Label in den Vordergrund zu bringen.

Hab das Problem aber mittlerweile anders gelöst:
Ich habe mir eine eigene Komponente von TProgressBar abgeleitet, diese um Caption und Font erweitert, und die WMPain Methode überschrieben, in welcher ich den Text/Caption auf die ProgressBar zeichne...
Das ganze nennt sich dann TLabledProgressBar :-)