


void TForm1::StringGrid1DrawCell(...) {
for(int i=0, int x=0, int y=0; i < StringGrid1->RowCount; i++, y+=StringGrid1->RowWidth[i]) {
StringGrid1->Canvas->Pen->Width = 3;
StringGrid1->Canvas->Pen->Color = clBlack;
StringGrid1->Canvas->MoveTo(x, y+1);
StringGrid1->Canvas->LineTo(StringGrid1->Width, y+1);
}
}StringGrid1->DoubleBuffered = true;
void __fastcall TViewForm::StringGrid1DrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
StringGrid1->Canvas->Pen->Color = clRed;
StringGrid1->Canvas->Pen->Width = 1;
StringGrid1->Canvas->MoveTo(Rect.left - 1, Rect.top);
StringGrid1->Canvas->LineTo(Rect.left - 1, Rect.bottom - 1);
StringGrid1->Canvas->MoveTo(Rect.left - 1, Rect.bottom - 1);
StringGrid1->Canvas->LineTo(Rect.right, Rect.bottom - 1);
}
//---------------------------------------------------------------------------

Powrót do Ogólne problemy z programowaniem
Użytkownicy przeglądający ten dział: Brak zalogowanych użytkowników i 5 gości