我现在鼠标移动到CEdit控件上,ToolTip可以出现,但是我想实现在输入的时候出现ToolTip,应该怎么办?请高手指点!!!谢谢!!!

解决方案 »

  1.   

    响应OnChar,然后show出tooltip窗口
      

  2.   

    OnChar()中PostMessage(WM_MOUSEMOVE);
    因为只有鼠标相关的消息才能引发Tooltip
      

  3.   

    class CAboutDlg : public CDialog
    {
    public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    CAboutDlg();// Dialog Data
    //{{AFX_DATA(CAboutDlg)
    enum { IDD = IDD_ABOUTBOX };
    //}}AFX_DATA // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CAboutDlg)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected:
    CToolTipCtrl m_tooltip;
    virtual BOOL OnInitDialog();
    //{{AFX_MSG(CAboutDlg)
    // No message handlers
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };BOOL CAboutDlg::OnInitDialog()
    {
    CDialog::OnInitDialog(); // CG: This was added by the ToolTips component.
    // CG: The following block was added by the ToolTips component.
    {
    // Create the ToolTip control.
    m_tooltip.Create(this);
    m_tooltip.Activate(TRUE); // TODO: Use one of the following forms to add controls:
    // m_tooltip.AddTool(GetDlgItem(IDC_<name>), <string-table-id>);
       m_tooltip.AddTool(GetDlgItem(IDC_EDIT1), "<text>");
    }
    return TRUE; // CG: This was added by the ToolTips component.
    }