could not capture down arrow in combobox in wpf

后端 未结 3 1269
陌清茗
陌清茗 2021-01-25 02:36

I have a combobox on a window in wpf and i am trying to capture the down arrow key of this combobox but i am not able to do so. The following is the only code i have for the com

3条回答
  •  死守一世寂寞
    2021-01-25 03:10

    This code is helpful for me.

    
        
            item1
            item2
            item3
        
    
    

    CodeBehind

    private void StackPanel_PreviewKeyDown(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Down)
        {
    
        }
    }
    

提交回复
热议问题