I want to prevent a popup from showing on some conditions.
For example, if a text box is empty.
The code below does not work - “No text” is shown when the test box is empty, but the popup is still shown.
I think I have to set the Popup event to Handled, but I cannot find a way to do it.
procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
if edit1.Text ='' then
begin
ShowMessage ('No text');
PopupMenu1.Close;
end;
end;