Reputation: 7029
I have a simple question:
I have a combobox in WPF, but i want users to be able to copy the text from it to the clipboard. So select the displayed text of the selected item and right-click copy or ctrl+c. Just like default windows behaviour.
<ComboBox
ItemsSource="{Binding Products}"
DisplayMemberPath="ProductName"
IsEditable="True"
SelectedItem="{Binding SelectedStroomProduct}">
</ComboBox>
How can i do that without using code behind or putting a lame button next to it?
Upvotes: 0
Views: 765
Reputation: 106936
Unless you do something special to swallow mouse click events and keyboard input events the text box inside the editable combo box will support a context menu with clipboard commands including accelerator shortcuts like Ctrl+C. So basically simply putting a <ComboBox>
on a WPF window having IsEditable="True"
does not exhibit the behavior you describe.
Upvotes: 1