Cor de seleção
28/03/2003
0
Quando posicionamos o cursor em uma célula ela geralmente fica azul com fonte branca. Tem como mudar isso?
Okama
Posts
28/03/2003
Carnette
Tem sim amiguinho...Pega o 750 dicas e truques do lloydsoft que tem vários exemplos..
www.lloydsoft.hpg.ig.com.br
28/03/2003
Okama
No 750 dicas encontrei tudo sobre cor em Grid, Zebrar, Colorir aleatóriamente. Bom isso eu já tô fazendo, agora imagine que eu vá colorir ´todas´ as células com a cor azul e a fonte branca.
Como eu poderia diferenciar onde está o cursor?
28/03/2003
Carnette
TGridDrawState represents information that is useful when rendering the cell of a grid.
Unit
Classes
type
TGridDrawState = set of (gdSelected, gdFocused, gdFixed);
Description
TGridDrawState represents state information about the cell of a grid that is being rendered. It is a set that includes 0 or more of the following:
ValueMeaning
gdSelectedThe cell is currently selected.
gdFocusedThe cell has input focus.
gdFixedThe cell is in the fixed region of the grid.
28/03/2003
Okama
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with DBGrid1.Canvas do begin
Case Table1.FieldByName(´Campo´).AsInteger of
1:Brush.Color := clMoneyGreen;
2:Brush.Color := RGB(255,255,160);
3:Brush.Color := RGB(255,100,100);
end;
[b:dbf3ecba64]if gdSelected in State then
Brush.Color := clBlue;[/b:dbf3ecba64]
FillRect(Rect);
TextOut (Rect.Left + 2, Rect.Top + 2, Column.Field.AsString);
end;
end;
Valeu Carnette!
Clique aqui para fazer login e interagir na Comunidade :)