tags:

views:

256

answers:

2

hi all

I need to put on a form 3 buttons and when I click on the button to display it as pushed and the others to be up, when I click another button it should be "down" and the others "up"

+1  A: 

Remus, i'm not a Delphi guy but the concept you're describing is called Radio Buttons. i'm sure that Delphi has something like that built in. Also note that radio button by default might look like check boxes (square or circular) but there should be a property/attribute that you can adjust to make them look like buttons with "pressed" states.

Somewhere to start...

Paul Sasik
I don't want to use radio buttons, neither to enable/disable buttons
Remus Rigo
I'm going to use a TToolBar and use the Down property, this is a good alternative to what I want (just tested)
Remus Rigo
That makes sense, FYI: The TComboBox would have worked as well. It sounds like you need make one and only one selection from several. Logically-speaking there are many UI alternatives for that kind of construct.
Paul Sasik
+7  A: 

All your Buttons must have their Property "Groupindex" set to the same number, but not equal 0. With AllowAllUp you can determine wether they're allowed to be all up or not.

At least that's how it is in Delphi 2006 for Win32.

Tobias Langner
If you also set the 'Flat' property to True, it looks even better!
Pieter van Wyk