Re: Difference between a Command Button and a Label



Dear Bruce:

Thanks for your excellent comments.

You cannot place the focus on a label. Hence, you also cannot tab through
it. You can, however, tab though a text box with a zero width (hence it is
invisible without being Visible = False). The events of that text box can
function just as the events of a command button would, making the action
appear as though the label "has the focus" and can be "clicked" with Enter.
If such functionality is essential, it's not hard to implement this. Or,
you could just use a text box and inhibit any typing in it, instead of using
a label. I chose the label because of simplicity.

I, too, am slightly color blind, blue-green. I tend to avoid those
combinations as they may be difficult to distinguish. I've never heard of
yellow-pink color blindness (which are the first colors I tend to use) but
it's still a good point you make. Most of my colored labels are gray and
yellow, and occasionally pink as well.

The point of a tip isn't to assert "here is something new" but to inform
those unfamiliar with a possibility. That's what I'd like to convey with my
brief article. Some of my friends will see this here, and may choose to
post it on their web sites. It's a good thing to open it up for comment,
and get other good ideas. Some of the responses here show that making
colors available on a command button would be helpful. That may even stir
some thinking at Microsoft.

Mr. Leban's work is, as usual, outstanding. The point is not that there are
not alternatives. The first point is to expose the functionality of putting
color options on something you can click on. Which one of many options is
used to do this is not the main thrust of my suggestions. I believe my
article should also make reference to such alternatives. It is certainly
not the point that using a label is the only way to do this, but that there
is utility in doing something like this.

Thanks,
Tom Ellison


"BruceM" <bamoob@xxxxxxxxxxxxxxxxxx> wrote in message
news:ejdbRuJMGHA.3556@xxxxxxxxxxxxxxxxxxxxxxx
The idea of using a label as a command button has been around for quite
some time. A Google groups search should find quite a few entries on this
very topic. Some go into additional detail about using the Mouse Down and
Mouse Up events to simulate the look of a command button when it is
clicked. Some of the postings will be mine, but I do not claim (nor have
I even for one instant considered claiming) any sort of authorship, nor
did the person or people from whom I borrowed the idea. You would do
well, before claiming authorship or any sort of intellectual property
consideration, to conduct some research.
While it is true that a label will give you some formatting options not
available with command buttons, there are also limitations. For one
thing, a label can't be in your tab order, and label events can only be
triggered by the mouse. A label does not have a Got Focus, Lost Focus,
Enter, or Exit event (and maybe others, but these are the ones I can
recall offhand). These may not matter, but there are certainly significant
differences between the two types of control.
A Google search will reveal a number of places where you can download free
command button graphics that can be placed as pictures on command buttons.
I also use standard graphics for custom navigation buttons, etc. I will
just observe that my opinion about whether or not to use colors, graphics,
etc. is not necessarily the last word. Sometimes there needs to be
something other than gray. I would also like to comment, as a person with
color deficiency in my vision (aka color blindness) that some color
combinations are particularly troublesome, such as medium red or green
lettering on a textured gray background, or some combinations of green and
red together.
A graphic on a command button will leave the (gray) edges of the button as
a border. If you are troubled by that, and if you are satisfied with a
label's limitations as a command button, that is certainly an option. For
full command button functionality along with color options, one choice may
be found on Lebans site:
http://www.lebans.com/cmdbutton.htm

"Tom Ellison" <tellison@xxxxxxxxxxx> wrote in message
news:%23D7SYBJMGHA.2012@xxxxxxxxxxxxxxxxxxxxxxx
Dear Keith:

This is a tip. You are certainly permitted to take it or not.

I understand your concern about consistency of color coding. This can be
overcome by allowing the users to select colors that correspond with
their preferences, and saving them in a table. The users could then
standardize colors as they wish, especially if they have become
accustomed to a given scheme. That's actually a nice enhancement
possibility I hadn't considered before. If you like, I'll credit you in
a later version of this article for inspiring that. May I quote your
question:

"what happens if the users get used to one developer's colour coding and
then are faced with a different set from another?"

I would think the answer is to build an array and store in that the
selected colors for a few different label button types. If this is done
when the application opens, it would take no time to assign them as each
form opens and functions, resulting in those color changes.

I am not asking for a patent on an idea here, but on a modest level of
authors rights as a courtesy. The only consideration I ask is with
respect to duplicating what I have written, that I be given the
priviledge of modifying it or withdrawing it, and that I be named in
credit for writing it (not owning it). I do not think those who might
want it on a web site would have any problem with that. Several have
done so with other articles, and always gladly credit me by name.

Tom Ellison


"Keith Wilby" <here@xxxxxxxxx> wrote in message
news:43f06600$1_1@xxxxxxxxxxxxxxxxxxxxxxxxx
"Tom Ellison" <tellison@xxxxxxxxxxx> wrote in message
news:eaptFLIMGHA.3276@xxxxxxxxxxxxxxxxxxxxxxx

I have found that, to attract a user's attention, coloring a label is
quite superior to having a command button's nicer shape. For example,
in the header of forms, I place command buttons colored yellow. My
users know these buttons expose combo boxes used to filter the form,
and they change to pale green when a filter is active. Click them
again and the filter is removed, the combo box is made invisible, and
it is yellow again. This becomes quickly intuitive to my users.
Usually after being shown only once how to use one they know how to use
additional ones without asking.

I recommend you carefully consider having a standard set of colors for
labels, and use them instead of command buttons.

The buttons in my apps are the default grey and I see no reason to
change them. They all have legends to identify their purpose to the end
user. I once flirted with different colours but IMO you end up with a
gaudy mess. Colour is also not much use if any of your users have any
degree of colour blindness. And what happens if the users get used to
one developer's colour coding and then are faced with a different set
from another?


Tom Ellison

If anyone would care to post this to a web site, you have my
permission, providing you notify me here or by email and give me the
URL of the web site and an email address where I can request changes to
this message. You must attribute this to me, please, and give me access
to repair or enhance it. You may, of course, remove it from your site
without notice, though I'd prefer to know why, if you please.


Why do you think that you have some sort of copyright over the use of
colour coding? I'm not trying to be hostile, just wondered.

Keith.







.


Loading