Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 07.11.07 10:28 
Hi, Delpher,

kann ich die obigen Properties in zwei Listboxen einlesen und zur Laufzeit auswählen?

Danke für Hilfe, Detlef A.
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 07.11.07 10:33 
Ja, die bekannten Alias- und Driver-Names kannst du über Session abfragen:

ausblenden Delphi-Quelltext
1:
2:
  Session.GetAliasNames(cbxAliasNames.Items);
  Session.GetDriverNames(cbxDriverNames.Items);


Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 07.11.07 11:41 
Hi, Stephan,

dank deines Hinweises habe ich es jetzt so gelöst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.SessionListe_Alias_Driver(sender:Tobject);
var Liste1, Liste2 : TStringList;
     n             : integer;
begin //Session.GetAliasNames(cbxAliasNames.Items);  Session.GetDriverNames(cbxDriverNames.Items);
  Liste1 := TStringList.Create;
  try
    Session.GetAliasNames(Liste1);  // Liste mit Aliasnamen füllen, Benutzer kann auswählen
    for n := 0 to Liste1.Count - 1 do  ListBox11.Items.Add(Liste1[n]);
    finally  Liste1.Free;
  end;
  Liste2 := TStringList.Create;
  try
    Session.GetDriverNames(Liste2); // Liste mit Treibernamen füllen, wie oben
    for n := 0 to Liste2.Count - 1 do  ListBox12.Items.Add(Liste2[n]);
    finally    Liste2.Free;
  end;
end;


Ist das ok?
Gruß, Detlef
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 07.11.07 11:47 
So geht es auch, aber TListBox.Items ist doch schon vom Typ TStrings, von daher kannst du dir den Umweg über die TStringlist eigentlich sparen. Session.GetAliasNames(Listbox1.Items); sollte direkt gehen - mit GetDriverNames natürlich genauso.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 07.11.07 12:50 
Hast recht, Stefan, das ist ja noch eleganter!
Danke, Detlef