Código
if (ACol = 0)and(ARow>0) Then begin
if (StringGrid1.Cells[ACol,ARow] = 'OK') then
DrawFrameControl(StringGrid1.Canvas.Handle, Rect, DFC_BUTTON, DFCS_BUTTONCHECK or DFCS_CHECKED) // Desenha o CheckBox desmarcado
else
DrawFrameControl(StringGrid1.Canvas.Handle, Rect, DFC_BUTTON, DFCS_BUTTONCHECK); // Desenha o CheckBox marcado
end;
//---------------------------------------------\
Para funcionar coloque o seguinte comando no evento OnKeyDow do StringGrid :
case key of
VK_SPACE : begin
if(StringGrid1.Cells[0,StringGrid1.Row] = '') then
(StringGrid1.Cells[0,StringGrid1.Row] := 'OK')
else
(StringGrid1.Cells[0,StringGrid1.Row] := '');
end;
Espero ter ajudado.
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009