io ho usato questo codice che mi permette di scegliere un valore presente in un combibox cambiando colore ad un pannello.
funziona bene ma lo vedo molto prolisso avete qualche suggerimento per accocciarlo?codice:procedure TRes.Val4Change(Sender: TObject); begin if(Val4.itemindex = 0) then F4.Color := clGreen; //0,1 begin if(Val4.itemindex = 1) then F4.Color := clGreen; //0,25 begin if(Val4.itemindex = 2) then F4.Color := clGreen; //0,5 begin if(Val4.itemindex = 3) then F4.Color := clMaroon; //1 begin if(Val4.itemindex = 4) then F4.Color := clRed; //2 begin if(Val4.itemindex = 5) then F4.Color := $0000D7FF; //5 begin if(Val4.itemindex = 6) then F4.Color := clSilver; //10 begin if(Val4.itemindex = 7) then F4.Color := clOlive; //20 end; end; end; end; end; end; end; end;