本文介绍了将工具提示添加到CStatic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法找到简洁的代码块,无法使我向CStatic(和CLed)控件添加/显示工具提示.显然,这样做的标准代码不适用于这种类型的控件.有人可以发布代码段吗?
I haven't been able to find a concise chunk of code that allows me to add/display tooltips to a CStatic (and CLed) control. Obviously, the standard code to do so does not apply for this type of control. Can someone post code snippets?
推荐答案
我希望这段代码能解决您的问题.一件重要的事情是使CStatic = TRUE的NOTIFY属性.
I hope this code will solve your problem .One important thing make NOTIFY property of CStatic =TRUE.
if( !m_ToolTip.Create(this))
{
TRACE0("Unable to create the ToolTip!");
}
else
{
CWnd* pWnd = GetDlgItem(IDC_STATIC_MASTER_PWD);
m_ToolTip.AddTool(pWnd,"Ok");
m_ToolTip.Activate(TRUE);
}
让我知道是否有问题.
这篇关于将工具提示添加到CStatic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!