我要在工具栏上显示当前按钮的标题,如何显示?
例如:象delphi的控件button一样,我将鼠标放置在上面就显示button字样。
这个功能怎么实现?

解决方案 »

  1.   

    设置Hint属性为你要显示的字符串,再设置ShowHint属性为True就行了。
      

  2.   

    就是了,一般就在Hint属性中写入你要显示的字条串。
      

  3.   

    在状态栏显示hint
    -------------------
    type
      TForm1 = class(TForm)
        Button1: TButton;
        StatusBar1: TStatusBar;
        Edit1: TEdit;
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        procedure DisplayHint(Sender: TObject);
      end;var  Form1: TForm1;
    implementation
    {$R *.DFM}{ Here is the implementation of the OnHint event handler }{ It displays the application current hint in the status bar }
    procedure TForm1.DisplayHint(Sender: TObject);
    begin
      StatusBar1.SimpleText := GetLongHint(Application.Hint);
    end;{ Here is the form OnCreate event handler. }{ It assign the application OnHint event handler at runtime }
    { because the Application is not available in the Object Inspector }
    { at design time }
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Application.OnHint := DisplayHint;
    end;Note: It is not actually necessary to write an OnHint event handler to display hints on the status bar. This can be accomplished more simply by setting the status bar AutoHint property.
      

  4.   

    Hint属性为你要显示的字符串,ShowHint=True
      

  5.   

    先在Hint属性中输入你要显示的内容,再设置ShowHint属性为True。