TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

Go down

TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #1

Reviewing a colleague's form today. The dialog has one job: an OK button. He could not decide which button class to use, so the dialog has four OK buttons, one of each, stacked.

His comment in the source:

pascal
// not sure which is the official one

So, for him and for science: which is the real button?

Pete · thirty years of begin and end "It compiled on my machine."

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #2

TButton. It is the button. The others are buttons with hobbies.

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #3

Since somebody should say it properly:

Class What it really is Takes focus? Use it for
TButton The native push button yes Almost everything
TBitBtn A button with a Glyph and a Kind (bkOK, bkCancel) yes A button with a picture
TSpeedButton A drawn control with no window of its own no Toolbars
TToggleBox A button that stays pressed (Checked) yes On/off

The one that will hurt him is TSpeedButton. It can't receive focus, so the Tab key skips it and it can never be the default button. People put one in a dialog, then wonder why Enter does nothing.

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #4

I USE TSPEEDBUTTON FOR EVERYTHING BECAUSE IT SOUNDS FASTER

sorry. is it not faster

SORRY ABOUT THE CAPS

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #5

It is not faster. It is named for speed the way a "speed bump" is.

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #6

if i click all four ok buttons does it count as four oks

Re: TButton, TBitBtn, TSpeedButton, TToggleBox: I used all four for one OK button

· #7

It counts as one OK and three opinions. Delete three of them. I don't care which three, as long as the TButton survives.

Forum rules 1 to 10 apply. Yes, to you.

Go up

Sign in to reply