DelphiXE4 TBalloonHint组件的使用

来源:互联网 发布:linux 网桥 问题 编辑:程序博客网 时间:2024/05/22 03:25

本例相关图片:

 
 
 


方法一:


[delphi] view plaincopy
  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'


原创粉丝点击