English 中文(简体)
Delphi: PopUpMenu
原标题:Delphi: PopUpMenu

清单见A.PopUpMenu。 我需要在项目出现时看到PopUpMenu。 不能在零件时出现菜单。

是否应当使用这一大致代码(可以用作依据)?

procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var P: TPoint;
begin
  P:=GetClientOrigin;
  if Button = mbRight then
     PopupMenu1.Popup(X+P.X+StringGrid1.Left, Y+P.Y+StringGrid1.Top);
end;

是否有其他办法?

感谢!

最佳回答

首先,由于可以从钥匙板上援引人口菜单,在一次 mo活动中没有任何东西。

我认为,这样做的最佳途径是处理<>OnPopup活动。 如果您不要求菜单上<代码>。 Abort。

procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
  if SomeCondition then
    Abort;
end;
问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签