1)How to create ToolTip in MFC?
Answers were Sorted based on User's Feedback
step1:-
--------
In, CVC_searching_folderDlg.h
protected:
CToolTipCtrl m_ToolTip; // Tooltip
Step2:-
--------
In, CVC_searching_folderDlg.cpp
BOOL CVC_searching_folderDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// below, to set caption on a Dialogbox
SetWindowText(L"Welcome");
// Below, to create ToolTip for all Controls and Written
by Ctharam
if( !m_ToolTip.Create(this))
{
TRACE0("Unable to create the ToolTip!");
}
else
{
m_ToolTip.AddTool(&m_ok, _T("This is OK Button
!")); // for OK button
m_ToolTip.AddTool(&m_close_tooltip,_T("This is CANCEL
Button")); // for CANCEL button
m_ToolTip.AddTool(&m_onlyToolTip_button,_T("Yes This
is only ToolTip Button")); // for Button
m_ToolTip.AddTool(&m_edit1_tooltip,_T("Please Enter
Your Name here")); // for Edit Control
m_ToolTip.Activate(TRUE);
}
return TRUE;
}
step3:-
---------
In, CVC_searching_folderDlg.cpp
BOOL CVC_searching_folderDlg::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}
Code by Ctharam
Is This Answer Correct ? | 5 Yes | 0 No |
STEP1:-
-----
In, CVC_searching_folderDlg.h
protected:
CToolTipCtrl m_ToolTip; // Tooltip
STEP2:-
--------
In, CVC_searching_folderDlg.cpp
BOOL CVC_searching_folderDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// below, to set caption on a Dialogbox
SetWindowText(L"Welcome");
// Below, to create ToolTip for all Controls and Written
by Ctharam
if( !m_ToolTip.Create(this))
{
TRACE0("Unable to create the ToolTip!");
}
else
{
m_ToolTip.AddTool(&m_ok, _T("This is OK Button
!")); // for OK button
m_ToolTip.AddTool(&m_close_tooltip,_T("This is CANCEL
Button")); // for CANCEL button
m_ToolTip.AddTool(&m_onlyToolTip_button,_T("Yes This
is only ToolTip Button")); // for Button
m_ToolTip.AddTool(&m_edit1_tooltip,_T("Please Enter
Your Name here")); // for Edit Control
m_ToolTip.Activate(TRUE);
}
return TRUE; // return TRUE unless you set the
focus to a control
}
STEP3:-
-------
In, CVC_searching_folderDlg.cpp
BOOL CVC_searching_folderDlg::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}
Is This Answer Correct ? | 2 Yes | 1 No |
What is serialization ?which function is responsible for serializing data ?
How you create a button dynamically?
What function is called by a document class to notify views that the document has been changed?
How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?
What is LoadLibrary function returns?
19)how to set Back Ground Picture to a Dialog Box in MFC ?
What is the difference between Extension DLL and Regular DLL?
How to find the mouse entering an image?..while entering need to display next image...
1)How to create ToolTip in MFC?
How you find memory leaks?
what is the use of CCmdTarget?
i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required