动态生成edit
我想在stringgrid单元格当中动态的生成一个edit 怎么去做呢?每次都需要去计算坐标值吗?
[解决办法]
TStringGrid *sg = dynamic_cast<TStringGrid*>(Sender); if (!sg) return; sg->Perform(WM_CANCELMODE, 0, 0); TRect R = sg->CellRect(ACol, ARow); TPoint org = ScreenToClient(sg->ClientToScreen(TPoint(R.Left, R.Top))); Edit1->SetBounds(org.x, org.y, R.right - R.left, StringGrid1->RowHeights [sg->Row]); Edit1->Show(); Edit1->BringToFront(); Edit1->SetFocus(); Edit1->Text = ""; Edit1->Text = StringGrid1->Cells [ACol][ARow];