CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  Windows SDK/API

自定义hint

楼主CORBABOY(())2005-04-02 11:59:29 在 C++ Builder / Windows SDK/API 提问

程序里hint很简单   我现在想做一个稍微复杂一些的  
  代替原始的hint   ,至少能及时显示出更多的信息  
  问题点数:0、回复次数:9Top

1 楼cczlp(不惑)回复于 2005-04-02 13:46:49 得分 0

用   THintWindowTop

2 楼constantine(飘遥的安吉儿)回复于 2005-04-02 14:47:37 得分 0

对,但是如果要功能跟强大就从THintWindow继承  
  自己在扩充他的功能  
  写法可以用  
  TFlatHintwindow   控件的实现,有delphi的源代码,改起来也不能Top

3 楼CORBABOY(())回复于 2005-04-02 19:50:37 得分 0

THintWindow怎么用?Top

4 楼clong320(clong320)回复于 2005-04-04 14:27:19 得分 0

学习!学习!Top

5 楼songhtao(三十年孤独)回复于 2005-04-04 14:43:29 得分 0

THintWindow   implements   the   small   pop-up   window   that   appears   over   a   control   at   runtime   when   the   control   has   its   ShowHint   property   set   to   true.  
   
  Unit  
   
  Controls  
   
  Description  
   
  Use   THintWindow   to   display   a   Help   Hint   pop-up   window   directly   from   an   application.   Override   THintWindow   to   customize   the   window   that   appears   automatically   for   controls   with   their   ShowHint   property   set   to   true.   After   overriding   THintWindow   to   create   a   new   derived   type,   assign   the   new   type   to   the   global   HintWindowClass   variable   at   application   startup,   so   that   the   new   hint   window   type   is   used   for   Help   Hints.  
   
  The   hint   window抯   BiDiMode   is   always   set   to   the   BiDiMode   of   the   control   that   activates   it.   If   the   mode   is   bdRightToLeft,   then   the   hint   is   left-aligned   to   the   cursor.Top

6 楼MEFULEU(没有作不到,只有想不到)回复于 2005-04-04 15:16:47 得分 0

//在一个句炳上显示提示hint  
  void   ShowBalloonTip(TWinControl   *Control,   int   Icon,   char   *Title,char   *   Text)  
  {  
   
      HANDLE   hWndTip   ;  
   
      TOOLINFO   ti;  
   
      HANDLE   hWnd   ;  
   
      hWnd   =   Control->Handle;  
   
      hWndTip   =   CreateWindow(TOOLTIPS_CLASS,   NULL,  
   
                                                    WS_POPUP   |   TTS_NOPREFIX   |   TTS_BALLOON   |   TTS_ALWAYSTIP,  
   
                                                    0,   0,   0,   0,   hWnd,   0,   HInstance,   NULL);  
   
      if   (hWndTip   !=   0)  
      {  
   
          SetWindowPos(hWndTip,   HWND_TOPMOST,   0,   0,   0,   0,SWP_NOACTIVATE   |   SWP_NOMOVE   |   SWP_NOSIZE);  
   
          ti.cbSize   =   sizeof(ti);  
   
          ti.uFlags   =   TTF_CENTERTIP   |   TTF_TRANSPARENT   |   TTF_SUBCLASS;  
   
          ti.hwnd   =   hWnd;  
   
          ti.lpszText   =   Text;  
   
          GetClientRect(hWnd,   &ti.rect);  
   
          SendMessage(hWndTip,   TTM_ADDTOOL,   1,   int(&ti));  
   
          SendMessage(hWndTip,   TTM_SETTITLE,   Icon   %   4,   int(Title));       //4行  
   
      }  
   
  }  
   
   
  //调用:  
  ShowBalloonTip(Button1,   1,   "Title","显示的Hint内容!");Top

7 楼constantine(飘遥的安吉儿)回复于 2005-04-04 16:21:24 得分 0

上面代码可以做参考,有待改善  
  还有就我所知有很多控件是显示不了的Top

8 楼icwin(www.cat898.com.cn)回复于 2005-04-16 17:28:45 得分 0

upTop

9 楼tgzhang(张三)回复于 2005-06-23 17:09:20 得分 0

其实有个非常简单的办法:  
  void   __fastcall   TForm1::FormCreate(TObject   *Sender)  
  {  
  ...  
  Application->OnHint   =   DisplayHint;  
  ...  
  }  
   
  -----------  
  void   __fastcall   TForm1::DisplayHint(TObject   *Sender)  
  {  
          StatusBar1->Panels->Items[1]->Text   =   GetLongHint(Application->Hint);  
  }Top

相关问题

  • MessageBox自定义???
  • 自定义tag
  • 自定义问题
  • 自定义消息。。
  • 自定义事件
  • 自定义消息!
  • 自定义控件
  • 自定义鼠标!
  • 自定义报表
  • 自定义消息

关键词

  • application
  • thintwindow
  • hint
  • bidimode
  • appears
  • control
  • overriding
  • 功能
  • pop
  • showhint property

得分解答快速导航

  • 帖主:CORBABOY

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo