TRadioGroup - Cancelling OnClick

Giganews Newsgroups
Subject: TRadioGroup - Cancelling OnClick
Posted by:  Descartes (descartwelhocom)
Date: Sun, 25 Nov 2007

Dear All,

Using Delphi 2005, I have a TRadioGroup with two options. The
consequence of selecting either is that some data will be deleted.
Therefore I want to ask the user if (s)he really want to proceed.
I first tried with asking the user in the OnClick event, setting
ItemIndex back to the original value if the user chose not to proceed.
But that causes the OnClick event to occur repeatedly.
Then I discovered the CanModify method of TRadioGroup and have it now
working almost properly.

The only problem left to solve is that CanModify is also called when
the already selected item is clicked, when no change would actually
take place, and I would like to filter out those occasions.

So the question comes down to how I, in the CanModify method, can find
out which item was clicked?

Best regards
Descartes

Replies