Right-click on a Listbox in a Silverlight 4 app

前端 未结 2 913
半阙折子戏
半阙折子戏 2021-01-14 17:48

I am trying to implement what I used to take for granted in Winforms applications. I am a Silverlight noob, so hopefully all this is elementary.

I have a listbox in

2条回答
  •  广开言路
    2021-01-14 18:17

    There's the MouseRightButtonDown event. If you bind that on the ListBox:

    
    

    you'll get what you need. The code behind is:

    private void listBox1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
    {
    }
    

    The MouseButtonEventArgs will give you the position via the GetPosition method.

提交回复
热议问题