我添加了一个statusbar的控件,加了一个bitbtn控件,我想:
1。鼠标在bitbtn上时候,在statusbar上显示提示
2。鼠标离开bitbtn的时候,在statusbar上不显示提示或者换个提示
1实现了,2如何实现?谢谢

解决方案 »

  1.   

    在bitbtn的mouseover中更改一下statusbar不就可以了吗?
      

  2.   

    procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
    if (x > BitBtn1.Left) and (x< (BitBtn1.Left+BitBtn1.Width) )
    and (Y>BitBtn1.Top) and (y<(BitBtn1.Top + BitBtn1.Height)) then
    //StatusBar1.Panels[0].Text := 'move in'
    else
    StatusBar1.Panels[0].Text := 'move out';
    end;procedure TForm1.BitBtn1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
    StatusBar1.Panels[0].Text := 'move jn';
    end;
      

  3.   

    不行啊,离开Form后还是原来的在bitbtn上的显示
      

  4.   

    TfrmMain = class(TForm)
      procedure DisplayHint(Sender: TObject);
    ....
    ....
    procedure TfrmMain.DisplayHint(Sender: TObject);
    begin
      stbInfo.Panels[0].Text := GetLongHint(Application.Hint);
    end;
    ...然后将DisplayHint指向OnHint事件。
    Application.OnHint := DisplayHint;