Delphi-PRAXiS
Seite 2 von 3     12 3      

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/)
-   -   Problem mit ComboBox (https://www.delphipraxis.net/109058-problem-mit-combobox.html)

mkinzler 23. Feb 2008 18:30

Re: Problem mit ComboBox
 
Label1.Visible

Landfloh 23. Feb 2008 18:32

Re: Problem mit ComboBox
 
Zitat:

Zitat von DeddyH
Wie, auf 1 stehen? ItemIndex oder Text?

ItemIndex

DeddyH 23. Feb 2008 18:33

Re: Problem mit ComboBox
 
Delphi-Quellcode:
Label1.Visible := (ComboBox1.ItemIndex = 1) and (ComboBox2.ItemIndex = 1);

Landfloh 23. Feb 2008 18:38

Re: Problem mit ComboBox
 
Und wenn man das jetzt in den Ouelltext einbauen würde? :wiejetzt:

mkinzler 23. Feb 2008 18:39

Re: Problem mit ComboBox
 
Einfach nach dem Case

Landfloh 23. Feb 2008 18:40

Re: Problem mit ComboBox
 
Dann kommt das [Fehler] Unit1.pas(32): Konstantenausdruck erwartet

DeddyH 23. Feb 2008 18:41

Re: Problem mit ComboBox
 
Delphi-Quellcode:
begin
  case ComboBox1.ItemIndex of
    0 : Label1.Caption := '1';
    1 : begin
          Label1.Visible := ComboBox2.ItemIndex = 1;
          //man könnte hier auch noch vorher auf visible abfragen
          Label1.Caption := '2';
        end;
    2 : Label1.Caption := '3';
  end;
end;

Landfloh 23. Feb 2008 18:54

Re: Problem mit ComboBox
 
Wenn ich ComboBox1 auf 1 stelle und ComboBox2 auf 2 dann zeigt er trozdem 1 an.
Ich möchte aber das er nur 1 anzeigt wenn beide ComBoxen auf 1 stehen.

mkinzler 23. Feb 2008 18:56

Re: Problem mit ComboBox
 
Du hast eigentlich alles was du brauchst. Du musst also nur den Code an die gewünschten Bedingungen anpassen

DeddyH 23. Feb 2008 18:59

Re: Problem mit ComboBox
 
Was ich gepostet habe, war die Ereignisbehandlung von ComboBox1. Es sollte nicht allzu schwierig sein, das auch auf ComboBox2 zu übertragen, oder? :stupid:


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:31 Uhr.
Seite 2 von 3     12 3      

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