我正在使用Delphi 10.1柏林来制作多设备应用程序。我有一个TStringGrid
为了列出查询中的一些数据。我也有一个弹出菜单(编辑,删除,...),但为了编辑/删除一个项目,我必须使用鼠标左键单击一个单元格。delphi TStringGrid和鼠标右键
在显示弹出式菜单之前,是否可以仅使用右按钮“选择一行”?
我想:
procedure TForm1.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight then
StringGrid1.Perform(WM_LBUTTONDOWN, 0, MakeLParam(Word(X), Word(Y)));
end;
但它mbRight
和Perform()
显示错误。
我看到你还添加了“multidevice application”。请为FMX应用程序添加一个'firemonkey'标签。 –
你是如何添加“OnMouseDown”事件的? FMX'TStringGrid'不公开此类事件。 –
[单程](https://pastebin.com/BbTG6pAB)。 – Victoria