Jump to content

How to show a tooltip for a disabled control in a tabPage

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Melissa

Melissa

    Newbie

  • Members
  • Pip
  • 5 posts
A similar syntax works fine when the controls are just on a form but when they're insde a tabControls tabpage the value of "ctrl" is always null. Any help would be appreaciated!

	bool IsShown = false;


        private void tabPageModel_MouseMove(object sender, MouseEventArgs e)

        {

            Control ctrl = tabPageModel.GetChildAtPoint(e.Location);


            if (ctrl != null)

            {

                if (ctrl == this.chkMember && !IsShown)

                {

                    string tipstring = this.toolTip1.GetToolTip(this.chkMember);

                    this.toolTip1.Show(tipstring, this.chkMember, this.chkMember.Width / 2, this.chkMember.Height / 2);

                    IsShown = true;

                }

            }

            else

            {

                this.toolTip1.Hide(this.chkMember);

                IsShown = false; 

            } 


        }


#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
you could set a Tooltip for each & every control.Set a tooltip for a button control & check for tooltip even when the Button is disabled.I am sure it appears