StringGrid取选有关问题
StringGrid取选问题
请问大大要如何可能我点(1,1) 在点(1,10)他都会依照我想要改变cell的内容去改呢? 因为小弟现在设计出来的只能一个一个点@@ 请问要怎么去设计@@

void __fastcall TForm1::StringGrid1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if(Button == mbLeft)
{
int nCol, nRow;
StringGrid1->MouseToCell(X, Y, nCol, nRow);
if(nCol >=1 && nRow >=1 && st==1)
{
StringGrid1->Col = nCol;
StringGrid1->Row = nRow;
StringGrid1->Cells[nCol][nRow]="P";
}
}
}
void __fastcall TForm1::Button29Click(TObject *Sender)
{
st=1;
}
------解决思路----------------------
参考Excel中按住右下角小三角形拖的做法?
请问大大要如何可能我点(1,1) 在点(1,10)他都会依照我想要改变cell的内容去改呢? 因为小弟现在设计出来的只能一个一个点@@ 请问要怎么去设计@@
void __fastcall TForm1::StringGrid1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if(Button == mbLeft)
{
int nCol, nRow;
StringGrid1->MouseToCell(X, Y, nCol, nRow);
if(nCol >=1 && nRow >=1 && st==1)
{
StringGrid1->Col = nCol;
StringGrid1->Row = nRow;
StringGrid1->Cells[nCol][nRow]="P";
}
}
}
void __fastcall TForm1::Button29Click(TObject *Sender)
{
st=1;
}
------解决思路----------------------
参考Excel中按住右下角小三角形拖的做法?