Autor Beitrag
BlackPhantom
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: Di 13.05.03 19:05 
Hi@all

Ich habe folgendes Problem:
Ich habe drei Combos (A,B und C). In A sind drei Items (0A,1A,2A). Klicke ich auf eins der drei Items wird Combo (B) sichtbar. Wähle ich in der Combo(B) ein Item aus erscheint eine zweite Form.
Wenn ich jedoch mich umentscheide und ein Item aus der Combo (C) auswähle, soll der TExt in Combo (B) leer sein. Und das ist mein Problem.

PS: Ich habe einen Code zum Ändern der Farbe zum markieren in eines Combo-Items. Glaube dass es irgendwie damit zusammenhängt.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
begin
  with (Control as TComboBox) do
  begin
    if (odSelected in State) then
      Canvas.Brush.Color := clRed
    else
      Canvas.Brush.Color := clGradientActiveCaption;
    Canvas.FillRect(Rect);
    DrawText(Canvas.Handle,
              PChar(Items[Index]),
              -1,
              Rect,
              DT_SINGLELINE or DT_LEFT or DT_VCENTER);

end;


Hoffe einer von euch da draußen kann mir helfen

thx4all
MFG
BlackP
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Di 13.05.03 20:56 
wie ich dir schon mal geschriebn habe, verhält sich eine Combobox mit Style ownerdraw wie dropdownlist. Du kannst keinen Text setzten, nur items auswählen, wie sie in der liste stehen.

um nichts anzuzeigen, setze
ausblenden Quelltext
1:
ComboBox1.itemindex:=-1;					

dann steht nix drin.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
BlackPhantom Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: Di 13.05.03 21:55 
Ach ja ich probier es gleich mal aus und sollte es trotzdem auf irgendeine Art und Weise nicht funtzen sag ich dir bescheid.....

thx4all
MFG
BlackP