Posted 14 years ago
by Kevin Drapel
Version: 11.1.0542
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Hi,
I encountered a strange behavior in our application with the ComboBox control. Basically, we are using a class that inherits from Ribbon.Controls.ComboBox with some additional code. This new control is firing unexpected OnClick events even if the mouse was not directly involved in the operations. For example, first clicking on the combobox to open the dropdown (mouse is never used afterwards), then moving in the dropdown list with the keyboard , then pressing ESC key and pressing the right or left arrow key would launch the event. Normally, I was expected the ESC key to close the dropdown without a click event being fired at the end.
I could reproduce it with the bare minimum and will send you a full project that exactly shows this behavior.
The main reproduction code looks like this:
I encountered a strange behavior in our application with the ComboBox control. Basically, we are using a class that inherits from Ribbon.Controls.ComboBox with some additional code. This new control is firing unexpected OnClick events even if the mouse was not directly involved in the operations. For example, first clicking on the combobox to open the dropdown (mouse is never used afterwards), then moving in the dropdown list with the keyboard , then pressing ESC key and pressing the right or left arrow key would launch the event. Normally, I was expected the ESC key to close the dropdown without a click event being fired at the end.
I could reproduce it with the bare minimum and will send you a full project that exactly shows this behavior.
The main reproduction code looks like this:
public class MyComboBox : ActiproSoftware.Windows.Controls.Ribbon.Controls.ComboBox {
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
List<string> s = new List<string>() { "a", "b", "c" };
comboBox1.ItemsSource = s;
}
private void comboBox1_Click(object sender, ActiproSoftware.Windows.Controls.Ribbon.Controls.ExecuteRoutedEventArgs e) {
MessageBox.Show("CLICK ??");
}
}
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon" xmlns:WpfApplication2="clr-namespace:WpfApplication2">
<Grid>
<WpfApplication2:MyComboBox Height="23" HorizontalAlignment="Left" Margin="82,97,0,0" x:Name="comboBox1" VerticalAlignment="Top" Width="252" Click="comboBox1_Click" />
</Grid>
</Window>