CStatics (静态文本控件) 可以弹出 Tip(提示文本)吗?

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

好像不行。   因为其没有mousemove消息。

· 网友精彩回答:

发表者:happyparrot

cstatic是cwnd的子类,怎么可能没有mousemove消息呢。  
  要给cstatic加mousemove事件,只要在wizard设置中,将消息过滤改为window就可以了。缺省是dialog吧。也就是说,你看不到mousemove事件,只是因为wizard帮你自动过滤了。

发表者:goodboyws

把他的id改了么,不要idc_static

发表者:goodboyws

class   cmystatic   :   public   cstatic  
  {  
  //   construction  
  public:  
  cmystatic();  
   
  //   attributes  
  public:  
   
  //   operations  
  public:  
   
  //   overrides  
  //   classwizard   generated   virtual   function   overrides  
  //{{afx_virtual(cmystatic)  
  //}}afx_virtual  
   
  //   implementation  
  public:  
  virtual   ~cmystatic();  
   
  //   generated   message   map   functions  
  protected:  
  //{{afx_msg(cmystatic)  
  afx_msg   void   onmousemove(uint   nflags,   cpoint   point);  
  //}}afx_msg  
   
  declare_message_map()  
  };

发表者:lbird

static控件可以弹出tip,也不用处理wm_mousemove消息

发表者:lbird

toolinfo   ti;  
  zeromemory(   &ti   ,   sizeof(   toolinfo   )   );  
  ti.cbsize =   sizeof(   toolinfo   );  
  ti.uflags =   ttf_subclass   |   ttf_idishwnd   ;  
  ti.hwnd =   m_hwnd;  
  ti.hinst =   hinst   ;  
  ti.uid =   (uint)hwnd   ; //   static控件的窗口句柄  
  ti.lpsztext   =   sztext   ;  
  sendmessage(   hwndtip   ,   ttm_addtool   ,   0   ,   (lparam)&ti   )  
   
  用mfc的话用  
  bool   addtool(   cwnd*   pwnd,   uint   nidtext,   lpcrect   lprecttool   =   null,   uint   nidtool   =   0   );  
   
  为得到static的窗口,可以为static指定id,而不是采用默认的id,然后getdlgitem得到    
 

.
处理 SSI 文件时出错
© 2006-2008 All Rights Reserved