Month Calendar "Holds" Focus

Editors for WPF Forum

Posted 13 years ago by Andy Ver Murlen
Version: 11.1.0543
Platform: .NET 4.0
Environment: Windows 7 (32-bit)
Avatar
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.

<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");
        }
    }

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Andy,

Thanks for reporting this issue. We've corrected it for the next maintenance release.


Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.