Vielen Dank für eure Hilfe! Nach zwei Stunden hat 's funktioniert
Delphi-Quellcode:
regist:=TRegistry.Create;
regist.RootKey:=HKEY_CURRENT_USER;
regist.OpenKey(...,true);
regist.GetValueNames(temp);
Listbox1.Canvas.Brush.Color := clWhite;
for i:=0 to temp.Count - 1 do
begin
if regist.ReadString('Name'+IntToStr(i))=Listbox1.Items[Index] then
begin
Farbe:=regist.ReadInteger('Name'+IntToStr(i)+'color');
lstbxChannelsCPC.Canvas.Pen.Color := Farbe;
lstbxChannelsCPC.Canvas.FillRect(Rect);
lstbxChannelsCPC.Canvas.Font.Color := Farbe;
lstbxChannelsCPC.Canvas.TextOut(Rect.Left, Rect.Top, Listbox1.Items[Index]);
end;
end;