Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want How to select text in ComboBox in silverlight when keyboard button pressd.
Please give solution.
Posted
Comments
Christian Amado 27-Aug-12 10:48am    
Please, be more specific. Tested? code? something?
arti s.v 3-Sep-12 8:15am    
use keydown event handler

1 solution

C#
private void comboBox_KeyDown(object sender, KeyEventArgs e)
        {
            if ((Keyboard.Modifiers & ModifierKeys.Control) > 0 && e.Key == Key.C)
            {
                Clipboard.SetText(this.comboBox1.SelectionBoxItem.ToString());
            }
        }

If the combo box is active, and then you press ctrl+C, it's content will be copied to clipboard. I down't know if this is what you want. If you use data binding, you may want to use SelectedValue property, or convert SelectedItem to your type, and then get the text you want.
 
Share this answer
 

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