Hi,@04443056. Welcome Microsoft Q&A.
Based on my test, when the initial value of IsReadOnly of TextBox is set to true, Chinese cannot be input after changing to false. For this problem, it is recommended that you raise a question on Developer Community.
If you could set the initial value of IsReadOnly to false, and then change its value as needed, you can try the following code.
<Window x:Class="TextboxInput.MainWindow"
x:Name="window"
Title="MainWindow" Height="450" Width="800">
<StackPanel>
<Button Content="isReadonlyBinding" x:Name="isReadonlyBinding" Click="isReadonlyBinding_Click"></Button>
<TextBox Name="tbx" IsReadOnly="{Binding ElementName=window,Path=setread, Mode=OneWay}"
Background="AliceBlue" >
</TextBox>
</StackPanel>
</Window>
Codebehind:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
"setread",
typeof(bool),
typeof(MainWindow),
new PropertyMetadata(false)
);
public bool setread
{
get { return (bool)GetValue(IsReadOnlyProperty); }
set { SetValue(IsReadOnlyProperty, value); }
}
private void isReadonlyBinding_Click(object sender, RoutedEventArgs e)
{
if (setread == false)
{
setread = true;
}
else
{
setread=false;
}
}
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our [documentation][5] to enable e-mail notifications if you want to receive the related email notification for this thread.
[5]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html