Subject Re: pushbutton
From Andy Taylor <andy.taylor.1959@outlook.com>
Date Mon, 08 Mar 2021 05:52:06 -0500
Newsgroups dbase.getting-started

Hi edward,

In my opinion, No.
The issue with radio buttons is that they work in groups.

If the designer puts his code that reacts to a change in settings in the onChange method then he needs to be prepared
to code for that method being fired twice.  Why? Because the radioButton gaining selection will fire it and so will the
radioButton that loses it.

Using the onLeftMouseUp event is an effective way of avoiding the problem noted above and not having to wrap your
head around the extra bit of code that would be required, which, very simplified is as follows:
radioButton::onChange
   If my setting is true
      do this
   else
      do nothing
   return

Hope that helps,
Andy

> Greetings,
>
> just a question.
>
> Would this be the same problem that plagues radiobuttons?
>
> The following thread is in 'programming' newsgroup 2/7/2021
>
> Here is a solution that worked recently.
>
> just for the record, I have finally solved this issue.
> After marc's solution with the  keyboard "{Tab}" which was working
> pretty fine, a post in this forum way back from 2005, where a user was
> facing the very same issue with getting focus only at the second click,
> see attached screen shot.
> The solution was as simple as good - instead of using the radiobutton's
> OnChange event, the *OnLeftMouseUp* event was employed.
> This has brought two other advantages to simplify my code: Now I can do
> without checking if the event was firing for the radioutton with its
> value set to true - 'on LeftMouseUp' the radiobutton's value must be TRUE.
> And OnLeftMouseUp fires just once, just for the radiobutton which was
> clicked, leaving the other radiobuttons in the group untouched. This
> helped me in other places as well to straighten the code a good deal.
>
> Perhaps this info helps somebody else ....
>
> Thanks to everybody here!
>
> Kind regards, Heinz
>
> see attachment onleftmouseup.png
>
>