WalkingAway 1 Posted March 17, 2022 Is to make sense not to use ShowMessage inside OnClick event due to mouse cursor hang? My event works pretty well until I decided to add ShowMessage inside. After that cursor over listbox has "crossed out circle" and I have to click on listbox to get it normal. But that click itself seems not to work also. It's only happens when listbox.DargMode = dsAutomatic. Why? Share this post Link to post
WalkingAway 1 Posted March 17, 2022 So, after that ( if Listbox1.DragMode = dmAutomatic ): procedure TForm6.ListBox1Click(Sender: TObject); begin ShowMessage('Bla bla'); end; you can see what happens. Thank you. Share this post Link to post
Lajos Juhász 293 Posted March 17, 2022 It's a normal behavior. You should give us more information in order to give us a chance to suggest how could you change the code. If you really have to use dmAutomatic in that case whenever you would like to cancel the drag operation you have to call the EndDrag method with false of the control (in this case the listbox). Share this post Link to post
WalkingAway 1 Posted March 17, 2022 (edited) 21 minutes ago, Lajos Juhász said: It's a normal behavior. You should give us more information in order to give us a chance to suggest how could you change the code. If you really have to use dmAutomatic in that case whenever you would like to cancel the drag operation you have to call the EndDrag method with false of the control (in this case the listbox). Thank you. Yes I intend to use dmAutomatic (as I need to move items inside that listbox), but (also) I don't want such behaviour after OnClickMethod. I think this code begin ShowMessage('Bla bla'); ListBox1.EndDrag(False); end; cover all my needs, at least so far I see what I intend top see. Let's see what happens when I implement actual drag/drop functionality. Thank you. Edited March 17, 2022 by WalkingAway Share this post Link to post