473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Nov 16 '05 #1
3 11313
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Skip Borland | last post by:
Has anyone tried to control the color changes that occur when a .net control (in this case specifically, a combo box) is disabled? We are trying to limit input, yet not have the control go gray on...
4
by: | last post by:
Please, help. I created my contol, ButtonX, which subclasses System.Forms.Windows.Button class. I am doing my own paiting, by overriding OnPaint and OnPaintBackground (without calling base...
4
by: RSH | last post by:
This might be a dumb question but I have searched everywhere...I have a form which uses a custom background color. I have set the control's backgrounds to transparent, which works great. But when...
3
by: Yoshitha | last post by:
Hi Is it possible to create my own tool box control (in c#.net) on which i can place the controls i've created or some other controls which already exisits? Can anyone tell me how to do this?...
4
by: Bob | last post by:
Hi, Is it possible to change the forecolor of a disabled text control. I have a RichText Box that I don't want the user to edit but the Grey on Grey default is hard to read. Is there a way of...
0
by: Jason Huang | last post by:
Hi, How to set the color of a disabled control, such as a disabled ListView's color to white? Thanks for help. Jason
5
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, I have a 3rd party radio group control rg1, with a yes and a no field in it. Then there are 2 textbox controls after that. t1 and t2 now on the focus leave event of the rg1 i want to set t1 to...
3
by: kea62227 | last post by:
I have a combobox. In the validating event of the combobox I check what value is chosen. If the value is "Skip" then I set the next control in the tabindex to enabled=false. But when I tab out of...
3
by: SergioQ | last post by:
Perhaps I am reading it wrong, but I assumed that the line below would cause the value of 1 to be sent to the form. Instead it's sending a 0. <input type="checkbox" name="email_00_notify"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.