Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:26 
Kann mir jemand sagen wie ich ein String aus einer Datenbank in eine Color komponente schreiben kann??

Die Farbe steht so:

$003E9EFF

in der DB


Zuletzt bearbeitet von csigg am Fr 01.04.05 14:27, insgesamt 1-mal bearbeitet
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: Fr 01.04.05 14:27 
Was ist das denn für ein String?? Vllt. so:
ausblenden Quelltext
1:
Dunkelgrün					

:lol: ;)
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:27 
habs grad verbessert, Sorry
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: Fr 01.04.05 14:30 
kP. ;)

Das ist eigentlich kein String sonder ein hexadezmales Integer. ;)
Du kannst das z.B. so lösen:
ausblenden Delphi-Quelltext
1:
Form1.Color := StrToInt('$003E9EFF');					
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:32 
So gings auch: :D
ausblenden Delphi-Quelltext
1:
lvAlleMitarbeiter.Color := TColor(temp);					
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:34 
Aber das ist irgendwie ne andere Farbe wie ich wollte...
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: Fr 01.04.05 14:36 
user profile iconcsigg hat folgendes geschrieben:
Aber das ist irgendwie ne andere Farbe wie ich wollte...

Wie jetzt?? :lol:
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:40 
ich habe Orange gewählt, $000080FF, aber er stellt es mr manchmal ROT und manchmal SCHWARZ dar.
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: Fr 01.04.05 14:41 
Also wenn ich mir nen Button auf ein Formular setze und dem folgenden Code gebe, dann macht er mir das Form IMMER orange... ;)

ausblenden Delphi-Quelltext
1:
Form1.Color := $000080FF;					
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:42 
OK, mit deiner Version geht es wirklich, mit der richtigen Farbe *g*
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: Fr 01.04.05 14:45 
Na also... Dann liest du deine Farbe einfach aus der DB aus und speicherst sie in ner Variablen.

Wenn's eine String-Variable ist dann änderst du die Farbe so:
ausblenden Delphi-Quelltext
1:
Form1.Color := StrToInt(FarbeAusDatenbank);					

Bei Integer brauchst du keine weitere Funktion:
ausblenden Delphi-Quelltext
1:
Form1.Color := FarbeAusDatenbank;					


;)
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Fr 01.04.05 14:49 
user profile iconcsigg hat folgendes geschrieben:
ich habe Orange gewählt, $000080FF, aber er stellt es mr manchmal ROT und manchmal SCHWARZ dar.

hier steht warum (ziemlich unten beim obersten beitrag)

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:50 
habs jetzt so geschrieben:

ausblenden Delphi-Quelltext
1:
2:
 itemp := FieldByName('ABWESEND').asInteger;
  lvAlleMitarbeiter.Color := TColor(itemp);
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Fr 01.04.05 14:52 
@retnyg vielen Dank