Hi,@bhs67 . Welcome to Microsoft Q&A.
To handle a "mouse double click" event in a WPF ListBox
, you could use the MouseDoubleClick
event and define a corresponding event handler in your code-behind (.xaml.cs
) file. Here's an example:
<ListBox x:Name="gLBxCities" Margin="10,0,10,10" Foreground="#0000FF" MouseDoubleClick="gLBxCities_MouseDoubleClick" >
<ListBoxItem >q</ListBoxItem>
<ListBoxItem >s</ListBoxItem>
<ListBoxItem >4</ListBoxItem>
</ListBox>
Codebehind:
private void gLBxCities_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("gLBxCities");
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.