Posted 14 years ago
by Andy Ver Murlen
Version: 11.1.0543
Platform: .NET 4.0
Environment: Windows 7 (32-bit)

If the ViewResetMode property is set on a MonthCalendar, when another control on the form is clicked, the MonthCalendar will "steal" back focus from the other control before it's action can be completed.
Consider the following snippet. Click on a date other than today in the month calendar, then click on the ComboBox to expand it. The ComboBox will not expand until it is clicked on a second time. The same will hold true for the button.
Consider the following snippet. Click on a date other than today in the month calendar, then click on the ComboBox to expand it. The ComboBox will not expand until it is clicked on a second time. The same will hold true for the button.
<Window
x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Editors="http://schemas.actiprosoftware.com/winfx/xaml/editors"
Title="MainWindow"
Height="350"
Width="525"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Editors:MonthCalendar
Margin="3"
ViewResetMode="Today"
/>
<ComboBox Grid.Row="1" Margin="3">
<ComboBoxItem Content="One" />
<ComboBoxItem Content="Two" />
<ComboBoxItem Content="Three" />
<ComboBoxItem Content="Four" />
</ComboBox>
<Button
Margin="3"
Grid.Row="2"
Click="Button_Click"
Content="Click Me"
/>
</Grid>
</Window>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
MessageBox.Show("Clicked");
}
}