这个问题很简单,你只要编一个MM_MOUSEMOVE,并判断鼠标是否进入botton区域,是的话就显示提示语句。
解决方案 »
- 用MFC做定时关机程序,当鼠标键盘无操作时自动关机,应该怎么做?如何得知鼠标键盘何时不再操作呢?
- ::GetNextWindow()是怎么确定下一个窗口的?
- 如何运行这段vc++程序
- 显式调用dll的问题
- 多线程设计是否需要考虑线程异常终止的情况。
- 对话框中的ActiveX控件的调用问题
- 串口通讯:
- 如何在VC中建立一个数据库
- 关于邮件:553 Authentication is required to send mail as <[email protected]>,这样的反馈,是正确的吗?
- 请教何为鼠标的Capture?
- AfxMessageBox(_T("hello world !"))和AfxMessageBox("hello world !")
- 在一个程序中如何得到另一运行的程序中的某个控件中的内容。 请详细说!
CRect rec;
GetCursorPos(point);//得到鼠标所在位置
m_Button.GetClientRec(rec);//得到按钮区域
if(rec.PosInRect(point)//判断point是否在按钮区域内{
CStatic s;
s.Create()//或messageBox();
}
不过谢谢你的帮助阿!
CallCreate to create the Windows tool tip common control and attach it to the CToolTipCtrl object.
CallAddTool to register a tool with the tool tip control, so that the information stored in the tool tip is displayed when the cursor is on the tool.
CallSetToolInfo to set the information that a tool tip maintains for a tool.
CallSetToolRect to set a new bounding rectangle for a tool.
CallHitTest to test a point to determine whether it is within the bounding rectangle of the given tool and, if so, retrieve information about the tool.
CallGetToolCount to retrieve a count of the tools registered with the tool tip control.
你的方法还是不行呀!怎么搞得?
还有用CToolTips类到底怎么实现?
到底怎么实现?
请写出源代码。可以吗?
Example// 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);
}
你能不能弄个简单一点的,大家都还是新手,好多看不懂!
ok?拜托!
在BUTTON的父窗口中实现文件中的窗口创建完成后位置(OninitXXXX)
m_tip.Create(this);
CWnd* pWnd = GetDlgItem(IDC_BUTTON1);
m_tip.AddTool(pWnd, _T("提示"));重载BOOL CSH_GSView::PreTranslateMessage(MSG* pMsg)
{
m_tip.Activate(TRUE);
m_tip.RelayEvent(pMsg);
.....
...
}OK了。
代码有13000行的超cool表格程序,如何开发成activeX控件,有兴趣的人留下email,我把源程序发给你们
分数为150分
十万火级,如能给出答案,再送300分
有兴趣的人留下email
我把程序发给你们。
一个很cool的表格程序,请问如何改为activeX控件,有兴趣的我把源代码发给你们,感兴趣的人留下email,
是vc写的非常cool
m_pctrlToolTips->Create(this,1);
EnableToolTips(TRUE);
m_pctrlToolTips->Activate(TRUE);button 创建完后: CString oString;
CToolTipCtrl *MyToolTip;
MyToolTip = m_pctrlToolTips;
oString.LoadString("MyButton");
m_btnMyButton.SetToolTips(MyToolTip,oString); 记得在析构函数中Delete m_pctrlToolTips