Susana
asked on
ToolTip dissapears???
I have developed an aplication with three splitting windows
that show and hide different controls. I've been using CAniButton class to implement the buttons and I wanted to
add tooltips to these buttons so what I did was the following:
1. I added a CTipControl variable member to one of the
view classes
2. I created the tooltip in the OnInitialUpdate of the View
as it is shown next:
void CTextView::OnInitialUpdate ()
{
EnableToolTips(TRUE);
m_tip.Create(this);
CFormView::OnInitialUpdate ();
m_tip.AddTool( GetDlgItem(IDC_ABVERPES)," Ver Pesos Optimos");
m_tip.AddTool( GetDlgItem(IDAB_GUARDAR_PE S),"Guarda r Pesos");
m_tip.AddTool( GetDlgItem(IDC_ABPRINTLST) ,"Imprimir Evolución");
//...
}
3. I added another function to manage the message:
BOOL CTextView::PreTranslateMes sage(MSG* pMsg)
{
m_tip.RelayEvent(pMsg);
return CFormView::PreTranslateMes sage(pMsg) ;
}
The problem is thai ti works fine at the beginning, but after
a while showing and hiding these butttons, the tooltips
dissapear.
Where is the problem???
that show and hide different controls. I've been using CAniButton class to implement the buttons and I wanted to
add tooltips to these buttons so what I did was the following:
1. I added a CTipControl variable member to one of the
view classes
2. I created the tooltip in the OnInitialUpdate of the View
as it is shown next:
void CTextView::OnInitialUpdate
{
EnableToolTips(TRUE);
m_tip.Create(this);
CFormView::OnInitialUpdate
m_tip.AddTool( GetDlgItem(IDC_ABVERPES),"
m_tip.AddTool( GetDlgItem(IDAB_GUARDAR_PE
m_tip.AddTool( GetDlgItem(IDC_ABPRINTLST)
//...
}
3. I added another function to manage the message:
BOOL CTextView::PreTranslateMes
{
m_tip.RelayEvent(pMsg);
return CFormView::PreTranslateMes
}
The problem is thai ti works fine at the beginning, but after
a while showing and hiding these butttons, the tooltips
dissapear.
Where is the problem???
ASKER
What I mean is that after the program has started the tooltips show ok. During the use of he application the buttons
are hiden and disabled, after this action the tooltips don´t work anymore.
But it is quite strange because is after a concret operation in which most of the controls are disabled or hiden and not in other
actions in which the buttons are hiden. It is quite difficult to
explain.
Any cue?
are hiden and disabled, after this action the tooltips don´t work anymore.
But it is quite strange because is after a concret operation in which most of the controls are disabled or hiden and not in other
actions in which the buttons are hiden. It is quite difficult to
explain.
Any cue?
I believe your "m_tip" should be "m_pTip": a pointer to CToolTipCtrl.
ASKER
To tflai:
Using pointers doesn´t work, or at least I don´t know how.
It comes up an exception during the creation of the control:
m_pTip->Create(this);
?????
Using pointers doesn´t work, or at least I don´t know how.
It comes up an exception during the creation of the control:
m_pTip->Create(this);
?????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I dont understand what exactly is the problem. You have mentioned "It works well at the beginning". What do you mean? When does it work properly and when does it give problems? What is the exact nature of the problem?Please explain
Thanks
Amaresh