|
- 类声明:
- CToolTipCtrl m_toolTip;
- 重写函数:
- virtual void PreSubclassWindow();
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- 重写实现:
- void Skin_ListControl_icon::PreSubclassWindow()
- {
- //this->ModifyStyle(0, LVS_NOCOLUMNHEADER);//设置为工具提示控件
- m_toolTip.Create(this); // 创建 CToolTipCtrl 控件
- m_toolTip.AddTool(this);
- m_toolTip.Activate(TRUE);
- // 设置ToolTipCtrl的样式
- m_toolTip.SetDelayTime(TTDT_AUTOPOP, 3000); // 设置自动隐藏时间(毫秒)
- m_toolTip.SetDelayTime(TTDT_INITIAL, 1); // 设置初始显示延迟时间(毫秒)
- m_toolTip.SetDelayTime(TTDT_RESHOW, 1); // 设置重新显示延迟时间(毫秒)
- m_toolTip.SetTipBkColor(RGB(0, 0, 0)); // 设置背景色
- m_toolTip.SetTipTextColor(RGB(255, 255, 255)); // 设置文本色
- }
- BOOL Skin_ListControl_icon::PreTranslateMessage(MSG* pMsg)
- {
- m_toolTip.RelayEvent(pMsg);
- return CWnd::PreTranslateMessage(pMsg);
- }
- 调用:
- m_toolTip.UpdateTipText(text, this);
复制代码
|
|