1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| //---------------------------------------------------------------------------
void __fastcall TBeginningCPPMainForm::StringGrid1DrawCell(TObject *Sender,
int ACol, int ARow, TRect &Rect, TGridDrawState State)
{
if (ACol == 1)
{
DrawFrameControl(((TStringGrid*)Sender)->Canvas->Handle, &Rect, DFC_BUTTON, DFCS_BUTTONCHECK | ((int)((TStringGrid*)Sender)->Objects[ACol][ARow]));
}
}
//---------------------------------------------------------------------------
void __fastcall TBeginningCPPMainForm::StringGrid1Click(TObject *Sender)
{
if (((TStringGrid*)Sender)->Col == 1)
{
int StateChecked = ((int)((TStringGrid*)Sender)->Objects[((TStringGrid*)Sender)->Col][((TStringGrid*)Sender)->Row]);
StateChecked = StateChecked ? 0 : DFCS_CHECKED;
((TStringGrid*)Sender)->Objects[((TStringGrid*)Sender)->Col][((TStringGrid*)Sender)->Row] = (TObject*)StateChecked;
}
} |
Partager