Mike Torrettinni 198 Posted March 21, 2020 (edited) Not sure how to describe the issue, so here is the strange behavior: When I double click the VirtualStringTree1Node to ShowMessage('Node dbl clicked'), I need to click twice (the Close button - X ) to close the form, after the message window is closed. Simple example of new form with VirtualStringTree1 control: procedure TForm8.FormCreate(Sender: TObject); begin VirtualStringTree1.RootNodeCount := 1; end; procedure TForm8.VirtualStringTree1NodeDblClick(Sender: TBaseVirtualTree; const HitInfo: THitInfo); begin ShowMessage('NODE dbl clicked'); end; I tried Application.ProcessMessages after ShowMessage, no change, still need 2 clicks to close the form. Any ideas what am I doing wrong? VTVersion = 7.2.1 Edited March 21, 2020 by Mike Torrettinni Share this post Link to post
Attila Kovacs 629 Posted March 21, 2020 because the mouseup event will be swallowed by the modal window (showmessage) Share this post Link to post
Mike Torrettinni 198 Posted March 21, 2020 (edited) Thanks! So I need to 'raise' another MouseUp event? Edited March 21, 2020 by Mike Torrettinni Share this post Link to post
Attila Kovacs 629 Posted March 21, 2020 defer your showmessage with a custom message 1 Share this post Link to post
Mike Torrettinni 198 Posted March 21, 2020 Thanks! Wow, these modal windows are killing me in last few days! Share this post Link to post
Mike Torrettinni 198 Posted March 21, 2020 Just found this thread, I guess a similar issue: Windows is hungry and eats mouse events 🙂 Share this post Link to post
Mike Torrettinni 198 Posted March 22, 2020 I ended up using PostMessage: TForm1 ... const WM_OpenRealTimeMonitoringForm = WM_APP + 1; private procedure OpenRealTimeMonitoringForm(var Message: TMessage); message WM_OpenRealTimeMonitoringForm; procedure TForm1.VSTOnNodeDblClick(Sender: TBaseVirtualTree; const HitInfo: THitInfo); begin // Use PostMessage to correclty handle DblClick, to avoid mouse-event be eaten by modal window... PostMessage(Self.Handle, WM_OpenRealTimeMonitoringForm, 0, 0); end; procedure TForm1.OpenRealTimeMonitoringForm(var Message: TMessage); begin ... Form.Show; end; Share this post Link to post
Fr0sT.Brutal 900 Posted March 24, 2020 That's weird - can't reproduce this issue. VTVersion = '7.3.0'; Share this post Link to post