Autor Beitrag
Bomania
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 09.02.03 11:11 
Hallo,

wie finde ich den Index eines ausgewählten Eintrags einer TComboBox heraus?

Gruß,
Bo
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: So 09.02.03 11:14 
Hallo,

durch die Eigenschaft ItemIndex.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: So 09.02.03 11:16 
Schau Dir mal dieses Topic an.
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 09.02.03 11:37 
wenn ich mit einer case-Anweisung den Index abfragen möchte kommt die Fehlermeldung: "Nicht genügend wirkliche Parameter".

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function Sprache(ListenIndex: Integer): string;
  begin
    Case Listenindex of
      0: Sprache = 'ZH';  // An dieser Stelle erscheint der Fehler
    ...
  end;
end;

...

// Aufruf der Funktion
daten.Sprache := Sprache(cbo_Sprache.ItemIndex);
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: So 09.02.03 11:50 
Hab grad gesehen, dass ich den Doppelpunkt bei der Wertzuweisung vergessen hatte. Naja muss mich erstmal wieder vom VB-Syntax lösen :roll: