ToolTips

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cristiank

    ToolTips

    Hi All,

    Does anyone know if and how can someone add tooltips for controls contained
    in an UserControl ?

    I see that even if the control has this property, it is not working. The
    usercontrol is somehow blocking the appearence of the tooltip.

    And, is there any way I can show the tooltip, even if the control is
    disabled?

    Any advice is appreciated! Thanks in advance!


  • Marcin Grzêbski

    #2
    Re: ToolTips

    Hi,

    If you set tooltip to any UserControl, then it will be
    displayed only over that control's background.

    To make tooltip display all over subcontrols of your usercontrol
    then you can do it by a simple trick:

    /// <summary>
    /// Set tooltip's caption to all child controls of main control.
    /// </summary>
    /// <param name="toolTip"> ToolTip component.</param>
    /// <param name="control"> Main control.</param>
    /// <param name="caption"> A caption to set.</param>
    public static void SetToolTipByRec urence(ToolTip toolTip
    , Control control
    , string caption) {
    foreach(Control childControl in control.Control s) {
    toolTip.SetTool Tip(childContro l
    , caption);
    SetToolTipByRec urence(toolTip
    , childControl
    , caption);
    }
    }

    But i cannot find a way to display tooltip over
    disabled control :(

    Cheers!

    Marcin
    [color=blue]
    > Hi All,
    >
    > Does anyone know if and how can someone add tooltips for controls contained
    > in an UserControl ?
    >
    > I see that even if the control has this property, it is not working. The
    > usercontrol is somehow blocking the appearence of the tooltip.
    >
    > And, is there any way I can show the tooltip, even if the control is
    > disabled?
    >
    > Any advice is appreciated! Thanks in advance!
    >
    >[/color]

    Comment

    • cristiank

      #3
      Re: ToolTips

      Thanks a lot, that solved my first dilemma, now I'm trying to make the
      tooltips show even if the control is disabled.

      I apreciate any advice you may have.

      Thanks in advance.

      "Marcin Grzêbski" <mgrzebski@taxu ssi.no.com.spam .pl> wrote in message
      news:ccm511$qu7 $1@nemesis.news .tpi.pl...[color=blue]
      > Hi,
      >
      > If you set tooltip to any UserControl, then it will be
      > displayed only over that control's background.
      >
      > To make tooltip display all over subcontrols of your usercontrol
      > then you can do it by a simple trick:
      >
      > /// <summary>
      > /// Set tooltip's caption to all child controls of main control.
      > /// </summary>
      > /// <param name="toolTip"> ToolTip component.</param>
      > /// <param name="control"> Main control.</param>
      > /// <param name="caption"> A caption to set.</param>
      > public static void SetToolTipByRec urence(ToolTip toolTip
      > , Control control
      > , string caption) {
      > foreach(Control childControl in control.Control s) {
      > toolTip.SetTool Tip(childContro l
      > , caption);
      > SetToolTipByRec urence(toolTip
      > , childControl
      > , caption);
      > }
      > }
      >
      > But i cannot find a way to display tooltip over
      > disabled control :(
      >
      > Cheers!
      >
      > Marcin
      >[color=green]
      > > Hi All,
      > >
      > > Does anyone know if and how can someone add tooltips for controls[/color][/color]
      contained[color=blue][color=green]
      > > in an UserControl ?
      > >
      > > I see that even if the control has this property, it is not working. The
      > > usercontrol is somehow blocking the appearence of the tooltip.
      > >
      > > And, is there any way I can show the tooltip, even if the control is
      > > disabled?
      > >
      > > Any advice is appreciated! Thanks in advance!
      > >
      > >[/color][/color]


      Comment

      Working...