Autor Beitrag
hedie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:15 
Hallo

ich möchte wenn ich einen button klicke, das danach dem panel die farbe in dem ini file zugewiesen wird.
ich habe es bis jetzt so gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button2Click(Sender: TObject);
var
  ini: TIniFile;
begin
 ini:=TIniFile.Create('einstellungen.ini');
  try
Panel1.Color := ini.ReadString('Panel','Farbe','');
  finally
    ini.free;
  end;

end;


es gibt immer die meldung "inkompatible typen Tcolor und String" wass mache ich falsch :?:

grüsse
Claudio

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 30.03.05 18:18 
Ist eine Farbe ein String? :shock:

Ein Farbwert ist vom Typ integer. Also muss er gelesen und gespeicht werden mit Read/writeinteger.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 30.03.05 18:18 
mach da ein strtoint vor oder speicher das als integer und benutzt readinteger, dann solte es funzen

//die fehlermeldung sagt eigentlich schon alles
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:19 
Das ist ungefähr so, als ob du in den Quellcode reinschreibst:
ausblenden Delphi-Quelltext
1:
Mach ein neues Fenster auf!!					

:lol: Das geht halt nicht. ;) Der PC muss wissen, was für zwei Typen das sind, um damit arbeiten zu können. Warum gibt es denn sonst IntToStr oder solche Scherze. ;)

Zum Prob: Wie hast du denn vor, die Farbe zu speichern?? Als RGB-Werte??
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:20 
wenn ich es als integer schreibe und lese, dann gibt es die meldung
ausblenden Delphi-Quelltext
1:
[Fehler] Unit1.pas(35): Inkompatible Typen: 'Integer' und 'String'					

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:22 
Beantworte mal bitte meine Frage. ;)
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 30.03.05 18:22 
weil die in der ini als string gespeichert sind
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:22 
sorry :oops:

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:23 
wie meinst du vorne dran

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:24 
Sagt mal, was habt ihr denn alle?? :motz: Farben sind doch keine Integers!!!! Und wenn er's als Integer in der Ini speichert und dann auch mit ReadInteger liest, dann ist das auch kein String mehr, Dunkelfürchter... ;)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 30.03.05 18:26 
user profile iconWeBsPaCe hat folgendes geschrieben:
Sagt mal, was habt ihr denn alle?? :motz: Farben sind doch keine Integers!!!! Und wenn er's als Integer in der Ini speichert und dann auch mit ReadInteger liest, dann ist das auch kein String mehr, Dunkelfürchter... ;)


Doch eine Farbe (zumindest TColor) ist ein Integer, und zwar hexadezimal.
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:27 
bitte helft mir hab immer noch ein problem :( Wie mach ich dass jetzt mit dem farb wert

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:29 
user profile iconKarlson hat folgendes geschrieben:
Doch eine Farbe (zumindest TColor) ist ein Integer, und zwar hexadezimal.

:rofl: Aha... Und Hexadezimal ist ja auch so arg Integer. ;)
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:33 
user profile iconhedie hat folgendes geschrieben:
bitte helft mir hab immer noch ein problem :( Wie mach ich dass jetzt mit dem farb wert

Du hast meine Frage halt noch nicht beantwortet. Versuch einfach mal kurz zu erklären, was du mit der Farbe machen willst. ;)
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:35 
des hab i doch schonmal erklärt ich möchte ein panel mit der Farbe die im Ini file gespeichert ist färben

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 30.03.05 18:36 
Gut. Und wie ist das in der Ini-Datei gespeichert? Poste doch einfach mal die Ini und highlighte das, wo die Farbe steht. ;)
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Mi 30.03.05 18:36 
oops sorry hab sie völig übersehen ich speicher sie als clRed

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 30.03.05 18:37 
@webspace: ich dachte, in seiner ini steht: "blau" :D
also zb "clblue", klang für mich jedenfalls so :?


Zuletzt bearbeitet von F34r0fTh3D4rk am Mi 30.03.05 18:45, insgesamt 1-mal bearbeitet
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 30.03.05 18:41 
suchen würde dir auch helfen ! Suche in: Delphi-Forum, Delphi-Library COLOR INI

_________________
In the beginning was the word.
And the word was content-type: text/plain.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 30.03.05 18:42 
oh ich hatte recht, aber eine minute zu spät gepostet :wink: