delphi button 实现下拉列表


本文整理自网络,侵删。

 
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    PopupMenu1: TPopupMenu;
    fgh1: TMenuItem;
    drg1: TMenuItem;
    dg1: TMenuItem;
    procedure Button1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
pt:TPoint;
begin
GetCursorPos(pt);
PopupMenu1.Popup((pt.x-x),(pt.y+(Button1.Height-y)));
 
end;
 
end.

来源:https://www.cnblogs.com/zhangzhifeng/p/9935245.html

相关阅读 >>

Delphi 中打开浏览器跳转网址链接网页的几种方法

Delphi制作手机签名app(windows同样适用)

Delphi 读取流信息

Delphi firemonkey的屏幕分辨率hdpi、mdpi、ldpi的差别

Delphi vcl 鼠标左键长按功能的实现

Delphi 外壳扩展创建快捷方式和获取快捷方式的目标对象

Delphi kmp(字符串匹配)算法

Delphi 字符串的分割

Delphi外挂编写

Delphi 搜索字符串在流中的位置

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...