DelphiXE4 TBalloonHint组件的使用

本例相关图片:

 
 
 


方法一:


[delphi]  view plain copy
  1. unit Unit1;  
  2. interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ImgList;  
  3. type TForm1 = class(TForm) BalloonHint1: TBalloonHint;  
  4.  Button1: TButton;  
  5.  Edit1: TEdit;  
  6.  ImageList1: TImageList;  
  7.  procedure FormCreate(Sender: TObject);  
  8.  end;  
  9. var Form1: TForm1;  
  10. implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);  
  11. begin 
  12.  Button1.CustomHint := BalloonHint1;  
  13.  Edit1.CustomHint := BalloonHint1;  
  14.  BalloonHint1.Images := ImageList1;  
  15.  Button1.ShowHint := True;  
  16.  Edit1.ShowHint := True;  
  17.  Button1.Hint := '提示:|这是 Button1 的 Hint|0';  
  18.  {标题|内容|ImageList 中的图像序号} 
  19.  Edit1.Hint := '敬告:|这是 Edit1 的 Hint|1';  
  20.  end;  
  21. end.   

方法二:

一共放置4个组件:BalloonHint1 ImageList1 Button1 Edit1 

ImageList1按钮上设置

BalloonHint1.Images := ImageList1; 


在按钮button1和编辑框edit1上的属性中直接设置

1、customerhint为BalloonHint1;

2、showhint为True

3、hint := 提示:|这是 Button1 的 Hint|0

或者

   Hint := '敬告:|这是 Edit1 的 Hint|1'


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值