13,825
社区成员
发帖
与我相关
我的任务
分享
s->DefaultRowHeight=30;
s->DefaultColWidth=50;
DrawGrid1->GridLineWidth=5;线边框宽度
float fWidthScale, fHeightScale;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
fWidthScale = (float)Width / (float)StringGrid1->DefaultColWidth;
fHeightScale = (float)Height / (float)StringGrid1->DefaultRowHeight;
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
StringGrid1->DefaultColWidth = Width / fWidthScale;
StringGrid1->DefaultRowHeight = Height / fHeightScale;
}