Setting TRadioButton to test raises the OnClick event

mybox.Checked := true;

Setting TRadioButton for verification (by code) calls the OnClick event handler.

How to find out if a user will change state through interaction with the graphical interface

+3
source share
3 answers

You can use the OnClick event handler when programmatically changing the state of the radio exchange:

procedure TForm1.Button6Click(Sender: TObject);
var
  Save: TNotifyEvent;

begin
  Save:= RadioButton2.OnClick;
  RadioButton2.OnClick:= nil;
  RadioButton2.Checked:= not RadioButton2.Checked;
  RadioButton2.OnClick:= Save;
end;
+9
source
 mybox.Tag := 666; 
 mybox.Checked :=true; 
 mybox.Tag := 0;

procedure myboxOnclick(Sender : TObject);
begin
if Tag = 0 then
//Do your thing
end;
+4
source

, , . OnClick.

+2

Source: https://habr.com/ru/post/1745975/


All Articles