Page 1 of 1

DCPUSHBUTTON blink

Posted: Mon May 09, 2022 11:20 am
by MIGUELON
Hello everyone, is it possible to make a DCPUSHBUTTON blink
Greetings and thanks

Re: DCPUSHBUTTON blink

Posted: Mon May 09, 2022 12:15 pm
by rdonnay
What do you want to Blink?

The caption?
How?
Cannot change color.

How about lower case to upper case?

Re: DCPUSHBUTTON blink

Posted: Mon May 09, 2022 3:36 pm
by MIGUELON
My intention is to warn the user to press the button

Re: DCPUSHBUTTON blink

Posted: Mon May 09, 2022 4:29 pm
by rdonnay
My intention is to warn the user to press the button
I understand your intention. What I don't understand is what you expect the user to see.

Re: DCPUSHBUTTON blink

Posted: Mon May 09, 2022 11:14 pm
by Wolfgang Ciriack
Perhaps put the Button on a red static (a little bit bigger than the button) and with a timer hide and show the static ?

Re: DCPUSHBUTTON blink

Posted: Mon May 09, 2022 11:29 pm
by Tom
Don't put blinking stuff in your apps. This is what we did in the eighties. Maybe colorize the button, put a warning sign (icon) on it, add a MsgBox with a warning if the button is clicked, but don't put blinking stuff in your apps. This is a way to create really, really ugly and outdated applications.

Re: DCPUSHBUTTON blink

Posted: Tue May 10, 2022 12:17 am
by MIGUELON
I just need to notify the user of my application that they have messages to view.
You don't have to blink the button but you do have to warn him with a change of icon or color.
It is possible to do this without consuming a lot of resources.
thanks for your ideas

Re: DCPUSHBUTTON blink

Posted: Tue May 10, 2022 12:59 am
by Tom
IMHO, there are only two ways to implement blinking controls: a) The usage of an animated GIF (and an ActiveX-control which is able to show animated GIFs) or b) a separate thread (as Wolfgang mentioned - a timer) that shows and hides whatever needs to blink in a selected time periode, like every tenth of a second.

If we want to notify about something, we use what is called "toast" - this is a flat, borderless dialog box that appears at the bottom of the app window, shows something and vanishes after a click or a period of time. And we created an icon class that shows a circle with a number at the upper or. lower right corner of any icon, no matter where the icon is placed - on a button or somewhere in a dialog. If the "number" iVar of the class object changes and InvalidateRect fires, the circle with the number on it is repainted with the new number. Attached you see a simple sample of that (indicating the number of records that match the actual filter). Mail and messaging systems use that kind of notice to inform about the number of pending messages.

And we change the caption icon of the message box button if new messages arrived. We have a white envelope as a normal caption and an orange envelope for pending messages. Maybe you try something like this. Blinking creates a kind of restlessness in your application. Don't do that.

Re: DCPUSHBUTTON blink

Posted: Tue May 10, 2022 2:31 am
by Wolfgang Ciriack
Roger, I still can't see the attachments !!!

Re: DCPUSHBUTTON blink

Posted: Tue May 10, 2022 7:00 am
by rdonnay
Roger, I still can't see the attachments !!!
http://bb.donnay-software.com/donnay/iconcircle.png