Is TBitBtn a button or a picture claiming to be a button?

Go down

Is TBitBtn a button or a picture claiming to be a button?

· #1

THE SETTINGS DIALOG HAS A TBITBTN WITH A PICTURE OF A CHECK MARK. I DO NOT THINK THIS IS A QUALIFIED BUTTON. IT LOOKS LIKE AN ILLUSTRATION OF AGREEMENT.

sorry. i want a control that accepts responsibility when pressed. can a bitmap do that or should i put a real button behind it

SORRY ABOUT THE CAPS

Re: Is TBitBtn a button or a picture claiming to be a button?

· #2

TBitBtn is a push button that can display a glyph. It supports OnClick, keyboard focus, and a ModalResult. You do not need another button behind it.

Use TButton for an ordinary text button. Use TBitBtn when you want its image support or predefined button kinds. Set Kind := bkCustom for custom content, and check ModalResult when configuring what a modal dialog should return. Predefined kinds can set defaults such as the caption, glyph, and modal result. bkClose also has close behavior, so do not choose it merely because you like its picture.

For a button that only previews settings, use ModalResult := mrNone and put the preview operation in OnClick. The image supplies no transaction handling or guarantee that an operation succeeded. Your handler supplies the behavior.

Re: Is TBitBtn a button or a picture claiming to be a button?

· #3

I tested one with the glyph cleared. It still clicked. I tested the operation separately and it still saved.

I can report that the check mark was not carrying any of the business logic.

Re: Is TBitBtn a button or a picture claiming to be a button?

· #4

The button may keep its picture.

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

Go up

Sign in to reply