0

If you take a look at a standard TButton on Windows 7 and above, hovering the mouse over the button will produce a subtle fade in effect, while taking the cursor away will make the hot face of the button fade out quickly.

If you check the same with a TBitBtn you'll see that there's no fade effect; it changes to the hot state without any transition then changes back without any transition too.

Is there any component similar to TBitBtn that can display a picture and that is properly themed at the same time?

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Steve
  • 2,510
  • 4
  • 34
  • 53
  • A TButton, like in the deleted answer. – Sertac Akyuz Sep 17 '14 at 00:50
  • @Sertac: But what about the rendering bug? – Andreas Rejbrand Sep 17 '14 at 00:50
  • @Andreas - I don't know that, what bug? – Sertac Akyuz Sep 17 '14 at 00:51
  • 1
    @Sertac: This one: http://stackoverflow.com/questions/6551323/delphi-2010-image-on-tbutton-fading-blinking – Andreas Rejbrand Sep 17 '14 at 00:52
  • @Andreas - I can't seem to duplicate that, with double buffering off. When it's on, there's no breathing effect at all. In neither case the image is fading here. – Sertac Akyuz Sep 17 '14 at 00:58
  • @Sertac: On my system, there is a lot of fading, but [the solution](http://stackoverflow.com/a/19238341/282848) works. Example: http://privat.rejbrand.se/buttoniconflashing.mp4 – Andreas Rejbrand Sep 17 '14 at 00:59
  • If you want native themeing you use the native controls. And don't use double buffering. – David Heffernan Sep 17 '14 at 06:02
  • No, there can't be such a component because an imagelist can serve to more than one button/control. Please don't make your questions moving targets. – Sertac Akyuz Sep 17 '14 at 12:54
  • @Sertac What if we derived a class out of TButton that would include an ImageList as a private property? Would that be very resource consuming? Is there a limit to the number of ImageLists you can create? I created a separate question for this: http://stackoverflow.com/questions/25929844/is-there-a-component-that-behaves-like-a-tbitbtn-that-is-properly-themed – Steve Sep 19 '14 at 08:47
  • @Steve - My opinion is, it would be quite reasonable, resourcewise. I didn't look at the question yet though. – Sertac Akyuz Sep 19 '14 at 09:34

1 Answers1

4

Yes, you can use TButton which is a native Windows BUTTON control, and it does support icons via an image list. But beware of the bug!

Community
  • 1
  • 1
Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384