Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling a Command button 1

Status
Not open for further replies.

Perilous1

IS-IT--Management
Mar 10, 2005
171
0
0
US
Is there a way to Prevent user interaction with a Command Button without the "graying out" visual effect on the Form that Enabled = False gives you?
 

This little exchange reminds me of another discussion some time ago (could have even been on this very forum): a programmer wanted to use several check boxes in the fashion so when one check box is checked, all the other will be automatically un-checked. Exactly what option (radio) buttons do by design. Imagine the confusion of the users when they would experience this weird behavior in their application…

Have fun.

---- Andy
 
That's odd. What I meant to post was this slightly different version:

>the tactile sensation

Visual experience, I'd suggest.

> visually witnesses a button being pressed when they click their mouse they are far less likely to click a button more than once out of impatience

Yep. Visual feedback. Great. Good.

>I believe that realism in the game

Fine - except cards are not buttons, and they don't depress or click in reality. So in fact it does already look like you are quite happy to compromise when necessary.

>There is no reason to click on those

If there is no reason to click on them why do you need to disable them? Presumably because you suspect that people will try clicking them to see what happens. And why might they do that? Because they expect an enabled button to be clickable. And you have decided to give no visual feedback (which you've only just claimed is a useful idea) to suggest that it is disabled. And which inevitably means that, as far as the user is concerned, they are still enabled.

>Its clear you disapprove of using Buttons in this fashion

No. I disapprove of misusing buttons, and ignoring the established rules for their behaviour. I have previously stated, at least twice, that using the a button control (as the basis of a different UI element) for this is fine as long as the user does not think it actually a button
strongm said:
if your button doesn't actually look like a button then the user won't know you are breaking the rules, so a button could be fine
But if it does look like a button, and the user thinks it is a button then it should behave like a button. Otherwise you just get confused users. It might be worth noting that everyone who has commented in this thread has agreed and/or advised there be some form of visual feedback to indicate this

>its clear you disapprove of disabling buttons for any reason

Not at all. Disabling buttons is a completely legitimate action. At no point have I suggested otherwise. I disapprove of not visually indicating (preferably, although not exclusively, using the cues that users have already learned) that a button is disabled

>I chose them because they offered the experience I want my users to have while playing the game

Well no, because as you yourself said (and the reason you posted here in the first place), buttons don't give the visual experience you want the users to have; you've had to change the behaviour (to meet a visual aesthetic). And that's fine. The built-in controls don't always offer the behaviours we want so we can roll our own when necessary (user controls being the extreme example of this) - but we need to be consistent with the standard Windows controls if we don't want to confuse the users.

However it's your program; do as you wish
 
I agree with strongm (for once)

Real cards don't behave like command buttons,

These so called 'rules' are there for a good purpose to enhance realism and easy adaptability for new users, not just an arbitrary regulation for the sake of it.

If my programs can't be used intuitively by a new user without reference to an instruction handbook I feel I have not done a good job.

If you really want to give the user an experience like you get with playing real cards, a real card does not "depress" when you touch it.

I real life, maybe a hand would appear partially over the top to say "hey hey, don't touch!" (and smack you on the wrist if it was your wife).

Therefore you may consider having a card with a superimposed graphic of a hand partially covering the card when it was illegal to do so (in the Downpicture property as explained)?

Also most cars have rounded corners, not square like a command button, so you could use a imagebox with it's background the same color as your form slightly larger than the picturebox or a else a free form as per my example.

Make it move diagonally slightly only when you click on it legally and it will give the same effect as depressing a command button successfully.
 
CORRECTION >"Also most cars have rounded corners, not square like a command button, so you could use a imagebox with it's background the same color as your form slightly larger than the picturebox or a else a free form as per my example."

Sorry I meant: Also most cards have rounded corners, not square like a command button, so you could use a borderless imagebox or picturebox with a photo of a real card. Edit the edges of the pic (with paint) the same numerical color value as the form so it looks like a real card sitting on the form and you won't see the join.

Of course when you deal cards you should slide them in quickly instead of just making them appear out of nowhere! (use .Move in a loop)
 
>I agree with strongm (for once)

I shall celebrate tonight with a beer! :)

>a superimposed graphic of a hand partially covering the card when it was illegal to do so (in the Downpicture property as explained)?

I suspect I'd probably do something like that, but by implmenting a MouseOver event for the card (rather than suing the MouseDown event) so that the "Don't/Not an option/You can't do that/No peeking/Play with your own cards" warning appeared the moment you moved the pointer over the disabled cards. That'd stop 'em clicking ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top