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 |
Psychic Window Technique
What is CArchive class dowes?
If i derive a new class from CObject what are the basic features my derived wil get ?
1)set the Title for The File DialogBox, in MFC?
Explain StretchBlt and BitBlt
what if we provide two message handler for same message ?
What is Multithreading
1)How to change a text of a button as Dynamically?
1) create ToolTip in MFC?
What is the use of CObject::Dump function ?
1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions
What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?