DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   toolTip1 for textBox (http://www.daniweb.com/forums/thread164993.html)

Lukezzz Dec 30th, 2008 12:57 pm
toolTip1 for textBox
 
I want to Show "ToolTips" when radioButton4 is Checked and when you Hover the mouse over textBox2.

This works as expected. Now when I Check the radioButton5 wich makes the radioButton4 UnChecked I dont want the ToolTips to be seen when Hover the mouse over textBox2.

I am trying to make that rule with the code below but the ToolTips is shown anyway. Have I missed something out because I do make the check:
if( radioButton4->Checked ) etc.. ?

private: System::Void textBox2_MouseHover(System::Object^  sender, System::EventArgs^  e) 
{

    if( radioButton4->Checked ) //Also tried: radioButton4->Checked == true
  {
      toolTip1->SetToolTip( this->textBox2, "Hello" );
  }

}

ddanbe Dec 30th, 2008 1:32 pm
Re: toolTip1 for textBox
 
Try this->radiobutton4->Checked although it should work without.
I have the effect you want if I Hover VERY slowly over the control.

cikara21 Dec 30th, 2008 5:58 pm
Re: toolTip1 for textBox
 
try
//----------------------------------------------------------------------------
//...
private: System::Int32 m_x, m_y;
//...
//----------------------------------------------------------------------------
ON FORM1 MOUSE MOVE
{
    m_x = e->X;
    m_y = e->Y;
}
//----------------------------------------------------------------------------
ON TEXTBOX1 MOUSE LEAVE
{
    toolTip1->Hide(this);
}
//----------------------------------------------------------------------------
private: System::Void textBox2_MouseHover(System::Object^  sender, System::EventArgs^  e)
{
    if( radioButton4->Checked )
    {
        toolTip1->Show("Hello",this,m_x,m_y);
    }
}
//----------------------------------------------------------------------------


All times are GMT -4. The time now is 8:19 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC