I'm developing a WPF application with .NET Framework 4.6.2 on Windows 10. With this framework, when a TextBox gains the focus so the keyboard appears. It is nice but how do disable the automatic invocation of this keyboard only on one TextBox ? Indeed, if I set ReadOnly="True" then the keyboard continues to appear.
0
votes
1 Answers
1
votes
You could override the OnCreateAutomationPeer()
method of the TextBox
class as suggested by @Stalker here:
Disable virtual Keyboard in Windows 10 Tablet Mode for one Application
class MyTextBox : TextBox
{
protected override AutomationPeer OnCreateAutomationPeer()
{
return new FrameworkElementAutomationPeer(this);
}
}