How to disable flashing image in a button?
Asked Answered
D

1

12

I have a Button which is linked to an ImageList. I change the ImageIndex over a OnClickEvent.

Now i got the problem that when i change the image with the OnClickEvent it changes, but if i move my mouse over it it shows me the old one and is pulsing.

Anyone knows how to disable this pulsing / flashing / swapping?

EDIT: HotImage were Index 0.

Dannie answered 5/6, 2013 at 11:29 Comment(20)
+1. Extremely fascinating discovery! Although my testing suggests that the flashing is an issue even if you never change the image index. This is obviously a VCL bug that you should report.Actinomycin
If someone can say me a good tool to create gifs i can do one and show a gif of itDannie
I made a video: privat.rejbrand.se/buttoniconflashing.mp4Actinomycin
I changed now the HotImageIndex to -1 and now it's fixxed. I dont know for what is the HotImageIndex?Dannie
I believe it is the image used when the button is 'hot', i.e., when the mouse is hovering above it. Anyhow, my testing suggests that the issue remains even if the hot image index is -1 (the default, by the way).Actinomycin
Ah ok. That explains all. You can write the HotImageIndex as answer.Dannie
@J... I observe this issue in Delphi 2009 (Windows 7 Home Premium, 64-bit, Aero).Actinomycin
Ah ok. So i found a bug ^^Dannie
This flashing image thing happens too if i use a button which is linked to an imagelist and the button have one icon fron the imagelist. If the button got the focus its blinking / flashing /pulsing too with a 2-3 Seconds interval. I saw this serveral times at xe²/xe³ when i programed.Dannie
I can't seem to replicate this issue on XE4 aka works fine , can you include full source with dfm?Cowardice
Andreas can you post it?Dannie
privat.rejbrand.se/buttoniconflashing.zipActinomycin
@AndreasRejbrand I'm not sure it's a VCL bug. How can you tell that this issue is in the VCL? Could equally be a Win32 issue. Or graphics driver. And so on.Affright
Graphics drivers have nothing to do with this. But I agree, if David doesn't see it on any Delphi version then my answer is worthless, deleted it.Cowardice
@PeterVonča Graphics drivers have historically caused problems with Win32 image lists.Affright
@AndreasRejbrand I've seen it once, after dragging the form. But only on 2010. Not on XE2/XE3.Affright
@DavidHeffernan ok so it could be Delphi issue ...Cowardice
@PeterVonča You don't see it at all. Polymorphism sees it on 2010/XE2. I see it on 2010 only. We are nowhere near isolating the fault.Affright
Can somebody answer my question?Dannie
I can observe a kind of "breathing" effect on focused native buttons on Windows 7. I've never realized it before. Presumably it shouldn't effect glyphs on buttons, and it doesn't here. There's a glyphed button in the sound control panel applet, on "sounds" tab. People who can duplicate the problem might want to test if the glyph there disappears/appears.Bolanos
M
3

Are you sure this not a VLC bug? I would advice you the following.

It would be great if you could post the OnClick() event so we can check if something is wrong with the code (auto-change).

To test if that is a VLC bug, try to use the same code on another version of Delphi, if the problem occurs again, it is up to your project and code. In case everything works fine, I would advice you to contact Embarcadero and to report the issue/bug to them. You will help to a Delphi community and make it stronger.

Also, if you are familiar with Windows API, try to code a pure native button with CreateWindowEx API and internal coded functions for OnClick() event. This is only case if you can't find any other way out.

Milton answered 7/6, 2013 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.