toolbutton1.hint:='提示';
toolbutton1.showhint:=True;

解决方案 »

  1.   

    1。我想,多问没有错,学问学问,就是要问!   
      人人都会有不知道的东西,何况是新手。
      即使是圣贤,也要'不耻下问'呢!2。上述问题还可以进一步问:如果Delphi没有为组件提供hint、showhint属
      性,我们自己是否可以直接编写程序,来实现这样的提示功能呢?
      

  2.   

    button.hint='你的提示'
    工具条的showhint=true
      

  3.   

    to zzwu(未名) 
      您说的第二种应该怎么做啊?
    谢谢了
      

  4.   

    我以前在DOS下,做过这样的工作,整个程序的所有界面都由自己设计的.待我明天找出来后在这里公布,实现这一功能的程序有一点长.
      

  5.   

    Broker_chengchaoji(掮客): 下面就是不用Delphi提的hint、showhint属性,靠自己直接编写程序,来实现组件的提示功能.
    以下程序在form1上设立了2个button组件:button1和button2。button1上注明了名字,而button2我们去掉了原有的名字(在form1 create时去掉)。当鼠标移到button2上时就在其下出现一个提示。
    为了做到这一点,我们还必须在form1上设一个Timage组件HintImg,用来作为提示用的小方块。
    HintImg在平时应看不到的,所以在form1 create 时将其visible设为false;
    当鼠标移入button2上时,则Button2MouseMove事件发生,利用这一事件来显示为它所作的提示‘this is button2!’;
    当鼠标的光标移出button2,则它必进入form1,故可利用form1的MouseMove事件来关掉提示。注:任何组件都可用类似方法进行提示,但最常见的是为快捷键进行提示,因为它们很小,其上不能写字,只能画一个图标,初学者不容易看懂,所以要提示。
      
    unit hint;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ExtCtrls, Buttons;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        hintImg: TImage;
        procedure Button2MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
        procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
          Y: Integer);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}
    var  hinted:boolean;
    procedure TForm1.Button2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
    hintimg.top:=button2.top+button2.Height+2;
    hintimg.left:=button2.Left;
    hintimg.width:=80;
    hintimg.height:=20;
    hintimg.canvas.Brush.color:=clinfobk;
    hintimg.Canvas.FillRect(rect(0,0,80,20));
    hintimg.Canvas.Font.color:=clred;
    hintimg.canvas.textout(4,4,'This is button2!');
    hintimg.visible:=true;
    hinted:=true;
    end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
    begin
     if hinted then
     begin
     hintimg.visible:=false;
     hinted:=false;
     end;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
    hinted:=false;
    button2.caption:='';
    end;end.
      

  6.   

    谢谢谢谢  zzwu(未名) !