click - Delphi disable mouse buttons and enable again -



click - Delphi disable mouse buttons and enable again -

i need disable both mouse buttons on event onmouseenter of trichedit component , enable 1 time again on event onmouseleave.

setting trichedit enabled = false not solve problem.

any tips ?

you can subclass rich edit intercept mouse button down/up messages. don't need watch mouse entering, leaving control. example:

type tform1 = class(tform) ... private fsavericheditproc: twndmethod; procedure richeditwindowproc(var message: tmessage); .. end; ... procedure tform1.formcreate(sender: tobject); begin fsavericheditproc := richedit1.windowproc; richedit1.windowproc := richeditwindowproc; end; procedure tform1.richeditwindowproc(var message: tmessage); begin case message.msg of wm_lbuttondown, wm_lbuttonup, wm_lbuttondblclk, wm_mbuttondown, wm_mbuttonup, wm_mbuttondblclk, wm_rbuttondown, wm_rbuttonup, wm_rbuttondblclk: begin message.result := 0; exit; end; end; fsavericheditproc(message); end;

delphi click mouse

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -