鼠标窗体是什么样的东西?

逃逃VS海 2008-06-02 08:20:36
当用软件时,把鼠标移动到某个图标上,软件会自动弹出一个半透明的窗体,上面会介绍该图标的说明。
不知道VC里是否提供这种类,功能,请大家赐教下。
...全文
80 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Torch009 2008-06-03
  • 打赏
  • 举报
回复
up
sjdev 2008-06-02
  • 打赏
  • 举报
回复
code from msdn.
// Create and associate a tooltip control to the tab control of 
// CMyPropertySheet. CMyPropertySheet is a CPropertySheet-derived
// class.
BOOL CMyPropertySheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();

// Create a tooltip control. m_ToolTipCtrl is a member variable
// of type CToolTipCtrl* in CMyPropertySheet class. It is
// initialized to NULL in the constructor, and destroyed in the
// destructor of CMyPropertySheet class.
m_ToolTipCtrl = new CToolTipCtrl;
if (!m_ToolTipCtrl->Create(this))
{
TRACE("Unable To create ToolTip\n");
return bResult;
}

// Associate the tooltip control to the tab control
// of CMyPropertySheet.
CTabCtrl* tab = GetTabControl();
tab->SetToolTips(m_ToolTipCtrl);

// Get the bounding rectangle of each tab in the tab control of the
// property sheet. Use this rectangle when registering a tool with
// the tool tip control. IDS_FIRST_TOOLTIP is the first ID string
// resource that contains the text for the tool.
int count = tab->GetItemCount();
int id = IDS_FIRST_TOOLTIP;
for (int i = 0; i < count; i++)
{
id += i;
CRect r;
tab->GetItemRect(i, &r);
VERIFY(m_ToolTipCtrl->AddTool(tab, id, &r, id));
}

// Activate the tooltip control.
m_ToolTipCtrl->Activate(TRUE);

return bResult;
}

// Override PreTranslateMessage() so RelayEvent() can be
// called to pass a mouse message to CMyPropertySheet's
// tooltip control for processing.
BOOL CMyPropertySheet::PreTranslateMessage(MSG* pMsg)
{
if (NULL != m_ToolTipCtrl)
m_ToolTipCtrl->RelayEvent(pMsg);

return CPropertySheet::PreTranslateMessage(pMsg);
}
cnzdgs 2008-06-02
  • 打赏
  • 举报
回复
就是ToolTip。
逃逃VS海 2008-06-02
  • 打赏
  • 举报
回复
能联接个小示例程序不
jameshooo 2008-06-02
  • 打赏
  • 举报
回复
CToolTipCtrl 这种窗口叫小贴士
job82824 2008-06-02
  • 打赏
  • 举报
回复
cToolTip类,详见MSDN
e.g:

int CMyWnd::OnCreate()
{
...
CString str("Helpful Info");
m_ToolTip.Create(this);
m_ToolTip.AddTool(this,str);
...
}

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧