我想实现 编辑框 失去焦点 然后tooltip提示这一功能,我已经做到能提示,但是不知道为什么,tooltip显示的位置总在鼠标的当前位置,有什么方法能解决??? 还有,当我在数遍移动到 编辑框的时候 怎么不会弹出提示??
初始化函数中
EnableToolTips(TRUE);
m_toolTip.Create(this,TTS_BALLOON);
m_toolTip.Activate(TRUE);
m_toolTip.AddTool(&m_CardPwd,"空");
m_toolTip.SetTipTextColor(RGB(0,0,0));
m_toolTip.SetTitle(1,"提示");
m_toolTip.SetDelayTime(TTDT_INITIAL, 1);
m_toolTip.SetDelayTime(TTDT_AUTOPOP, 5000);
m_toolTip.SetDelayTime(TTDT_RESHOW, 5000);
鼠标移动到编辑框上没有提示 为什么?
然后我在 编辑框的 lostfocus 事件中 写下如下代码,tooltip能显示,但是位置总是在鼠标的位置
LRESULT CClearing::ShowToolTip(WPARAM wParam, LPARAM lParam)
{
ClearToolTipInfo * info=(ClearToolTipInfo *)wParam;
m_toolTip.Pop();
m_toolTip.UpdateTipText(info->strTipText,&m_CardPwd);
m_toolTip.SetTipTextColor(info->pTextColor);
MSG msg;
msg.hwnd =m_CardPwd.m_hWnd;
msg.message = WM_MOUSEMOVE;
m_toolTip.RelayEvent(&msg);
m_toolTip.Update();
return 1;
}
请高手指教!!
初始化函数中
EnableToolTips(TRUE);
m_toolTip.Create(this,TTS_BALLOON);
m_toolTip.Activate(TRUE);
m_toolTip.AddTool(&m_CardPwd,"空");
m_toolTip.SetTipTextColor(RGB(0,0,0));
m_toolTip.SetTitle(1,"提示");
m_toolTip.SetDelayTime(TTDT_INITIAL, 1);
m_toolTip.SetDelayTime(TTDT_AUTOPOP, 5000);
m_toolTip.SetDelayTime(TTDT_RESHOW, 5000);
鼠标移动到编辑框上没有提示 为什么?
然后我在 编辑框的 lostfocus 事件中 写下如下代码,tooltip能显示,但是位置总是在鼠标的位置
LRESULT CClearing::ShowToolTip(WPARAM wParam, LPARAM lParam)
{
ClearToolTipInfo * info=(ClearToolTipInfo *)wParam;
m_toolTip.Pop();
m_toolTip.UpdateTipText(info->strTipText,&m_CardPwd);
m_toolTip.SetTipTextColor(info->pTextColor);
MSG msg;
msg.hwnd =m_CardPwd.m_hWnd;
msg.message = WM_MOUSEMOVE;
m_toolTip.RelayEvent(&msg);
m_toolTip.Update();
return 1;
}
请高手指教!!
解决方案 »
- 向服务器发送数据速率问题
- WINVER not defined. Defaulting to 0x0600 (Windows Vista)
- IDOK问题
- //#include <windows.h>问题
- 高手请指教!!!
- 在SDK中怎么创建一个自定义的彩色画刷,这个模板是自已的数组变量?
- 为什么VC6的自动提示(譬如:光标在指针->后时,应该出现可用方法)时有时无呢?
- 做类似PowerPoint左边的缩略图怎样实现??
- 多核CPU, WIN7 64位环境下,同一个线程下的不同函数,可否同时运行?
- 《Visual c++ MFC编程实例》这本书怎样?机械工业出版社
- CArray与CPtrArray嵌套问题
- 如何保证信号量可以正确释放
popup.hwnd = 编辑框的句柄;
::GetClientRect(编辑框的句柄,&popup.rect);::sendmessage(泡泡的句柄,TTM_ADDTOOL,0,(LPARAM)&popup);::SendMessage(泡泡的句柄,TTM_NEWTOOLRECT,0,(LPARAM)&popup);