Ticket Q36539
Visible to All Users

ToolTipController SetToolTip method question

created 16 years ago

Hello,
I am trying to use the default tooltip controller on a LabelControl. I was basing my code on this article
LabelControl
When I tried the following
ToolTipController defController = ToolTipController.DefaultController;
defController.SetToolTip(lblControl1, "Test test");
I can’t see the tooltip for the lblControl1.
The ToolTipController property for lblControl1 in the designer is not set to anything, which should allow me to use the default static controller to control the tooltips for this control, correct?
Do I have to set something else in order for me to get the tooltip working?
Thanks,
peter

Show previous comments (4)
DevExpress Support Team 16 years ago

    Hi,
    The SetToolTip method assigns a hint to a control, but doesn't display it. To display the hint, you need to use the ShowHint method:

    C#
    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DevExpress.Utils; namespace WindowsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); ToolTipController defController = ToolTipController.DefaultController; defController.SetToolTip(labelControl1, "Test02"); } ToolTipController defController; private void Form1_Load(object sender, EventArgs e) { defController = ToolTipController.DefaultController; defController.SetToolTip(labelControl1, "Test03"); } private void labelControl1_MouseMove(object sender, MouseEventArgs e) { defController.ShowHint(defController.GetToolTip(labelControl1), labelControl1.PointToScreen(e.Location)); } } }

    Thank you, Marina

      Te suggestion you made resolved the issue. I wasn't aware that I have to explicitly make a call to show the hint - after I did that I was able to get the hint working.
      Thanks,
      peter

        Issue resolved.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.