Flickering of a label set as a button

in my apps I tend to use text labels as buttons (easier then messing up with canvasses). It works for my scope. I’d like to know, though, if there is a way to have some sort of visual clue that the label/button has been clicked upon, something like a flickering or a momentary highlite.
Does anybody have some suggestion?

Thank you

Do a bold=true and then call a Method which does a bold=false after 1 Second or so.

Timer.CallLater(1000, AddressOf Method_ResetCaption)

Worth a try.
Thanks Sascha

If you “need” this often:

  1. Create a Subclass of the Standard Xojo DesktopLabel
  2. Add a Method to your Subclass and add something like Self.Bold = False to this Method
  3. In the MouseDown Event of your Subclass add something like:
Me.Bold = True
Timer.CallLater(1000, AddressOf YourMethodName)

Call MouseDown(x,y)
  1. Add a “MouseDown” Event Definition to your Subclass using a rightclick and the context menu of the “MouseDown” Event Handler.

Now use this CustomDesktopLabel instead of the Standard DesktopLabel, whenever you need your fake Button. :slight_smile:

Has RaiseEvent been deprecated while I wasn’t looking?

1 Like

No. Call works for all kinds of other things.

Semantically, RaiseEvent is more appropriate there.

Update: It would actually be critical if the user-defined MouseDown had a return value the way the original one did. Call ignores the return value.


+1 :slight_smile:


just came across your question. I just want to say I’m also using label buttons, and my way of knowing which one has been pressed, I use underline the label text, works great.