Click here to Skip to main content
14,937,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm currently running into a problem: I have a MultiSelectTreeView and I can modify the text on the node by double-clicking it (but leaving some time in between) like in normal Windows when you want to rename a file.

And now when I am in this name modification section where the text is highlighted and everything (like this) I can't use Ctrl+C to copy the text. I can only use the Copy function of the context menu when you press right click on it which takes considerably more time than Ctrl+C.

Are the shortcuts in this scenario disabled and if so can I enable them?

Also I have already implemented a functionality for Ctrl+C/Ctrl+V when copying/pasting an entire node, so that's not my question. This problem just has to do with copying the text.

I want to do the solution shown here but I don't quite understand it since I don't know for example what "Drop the new control from the top of the toolbox onto your form." means (I'm also not able to open the Designer)

What I have tried:

I've asked the same question on Stack Overflow but haven't received an answer yet:
Link to question
Updated 18-Jul-18 3:49am
Jochen Arndt 18-Jul-18 8:21am
When in edit mode, Ctrl-C should work as in any edit control.

Maybe your Ctrl+C/Ctrl+V handler for entire nodes suppresses forwarding the accelerator activation to the edit control.
[no name] 18-Jul-18 9:06am
This could be! Is there a possibility that I can send you the code for this handler in a structured way so you could have a look on it?
Jochen Arndt 18-Jul-18 9:13am
To verify this first, just disable / remove your handler. Or check if other standard accelerators like Ctrl-A (select all) are working (if not also catched by the handler).

It is also not necessary to know what the handler does but how it is called / added to the message handling if it is the culprit.

If so, edit your question using the green 'Improve question' link. Then others might help too.
[no name] 18-Jul-18 9:46am
Thank you very much, I was able to solve the problem with your help! You can read what I did in the answer I wrote. Have a nice day!
Jochen Arndt 18-Jul-18 9:52am
Fine to hear that you got it solved and thank you for the feedback.

1 solution

I noticed that when pressing Ctrl+C in the edit mode it uses the normal Ctrl+C handler for entire nodes but "fails" there at an if condition which checks if the correct thing (=node) was selected.

I simply added an else to this which then copies the selected value to the clipboard and it works perfectly fine!
I'll probably just have to do the same thing with Ctrl+V in edit mode.

Gosh, I've searched so long for this solution, thanks to Jochen Arndt who provided me help in the comment section!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900