一个简单的菜单按钮的实现计算机等级考试

文章作者 100test 发表时间 2010:01:01 09:32:12
来源 100Test.Com百考试题网


  使用过速达2000的朋友都知道,其基本资料的浏览界面中有一种按钮,点击后会弹出一个和按钮对得很整齐的菜单.用Delphi制作一个类似的控件十分容易,代码如下:
  unit MenuBtnVCL.
  interface
  uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, CommCtrl,
  ExtCtrls,Menus.百考试题-全国最大教育类网站(100test.com)
  type
  TMenuBtn = class(TBitBtn)
  protected
  procedure DoEnter.override.
  procedure DoExit.override.
  { Protected declarations }
  public
  constructor Create(AOwner: TComponent). override.
  procedure Click. override.www.Examda.CoM考试就到百考试题
  { Public declarations }
  published
  { AL: }
  { Published declarations }
  end.
  procedure Register.
  implementation
  procedure Register.
  begin
  RegisterComponents(\Samples\, [TMenuBtn]).
  end.
  constructor TMenuBtn.Create(AOwner: TComponent).
  begin
  inherited Create(AOwner).
  layout:=blGlyphRight.
  Font.Charset := GB2312_CHARSET.
  Font.Color := clWindowText.
  Font.Height := -12.
  Font.Name := \宋体\.来源:考
  end.
  procedure TMenuBtn.Click.
  var tmp:TPoint.
  begin
  inherited Click.
  if Assigned(PopUpMenu) then
  begin
  { calc where to put menu }
  tmp := ClientToScreen(Point(0, Height)).
  PopUpMenu.Popup(tmp.X, tmp.Y).
  end.
  end.
  procedure TMenuBtn.DoEnter.
  begin
  Font.Style := [fsBold].
  inherited DoEnter.
  end.
  procedure TMenuBtn.DoExit .
  begin
  Font.Style := [].源:www.examda.com
  inherited DoExit.
  end.
  end.

  编辑特别推荐:

  全国计算机等级考试资料下载

  全国计算机等级考试论坛

  如何应付二级考试中的公共基础知识

  全国计算机等级考试上机考试应试技巧

  百考试题教育全国计算机等级考试在线测试平台



相关文章


怎样在自己的进销存里导入速达、管家婆和用友的数据计算机等级考试
使用OLE拖放不同程序间的数据计算机等级考试
用delphi制作抖动窗体计算机等级考试
全透明窗体(效果比较好)计算机等级考试
一个简单的菜单按钮的实现计算机等级考试
Delphi源程序格式书写规范计算机等级考试
计算机二级DELPHI辅导:防止关闭windows计算机等级考试
详细教你如何使用delphi中thread的线程编程计算机等级考试
取得自从开机到现在CPU运行的周期数超毫秒级的精度计算机等级考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛