首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

能让控件的汽泡提示主动弹出吗?该如何解决

2012-02-24 
能让控件的汽泡提示主动弹出吗?能让控件的汽泡提示主动弹出吗?也就是鼠标不放在控件上,汽泡也能出来[解决

能让控件的汽泡提示主动弹出吗?
能让控件的汽泡提示主动弹出吗?也就是鼠标不放在控件上,汽泡也能出来

[解决办法]
很简单的,根本不用控件。
下面是头文件 .h

C/C++ code
#include <Controls.hpp>#include <StdCtrls.hpp>#include <Forms.hpp>//---------------------------------------class TForm1 : public TForm{__published:    // IDE-managed Components        TButton *Button1;        void __fastcall Button1Click(TObject *Sender);private:    // User declarations       void __fastcall BalloonHint(String msg); //加上这句public:        // User declarations        __fastcall TForm1(TComponent* Owner);};//---------------------------------------extern PACKAGE TForm1 *Form1;//---------------------------------------#endif
[解决办法]
让某控件显示其自己的Hint:

C/C++ code
TPoint pt = Button2->ClientToScreen(TPoint(Button2->Width  / 2, Button2->Height / 2));::SetCursorPos(pt.x, pt.y) ;Application->ActivateHint(pt);
[解决办法]
楼主估计是不想让鼠标指针在控件上,如果指针不在控件上,又不会响应产生WM_NCMOUSEHOVER消息.
探讨
让某控件显示其自己的Hint:


C/C++ code
TPoint pt = Button2->ClientToScreen(TPoint(Button2->Width / 2, Button2->Height / 2));

::SetCursorPos(pt.x, pt.y) ;

Application->ActivateHint(pt);

热点排行