Autor Beitrag
willy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Di 16.05.06 12:06 
Hallo,
ich habe mit einem kleinen Script ComboBoxen erstellt

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
 for a:=1 to 10 do
begin
 art[a] := TComboBox.create(self);
 art[a].Parent := form1;
 art[a].Show;
 art[a].Top := a * 30 + 20;
 art[a].Left := 824;
 art[a].Items.Add('true');
 art[a].Items.Add('false');
 art[a].ItemIndex := 1;
end;


Mein Problem ist nun, wenn ich das Script starte sind alle Combos auf Focus gesetzt und das kann ich weder beheben durch enable noch durch zB Edit1.SetFocus...der Focus bleibt
is zwar kein Beinbruch finde nur das sieht etwas komisch aus, wenn ich (in meinem Fall) 40 ComboBoxen selectiert hab.

Vielen Dank für die Hilfe...
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Di 16.05.06 12:20 
Sicher das das durch den Fokus kommt? Wenn du mit Themes/Styles arbeitest, kommt es vielleicht auch daher. Bei mir hatte ich durch Styles schon die komischsten Effekte. Weil eigentlich kann der Fokus nur einem Control gegeben werden.... :gruebel:

Vielleicht wäre ein ValueListEditor Komponente auch passender?
Christian R.
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 16.05.06 15:58 
Ich habe es ausprobiert, war kein Problem. Benutze zwar keine Themes, aber vielleicht hat digi_c recht.
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Di 16.05.06 22:41 
im anhang sieht man was da passiert...bin echt verzweifelt :/
Einloggen, um Attachments anzusehen!
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 16.05.06 22:44 
user profile iconwilly hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
 for a:=1 to 10 do
begin
 art[a] := TComboBox.create(self);
 art[a].Parent := form1;
 art[a].Show;
 art[a].Top := a * 30 + 20;
 art[a].Left := 824;
 art[a].Items.Add('true');
 art[a].Items.Add('false');
 art[a].ItemIndex := 1;
end;


Lass die markierte Zeile mal weg. Eine Komponente ist standardmäßig mit visible = true gesetzt. Ergo musst du sie nicht mehr extra anzeigen. Das wär meine Vermutung woher das kommt

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Di 16.05.06 23:02 
habsch probiert....gleiches problem :(

aber thx für den tipp spar ich zeilen :)
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 17.05.06 07:14 
Bau mal noch Style:=csDropDownList und evtl ItemIndex:=0 ein.
willy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

WinXP Pro (SP2), Suse9.3 Pro, Debian6

BeitragVerfasst: Mi 17.05.06 10:35 
jup funzt 1000 danke ;)