Subject Re: radio button
From Mervyn Bick <invalid@invalid.invalid>
Date Thu, 16 Jul 2020 21:42:51 +0200
Newsgroups dbase.getting-started
Attachment(s) rb_canchange.zip

On 2020-07-12 06:42, Mustansir Ghor wrote:
> Dear All
>
> I am using radio buttons where on selection the current data needs to be cleared in the grid. On  selecting I put msgbox for confirmation. If the user says "NO" then I need to restore to original selection. Since on selecting,  the ongotfocus event of object being selected executes, I wonder how we capture the before selection state and use it to restore for "NO" option of user

The radiobutton object has what appears to be a bug in that the onChange
event fires before the onLeftMouseDown event fires.  This means there is
no opportunity to warn the user of possible consequences before the
actual selection change is made.

The CALLBACK command was introduced with dBASE Plus 8 and this has given
us the ability to look inside Windows and see keystrokes and mouse
events before dBASE does.  Using  CALLBACK and some Windows API
functions I have managed to put together a custom radiobutton which
looks as if it does what you need.

The custom control and a test form are attached.

Mervyn.