Andrew Spencer Posted December 12, 2024 Posted December 12, 2024 Is there a way to programatically select all of the text in a TUniDBMemo? Quote
Sherzod Posted December 12, 2024 Posted December 12, 2024 11 minutes ago, Andrew Spencer said: Is there a way to programatically select all of the text in a TUniDBMemo? For example: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBMemo1.JSInterface.JSCall('execCmd', ['selectAll']); end; Quote
Andrew Spencer Posted December 12, 2024 Author Posted December 12, 2024 Unfortunately this results in Quote
Sherzod Posted December 13, 2024 Posted December 13, 2024 @Andrew Spencer Sorry, this solution was for UniDBHTMLMemo... Quote
Sherzod Posted December 13, 2024 Posted December 13, 2024 13 hours ago, Andrew Spencer said: Unfortunately this results in One possible solution: UniDBMemo.ClientEvents.ExtEvents -> function afterrender(sender, eOpts) { sender.selectAll = function() { var textarea = sender.inputEl.dom; var text = textarea.value; var start = 0; var end = text.length; textarea.setSelectionRange(start, end); textarea.focus(); }; } Usage: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniDBMemo1.JSInterface.JSCall('selectAll', ['']); end; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.