FatalExecutionEngineError during input attempt using IME after setting focus to element

0

Attempting to enter any data to TextBox using IME (Japanese, Hiragana) causes application crash with MDA FatalExecutionEngineError error.

I have two textboxes on window. I start entering data using Alphanumeric mode to the first field and when text's length reaches 2, set focus to the second field. Go back to the first field using Shift + Tab combination, switch to Hiragana mode and trying to enter any data.

My window:

<Window x:Class="WpfApplication1.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">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBox Grid.Row="0" Margin="5" x:Name="field1" TextChanged="Field1_OnTextChanged" />
        <TextBox Grid.Row="1" Margin="5" x:Name="field2" />
    </Grid>
</Window>

The backstage:

namespace WpfApplication1
{
    using System.Windows.Controls;

    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Field1_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            if (field1.Text.Length == 2)
            {
                field2.Focus();
            }
        }
    }
}

The error message contains the following details: Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in '[path to executable]'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x6cee610f, on thread 0x254c. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

c#
wpf
focus
ime
asked on Stack Overflow Jul 2, 2019 by partyzone

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0