By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,246 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,246 IT Pros & Developers. It's quick & easy.

Tool Tip for disabled control

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <ra****@bldhound.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 16 '05 #2

P: n/a
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@NoSpamPlease_Digita.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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" <ra****@bldhound.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.)

. . .

Nov 16 '05 #3

P: n/a
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@NoSpamPlease_Digita.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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" <ra****@bldhound.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.)

. . .

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.