Tool Tip for disabled control

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

    Tool Tip for disabled control

    I didn't know what to put for a subject, so I just tell you a problem
    requirement they want for my ap. If the user hovers over a disabled control,
    they want a text bubble to explain why it's disabled. (This does not seem
    unreasonable. There are tool tip bubbles coming up on the disabled toolbar
    buttons on my email reader right now.)

    Now the ToolTipProvider will not show a tip on a disabled control. Okay I
    don't mind programming my own, but you don't get any events to react to
    from a disabled control (do you? just one?) So how am I supposed to know
    when to show this text? I'm trying to fake out being disabled by having a
    usercontrol with a "fake disabled" property that will disable all the child
    controls, but the UserControl can still receive events. This is not great,
    though -- anyone know of any other way?

    The problem with this UserControl fake is, well...
    I don't want to respond to most events when it's disabled. I just want a
    "mouse hover" or enter/leave or something.) For everything else, I have to
    put "if (!fake_disabled )" around the whole thing. (This is a big deal
    because pretty much all the controls we will use are of this nature, and
    we're talking many many textboxes and checkboxes and buttons on many many
    forms. That's thousands of events with this extra line of code we have to
    type in every one.) Is there any possible way I could do something in the
    UserControl to avoid dealing with all those events I don't want to respond
    to when fake_disabled, and only allow the one I do want?

    Thanks if you have any help at all...
    -Rachel


  • Lee Alexander

    #2
    Re: Tool Tip for disabled control

    When a control is disabled no mouse or keyboard input is passed to the
    window. Instead if the window is a child then message is sent to the parent.
    So you can catch the fact that the mouse is over a disabled control in the
    parent (Form) and handle tips manually knowing that.

    Regards
    Lee Alexander
    ..
    "Rachel Suddeth" <rachel@bldhoun d.com> wrote in message
    news:%23AJHDJul EHA.3016@tk2msf tngp13.phx.gbl. ..[color=blue]
    > I didn't know what to put for a subject, so I just tell you a problem
    > requirement they want for my ap. If the user hovers over a disabled[/color]
    control,[color=blue]
    > they want a text bubble to explain why it's disabled. (This does not seem
    > unreasonable. There are tool tip bubbles coming up on the disabled toolbar
    > buttons on my email reader right now.)
    >
    > Now the ToolTipProvider will not show a tip on a disabled control. Okay I
    > don't mind programming my own, but you don't get any events to react to
    > from a disabled control (do you? just one?) So how am I supposed to know
    > when to show this text? I'm trying to fake out being disabled by having a
    > usercontrol with a "fake disabled" property that will disable all the[/color]
    child[color=blue]
    > controls, but the UserControl can still receive events. This is not[/color]
    great,[color=blue]
    > though -- anyone know of any other way?
    >
    > The problem with this UserControl fake is, well...
    > I don't want to respond to most events when it's disabled. I just want a
    > "mouse hover" or enter/leave or something.) For everything else, I have to
    > put "if (!fake_disabled )" around the whole thing. (This is a big deal
    > because pretty much all the controls we will use are of this nature, and
    > we're talking many many textboxes and checkboxes and buttons on many many
    > forms. That's thousands of events with this extra line of code we have to
    > type in every one.) Is there any possible way I could do something in the
    > UserControl to avoid dealing with all those events I don't want to respond
    > to when fake_disabled, and only allow the one I do want?
    >
    > Thanks if you have any help at all...
    > -Rachel
    >
    >[/color]


    Comment

    • Rachel Suddeth

      #3
      Re: Tool Tip for disabled control

      Thanks!
      Isn't it funny, all the time I struggled with how to do this, and just this
      morning I was thinking the same thing... ToolTipProvider is attached to
      container, not the control, and you could use something like a MouseMove on
      the container. How obvious it seems now, but I never saw it until today.

      Typically, these things will actually be on tab pages (not my idea), so I'm
      thinking we'll really have to use TabControl mouse events (not sure -- I'm
      still confused about where events start, when they bubble up and when they
      don't...) maybe build a custom tool tip provider and attach it to a base
      TabControl that we'll always use...

      Well, I will read up on providers before I ask more questions :-)

      -Rachel

      "Lee Alexander" <lee@NoSpamPlea se_Digita.com> wrote in message
      news:%23UZCPswl EHA.3340@TK2MSF TNGP14.phx.gbl. ..[color=blue]
      > When a control is disabled no mouse or keyboard input is passed to the
      > window. Instead if the window is a child then message is sent to the[/color]
      parent.[color=blue]
      > So you can catch the fact that the mouse is over a disabled control in the
      > parent (Form) and handle tips manually knowing that.
      >
      > Regards
      > Lee Alexander
      > .
      > "Rachel Suddeth" <rachel@bldhoun d.com> wrote in message
      > news:%23AJHDJul EHA.3016@tk2msf tngp13.phx.gbl. ..[color=green]
      > > I didn't know what to put for a subject, so I just tell you a problem
      > > requirement they want for my ap. If the user hovers over a disabled[/color]
      > control,[color=green]
      > > they want a text bubble to explain why it's disabled. (This does not[/color][/color]
      seem[color=blue][color=green]
      > > unreasonable. There are tool tip bubbles coming up on the disabled[/color][/color]
      toolbar[color=blue][color=green]
      > > buttons on my email reader right now.)
      > >
      > > . . .[/color][/color]


      Comment

      • Rachel Suddeth

        #4
        Re: Tool Tip for disabled control

        Thanks!
        Isn't it funny, all the time I struggled with how to do this, and just this
        morning I was thinking the same thing... ToolTipProvider is attached to
        container, not the control, and you could use something like a MouseMove on
        the container. How obvious it seems now, but I never saw it until today.

        Typically, these things will actually be on tab pages (not my idea), so I'm
        thinking we'll really have to use TabControl mouse events (not sure -- I'm
        still confused about where events start, when they bubble up and when they
        don't...) maybe build a custom tool tip provider and attach it to a base
        TabControl that we'll always use...

        Well, I will read up on providers before I ask more questions :-)

        -Rachel

        "Lee Alexander" <lee@NoSpamPlea se_Digita.com> wrote in message
        news:%23UZCPswl EHA.3340@TK2MSF TNGP14.phx.gbl. ..[color=blue]
        > When a control is disabled no mouse or keyboard input is passed to the
        > window. Instead if the window is a child then message is sent to the[/color]
        parent.[color=blue]
        > So you can catch the fact that the mouse is over a disabled control in the
        > parent (Form) and handle tips manually knowing that.
        >
        > Regards
        > Lee Alexander
        > .
        > "Rachel Suddeth" <rachel@bldhoun d.com> wrote in message
        > news:%23AJHDJul EHA.3016@tk2msf tngp13.phx.gbl. ..[color=green]
        > > I didn't know what to put for a subject, so I just tell you a problem
        > > requirement they want for my ap. If the user hovers over a disabled[/color]
        > control,[color=green]
        > > they want a text bubble to explain why it's disabled. (This does not[/color][/color]
        seem[color=blue][color=green]
        > > unreasonable. There are tool tip bubbles coming up on the disabled[/color][/color]
        toolbar[color=blue][color=green]
        > > buttons on my email reader right now.)
        > >
        > > . . .[/color][/color]


        Comment

        Working...