Home > Back-end >  How to shield the Edit Edit column double-click or other click operation caused by selection effect
How to shield the Edit Edit column double-click or other click operation caused by selection effect

Time:09-18

BCB Edit in editable mode, double-click, or click operation can cause other controls the default string selection behavior, how do I block the default behavior,
Certainly cause future generations is not only the double click action, specific can lead to future generations of all events cannot speculate that

CodePudding user response:

Seems to have a AutoSelect properties, but not necessarily to double-click the useful,

CodePudding user response:

In the edit all the mouse events, such as mousedown, mouseup, mouseleave mousemove mouseenter perform this code
Edit1 - & gt; SelLength=0; So as not to future generations

CodePudding user response:

But can't block human range through the mouse to drag the selected operation

CodePudding user response:

Can ah, selected by mouse also blocked, you try it again, the mouse drag cannot select the text, can also block the keyboard

CodePudding user response:

reference 4 floor gspuser response:
ok, selected by mouse also blocked, you try it again, the mouse drag cannot select the text, can also block the keyboard


Shielding not artificially through the mouse to drag the scope of the selected operation

CodePudding user response:

Look have others test under this kind of situation, my win10 X64 BCB2010, use this code is the mouse drag to select text didn't also way,
Can try to perform more several events, such as EditEnter, again not try to Edit all events that perform the see effect

CodePudding user response:

Is I didn't clearly stated, and cannot be shielded artificially through the mouse to drag the selected operation is required,
Range through the mouse to drag the selected function which a man needs to be preserved, only block other operating selection function,

CodePudding user response:

Try these three events, see whether you want effect, the mouse point in and double-click these are not automatic selection, drag the mouse hand can choose all or part of the

Void __fastcall TForm1: : Edit1Enter (TObject * Sender)
{
Edit1 - & gt; SelLength=0;
}

//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Void __fastcall TForm1: : Edit1DblClick (TObject * Sender)
{
Edit1 - & gt; SelLength=0;
}
Void __fastcall TForm1: : Edit1Exit (TObject * Sender)
{
Edit1 - & gt; SelLength=0;
}

CodePudding user response:

I checked our control information, simply rewrite control events should not solve,
Controls provide automatic selection function is not only triggered when double-click, and click on the context on (specific context cannot speculate that can reflect the operation a few times more),
Still thank you very much ~
  • Related