Autor Beitrag
qball
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Sa 06.03.04 22:27 
ich will die textfarbe mehrerer comboboxes auf knopfdruck ändern. mein verwendeter code lautet ganz einfach: combobox.font.color:=clblue

mein problem in der laufzeit besteht nun darin, dass der text jeder der 9 comboboxes markiert ist und bleibt! die markierung wird nur aufgehoben, wenn man auf den combobox-text klickt und danach irgendwo außerhalb der combobox. wie kann ich das ändern? gibt es da eine eigenschaft der combobox, die ich verändern muss?

special-thx
rokdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: So 07.03.04 11:15 
Hallo,
ich verstehe dich nicht, warum musst du zum Ändern der Texffarbe den Focus von der Kombobox nehmen?

Rokdd
qball Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Mo 08.03.04 16:22 
ich will einfach nur die schriftfarben ändern! damit die farben sichtbar sind, darf der text aber nicht markiert sein (ist er aber)...versteht ihr jetzt mein problem?
rokdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: Mo 08.03.04 16:29 
also den focus, also cursor setzt so auf eine andere kompo(weiß nicht ob das dfir hilft):Txt_hallo.setfocus;
Eine combox unmarkieren macht man doch so oder:cbox.itemindex:=-1;

wie du farbe änderst weißt du ja. hoffe es hilft dir weiter..

rokdd
qball Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Mo 08.03.04 18:19 
leider nicht: das mit setfocus klappt nicht, weil es den fokus keinem unaktivierten objekt übergeben kann (so zumindest die fehlermeldung; es funktioniert mit keinem objekt!)

und itemindex:=-1 setzt die liste auf -1, das heißt, es wird gar kein item angezeigt (und ich will ja nicht das item ändern, sondern nur, dass die farbe sichtbar wird)
tmc2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140

zuviele
D7,D8
BeitragVerfasst: Mo 08.03.04 21:02 
hast du schon mal combobox1.repaint probiert?

gruß
tmc

_________________
it's not a bug it's a feature
rokdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 329

Win XP
D6
BeitragVerfasst: Mo 08.03.04 22:36 
itemindex gibt an welcher item markiert ist! wenn itemindex=.1 nicht ausgewählt!!!!

rokdd
tmc2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140

zuviele
D7,D8
BeitragVerfasst: Mo 08.03.04 23:02 
so geht es mit Itemindex geht es nicht glich so schon

ausblenden Quelltext
1:
ComboBox1.SelStart:=0;					



einfach zu dem Button klick ereignis hinter das farbe ändern
gruß

tmc

_________________
it's not a bug it's a feature
qball Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Mi 10.03.04 18:21 
ja danke! das cb.selstart:=0 hat funktioniert. war genau das was ich gebraucht hab :D