procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); var R: TRect; org: TPoint; begin if ARow>0 then begin //标题行不能修改 if not SQLResutIsEmpty then begin with Sender as TStringGrid do if (ACol = 2) and (ARow >= FixedRows) then //设备类型 ComboBox begin perform(WM_CANCELMODE, 0, 0); R := CellRect(ACol, ARow); org := Parent.ScreenToClient(ClientToScreen(R.topleft)); with ComboBox9 do begin VisibleFalse; Visible := true; setbounds(org.X, org.Y, R.right - R.left, height); itemindex := Items.IndexOf(Cells[ACol, ARow]); Show; BringTofront; SetFocus; // DroppedDown := true; end; end;
procedure TForm1.VisibleFalse;//悬浮控件先 不可见 begin ComboBox9.Visible := False; Edit10.Visible := False; YearMonthEdit.Visible := False; Edit11.Visible := False; Edit12.Visible := False; ComboBox7.Visible := False; ComboBox8.Visible := False; Edit15.Visible := False; end;
标签:控件,常用,False,ACol,ARow,begin,StringGrid1,Visible,org From: https://www.cnblogs.com/tulater/p/18086799