13,871
社区成员




void __fastcall TFrmPhaseControl::Button4Click(TObject *Sender)
{
ShowMessage("点到我了");
}
void __fastcall TFrmPhaseControl::StringGrid1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
int XCol,XRow;
StringGrid1->MouseToCell(X,Y,XCol,XRow);
if(XRow)
{
Button4->Parent=StringGrid1;
Button4->Left=StringGrid1->CellRect(5,XRow).Left;
Button4->Top=StringGrid1->CellRect(5,XRow).Top;
Button4->Width=StringGrid1->ColWidths[5];
Button4->Height=StringGrid1->RowHeights[1];
Button4->Visible=true;
Button4->OnClick=Button4Click;
}
}
button4设置bring to front
void __fastcall TForm1::StringGrid1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
int XCol,XRow;
StringGrid1->MouseToCell(X,Y,XCol,XRow);
if(XRow)
{
Button4->Left =StringGrid1->Left;
Button4->Top=StringGrid1->Top;
Button4->Width=StringGrid1->ColWidths[5];
Button4->Height=StringGrid1->RowHeights[1];
}
}