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 are the special requirements for dialog box resources used in a form view?
Do you have an idea about MFC?
1)How to create ToolTip in MFC?
What is the range of intensity of RGB
What is serialization ?which function is responsible for serializing data ?
Have you ever used win32 APIs ?
Differ GetMessage, PostMessage & PeakMessage?
What view class enables you to use an edit control as a view?
What is userdefine Messages in MFC?
Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer
What is the difference between Extension DLL and Regular DLL?
What is the difference between workrer thread and UI thread