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

Psychic Window Technique

2 Answers   E Logic, Wild Net,


What is CArchive class dowes?

4 Answers  


If i derive a new class from CObject what are the basic features my derived wil get ?

4 Answers   Microsoft,


1)set the Title for The File DialogBox, in MFC?

1 Answers  


Explain StretchBlt and BitBlt

1 Answers  






what if we provide two message handler for same message ?

1 Answers  


What is Multithreading

1 Answers   Invensys,


1)How to change a text of a button as Dynamically?

1 Answers   HCL,


1) create ToolTip in MFC?

2 Answers   HCL,


What is the use of CObject::Dump function ?

4 Answers  


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

1 Answers  


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


Categories