ShellListView切换PopMenu的具体操作方法
2015-03-22 11:33
239 查看
需要用到ShellListView的OnMouseDown事件,PopMenu中的OnPopup()事件。其中还有如何获得PopMenu出现的坐标
代码如下:procedure TFormSystemTree.lvMainMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var p:Tpoint; begin if button=mbRight then begin GetCursorPos(P); if lvMain.InnerListView.ItemIndex = -1 then begin lvMain.PopupMenu := PopupMenu2 ; PopupMenu2.Popup(p.x,p.y); end else begin lvMain.PopupMenu := PopupMenu3; PopupMenu3.Popup(p.x,p.y); end; end; end;
OnPopup()事件代码如下:
procedure TFormSystemTree.PopupMenu2Popup(Sender: TObject); begin lvMain.PopupMenu := nil ; end; procedure TFormSystemTree.PopupMenu3Popup(Sender: TObject); begin lvMain.PopupMenu :=nil ; end;
相关文章推荐
- poi方式操作execl具体方法
- linux 图形界面和文本界面的切换操作方法
- python操作MySQL数据库具体方法
- shell自动连接mysql后进行查询操作的方法
- Eclipse对svn操作切换账号或更换svn地址方法
- poi操作execl具体方法
- Shell脚本中执行sql语句操作mysql的5种方法
- Centos shell bash操作界面 不显示路径 改为显示路径的方法
- 配置DataSource方法(BasicDataSource为例) 和 具体的数据库操作(HibernateDaoSupport、HibernateTemplate和jdbcTemplate)
- CM安装好集群之后在shell命令下执行hive 或者hbase操作遇到权限问题的解决方法
- Android精简小笔记(3):在adb shell中操作sqlite数据库的方法
- Android ListView 中子控件无法获取焦点的解决方法(主要针对键盘操作)
- 查询数据库最大的索引、静态类与非静态类的区别、后台操作DIV样式的方法、C#操作TreeView组件中的一些常用方法及具体实现
- GridView自定义删除操作的具体方法
- Activity在GridView和ListView之间切换使用一个布局实现的方法
- 巨简单循环shell脚本验证&符号后台操作(并记录查看当前shell的方法)
- shell操作mysql的一些方法
- android ListView本行控件操作本行其它控件的重要方法(绝对原创,本人研究2天成果)
- JS图片切换的具体方法(带缩略图版)
- Shell脚本中执行sql语句操作mysql的5种方法