tool tips
-
I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...
Proud To Be an Indian
-
m_ToolTip.Create(this); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MIN),"Min Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MAX),"Max Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_VAR),"Max Var Body Lenght"); m_ToolTip.Activate(TRUE); I had given like this in my code - where IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_VAR -are edit boxes - But the appln is running into a MEMORY ERROR , Why?
Proud To Be an Indian
-
m_ToolTip.Create(this); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MIN),"Min Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MAX),"Max Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_VAR),"Max Var Body Lenght"); m_ToolTip.Activate(TRUE); I had given like this in my code - where IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_VAR -are edit boxes - But the appln is running into a MEMORY ERROR , Why?
Proud To Be an Indian
Try to this code
void CDialogDlg::SetToolTip(LPCTSTR Text,HWND hwnd)
{
TOOLINFO ti;
ti.cbSize = sizeof(TOOLINFO);
ti.lpszText = (LPTSTR)Text;
ti.hinst = AfxGetInstanceHandle();
ti.hwnd = hwnd;
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.uId = (UINT) hwnd;m_tooltip.SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ti);
}void CDialogDlg::OnBnClickedButton1()
{
m_tooltip.Create(this);
SetToolTip("Test",hwnd);
SetToolTip("Test2",hwnd2);
}What happens?
WhiteSky
-
I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...
Proud To Be an Indian
Hi, Drive from the CEdit class and create a new CEditTool class, which will support the ToolTip. In Drived class CEditToolTip, have a member of type CToolTipCtrl. Create the Instance of this member in constructor, also u can set the ToolTipText Dynamically. And Finally in the MouseMove event u can call Update to display the tooltip.
Manoj Never Give up
-
I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...
Proud To Be an Indian
In my program i created an public variable CToolTipCtrl m_tooltip in the *.h file of my prg. WHen i changed the var declaration to protected the error was cleared protected: CToolTipCtrl m_tooltip; Frndz For information there is an easy way to create tooltips {Bosses plz excuse its for beginners} Projects->Add to Project->Components & controls ->Gallery->Visual C++ Components->ToolTip Support Its DONE .. . so simple
Proud To Be an Indian