Forum > LCL

[Solved] How to unselect the text in a focused TEdit, programmatically

(1/4) > >>

cdbc:
Hi
I'm having a 'Brain-fart'  %)
I can't seem to figure out how to un-select the text in a focused TEdit, programmatically from within the containing form...?!?
Any help will be greatly appreciated.
Regards Benny

ackarwow:
Maybe Edit.SelLength:=0 will be sufficient?

dsiders:

--- Quote from: cdbc on November 25, 2024, 05:58:55 pm ---Hi
I'm having a 'Brain-fart'  %)
I can't seem to figure out how to un-select the text in a focused TEdit, programmatically from within the containing form...?!?
Any help will be greatly appreciated.
Regards Benny

--- End quote ---

TEdit.ClearSelection

cdbc:
Hi
Sorry guys, neither of your suggestions worked...
I'd like for the user to type onto the end of the pretext, but alas, when it's selected, the pretext just gets overwritten.
I've also tried:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  edtMask.SelStart:= bcLengthUTF8(edtMask.Text);  edtMask.SelLength:= 0;or  edtMask.Perform(LM_KEYDOWN,VK_END,VK_END);  edtMask.Perform(LM_KEYUP,VK_END,VK_END);  Hmmm, what's next, to try...
Regards Benny

Bart:

--- Quote from: dsiders on November 25, 2024, 06:12:12 pm ---TEdit.ClearSelection

--- End quote ---

TEdit.ClearSelection: Removes the selected text from the edit control.

I think that's not what TS wants.

Bart

Navigation

[0] Message Index

[#] Next page

Go to full version