1)How to create ToolTip in MFC?

Answers were Sorted based on User's Feedback



1)How to create ToolTip in MFC?..

Answer / 106743013743

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

1)How to create ToolTip in MFC?..

Answer / 106743013743

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

Post New Answer

More MFC Interview Questions

What are the special requirements for dialog box resources used in a form view?

2 Answers  


Do you have an idea about MFC?

0 Answers   C DAC, CDAC,


1)How to create ToolTip in MFC?

2 Answers  


What is the range of intensity of RGB

1 Answers  


What is serialization ?which function is responsible for serializing data ?

5 Answers  






Have you ever used win32 APIs ?

4 Answers   Microsoft,


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,


What view class enables you to use an edit control as a view?

1 Answers  


What is userdefine Messages in MFC?

1 Answers   HCL,


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

7 Answers   HP,


What is the difference between Extension DLL and Regular DLL?

6 Answers   GE,


What is the difference between workrer thread and UI thread

3 Answers   HCL,


Categories