In VO we use a MultiLineEdit control to select multiple text fragments from the content. Each time a user has selected some text they click a button and then can continue to select the next fragment or finish. The user can do that with the mouse but also scroll down with cursor keys and select text with the usual combination like Ctrl cursor.
Our X# converted-prg-in-progress uses Winforms and I found out that nor a TextBox, nor a RichEdit control seem to do anything with cursor keys. Not for selecting and not for browsing down through the text.
Is there any way to enable that, or otherwise an alternative control where this does work?
Dick
Winforms: how to use cursor keys to select text?
Winforms: how to use cursor keys to select text?
Hi Dick,
for the TextBox, you can use Select(start,length) to select some text. Also with ScrollToCaret(), you can make it scroll so that the caret/start of selected text is visible. Finally, with HideSelection := FALSE you can make the selected text be always visible as selected, even if the control doesn't currently have focus.
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
.
for the TextBox, you can use Select(start,length) to select some text. Also with ScrollToCaret(), you can make it scroll so that the caret/start of selected text is visible. Finally, with HideSelection := FALSE you can make the selected text be always visible as selected, even if the control doesn't currently have focus.
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
https://learn.microsoft.com/en-us/dotne ... work-4.8.1
.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Winforms: how to use cursor keys to select text?
Hello Chris,
Thanks for your reply, but selecting text from the program is not the problem; that works.
The problem is that a user can't use cursor movement keys to select text (e.g. Shift-Cursor) or use the cursor keys to scroll up/down through text. That can only be done with the mouse.
Dick
Thanks for your reply, but selecting text from the program is not the problem; that works.
The problem is that a user can't use cursor movement keys to select text (e.g. Shift-Cursor) or use the cursor keys to scroll up/down through text. That can only be done with the mouse.
Dick
Winforms: how to use cursor keys to select text?
Hi Dick,
If that was the case, there would be millions of very angry people throwing their .Net apps out of the Window(s)
That does work fine, maybe you have introduced a method intercepting and handling key presses of your textboxes which accidentally "eats" the shift/cursor key presses?
If that was the case, there would be millions of very angry people throwing their .Net apps out of the Window(s)
That does work fine, maybe you have introduced a method intercepting and handling key presses of your textboxes which accidentally "eats" the shift/cursor key presses?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Winforms: how to use cursor keys to select text?
Hello Chris,
But it seems to work as it should now. Only issue for me is that I have no idea why it didn't earlier....
Dick
There are many other reasons to do so but still people keep using the .Net appsChris post=25988 userid=313 wrote: If that was the case, there would be millions of very angry people throwing their .Net apps out of the Window(s)
But it seems to work as it should now. Only issue for me is that I have no idea why it didn't earlier....
Dick