문제

<Grid x:Name="LayoutRoot">
    <TextBox x:Name="TxtFocusOut" Height="74" Margin="186,149,225,0" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="26.667" TextChanged="TextBox_TextChanged"/>
</Grid>

private void TextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
    {
        if(TxtFocusOut.Text.Length>=4)
        {
            MessageBox.Show("Four you typed four values");
        }
    }

After I clicked Ok Button On message box,the cursor should be focused out from the texbox.But now it is Blinking in the textbox.What should i do to focused out from the testbox?

도움이 되었습니까?

해결책

FocusManager.SetFocusedElement(AnotherElementID);  

by doing this the this will loose its foucs and foucs can be use for another element.
or
Keyboard.ClearFocus();
http://msdn.microsoft.com/en-us/library/system.windows.input.keyboard.clearfocus.aspx
try any of these

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top