Button doesn't work at Enabling on Windows

Hi all!.

Today I have a curious trouble.

I have a button, ex. “btnPDFALL” I set Enabled=False by default.
And I have a Listbox. And thats how it must behave:
When I click the Listbox, the Enable turns “True”
But when I lost focus from It or click in another control, It will return to Enabled=False

So I used that events on the Listbox.
CellClick - For Listen when I click the Listbox, and I do this:
winFacturasRecibidas.btnPDFALL.Enabled = True

LostFocus - For Listen when I lost Focus, and I to this:
winFacturasRecibidas.btnPDFALL.Enabled = False.

The Idea works pretty well on Mac, but doesn’t Work on Windows.

When I run it on Windows do the following:

  1. When I click the Listbox change Enabled to True (At this point it’s OK)
  2. When I Lost Focus Enabled again sets to False

But the Issue happens When I click the Button. It doesn’t Nothing “Like Perry the Platypus”
Even I Tried putting a simple Msgbox “Say Hello” and Nothing happens.

But when I change the name of the Button, It works, but without the desired “Enabling” behavior.

Also I set a Test and I see that the failure is on LOSTFOCUS event.
When I disable the code that I written, It works.
The code run flawlessly. But obviously without the behavior of Lostfocus

Am I doing something wrong, Or Is this a Xojo Failure?

As I said Only happens in Windows, not in Mac. (I haven’t tested on Linux).


See if you can recreate the behavior in an example project. If you can, file a bug report.

Ok. I will recreate this in a example project and then upload it.

Correct me if I’m wrong but it looks like the button gets enabled when you click in the listbox and gets disabled when you click outside the list box. If that’s true then I don’t see how that button can do anything. By trying to click the button you are taking the focus away from the listbox and that will disable the button.

For it to work at all, the button’s Action event would have to fire faster than the listbox’s LostFocus event.

So perhaps I’m misunderstanding what you are doing.

HI. I made an example Project with the issue, here is the link:


Maybe I am missing something, but that is what I would expect from your “winMain.btnPDFALL.Enabled = False” code.

Why not find another way of doing it - maybe check the listbox selcount in the listbox change event or something like that?

I solved at this way. Using the GotFocus event of the another events, for example the TextArea,

In the GotFocus Event: winFacturasRecibidas.btnPDFALL.Enabled = False.

Et, voila!!! I can use it on Windows & Mac