tags:

views:

61

answers:

3

I am trying to copy a standard WPF listbox selected Item (displayed) text to clipboard on CTRL+C. Is there any simple way to achieve this. If it is something that works for all the listboxes int he app.. that would be great.

Thanks in advance.

+1  A: 

http://www.go4answers.com/Example/click-listbox-copy-selecteditem-90763.aspx

There is an example using a context menu, which will lead to an easy method for keyboard shortcut CTRL+C. Hope this leads you there :)

Review answer 3 for the full monty :)

halfevil
lol, Hooch updated his link to my link while i was editing my text.
halfevil
+2  A: 
eagleboost
@eagleboost; Thanks for this Elegant and almost perfect solution. I guess the only missing part is that, how to detect the content presenter and get the actual displayed text, in case of MVVM architecture, as we will not be binding simple strings, rather objects.
Bhuvan