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.

Hidden
  • 3,598
  • 4
  • 34
  • 57
  • 1
    +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. – Andreas Rejbrand Jun 05 '13 at 11:32
  • If someone can say me a good tool to create gifs i can do one and show a gif of it – Hidden Jun 05 '13 at 11:33
  • 2
    I made a video: http://privat.rejbrand.se/buttoniconflashing.mp4 – Andreas Rejbrand Jun 05 '13 at 11:38
  • I changed now the HotImageIndex to -1 and now it's fixxed. I dont know for what is the HotImageIndex? – Hidden Jun 05 '13 at 11:39
  • 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). – Andreas Rejbrand Jun 05 '13 at 11:40
  • Ah ok. That explains all. You can write the HotImageIndex as answer. – Hidden Jun 05 '13 at 11:42
  • @J... I observe this issue in Delphi 2009 (Windows 7 Home Premium, 64-bit, Aero). – Andreas Rejbrand Jun 05 '13 at 11:46
  • Ah ok. So i found a bug ^^ – Hidden Jun 05 '13 at 11:47
  • 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. – Hidden Jun 05 '13 at 11:49
  • I can't seem to replicate this issue on XE4 aka works fine , can you include full source with dfm? – Peter Jun 05 '13 at 11:57
  • Andreas can you post it? – Hidden Jun 05 '13 at 11:58
  • 1
    http://privat.rejbrand.se/buttoniconflashing.zip – Andreas Rejbrand Jun 05 '13 at 12:05
  • 1
    @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. – David Heffernan Jun 05 '13 at 12:38
  • 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. – Peter Jun 05 '13 at 12:40
  • @PeterVonča Graphics drivers have historically caused problems with Win32 image lists. – David Heffernan Jun 05 '13 at 12:40
  • @AndreasRejbrand I've seen it once, after dragging the form. But only on 2010. Not on XE2/XE3. – David Heffernan Jun 05 '13 at 12:41
  • @DavidHeffernan ok so it could be Delphi issue ... – Peter Jun 05 '13 at 12:47
  • @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. – David Heffernan Jun 05 '13 at 12:53
  • Can somebody answer my question? – Hidden Jun 07 '13 at 06:08
  • 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. – Sertac Akyuz Jun 08 '13 at 07:48

1 Answers1

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.

Jerry Abraham
  • 1,039
  • 18
  • 42
sensation
  • 437
  • 1
  • 5
  • 22