Winform textbox not offering all keyboard options - winforms

I have been using StackOVerflow for years and it's very rare that I did not find my question being answered already. But in this case, either I am missing something obvious or no one had to do this before.
I am using dotnet 3.5 C# winform desktop application on windows XP. I have enabled language bar on XP and have installed more than one languages. For one of the languages, Hindi, I have installed more than one keyboards (input mode?), One that comes with XP (Hindi Traditional) and Remigton.
When I am using MSWord or Write pad and select my language as Hindi, I see in the language bar, a dropdown to select my keyboard (input mode?) I can choose from "Hindi Indic Input 2" or "Hindi Traditional". If I choose "Hindi Indic Input 2" I see in Settings 9 more options to choose from.
In my application, which is a simple winform application developed using C# dotnet 3.5, when the input focus is on any textbox, I do see the language bar and I can change my input language but in the language bar I do not see the option to change my keyboard (input mode). I want to be able to enter text in my text box either using "Tradional Hindi" or "Hindi Indic 2" but it only allows to enter text using "Hindi Traditional". Language bar does not show the dropdown to select keyboard.
Question: What do I have to do to unable the input mode/keyboard selection in langguage bar when focus is in my windows form application?

Related

Does Win32 Common Controls use Direct2D now?

I have a Direct2D app where I draw text messages with DirectWrite. It's all C++. I want to add an edit control which must support emojis and a button on the right. Does Win32 edit controls and buttons can be used in a Direct2D window and is the text button rendered with DirectWrite or with the old GDI?
Thanks you
No GDI-based common controls in comctl32.dll use DirectWrite to draw text (too many compatibility concerns), but many newer parts of the Windows 10 shell use DirectWrite - anything based on DUI or XAML, like the Start menu or system Settings app.
Per Simon Mourier's comment, I wrote an SDK sample years ago called PadWrite that demos a very basic edit control, but I can't recommend it as a serious text editor because it recreates the IDWriteTextLayout object every edit. So it's best for just a few lines or paragraphs of text, as a smarter editor would selectively update only the parts of the text that changed. This works on Windows 7, but Windows 7 itself had only basic emoji support (monochrome glyphs in Segoe UI Symbol). Not until Windows 10 (with Segoe UI Emoji) did it really become colorful.
The newer RichEdit is also a viable option (I forget which flags enable it).
I've tried to subclass the standard EDIT control to intercept WM_PAINT messages (along with Edit_GetRect, GetDCEx, DefSubclassProc), but that's brittle because the HFONT does not always match the same metrics as the corresponding IDWriteFontFace due to font fallback and metrics differences between GDI vs DWrite, meaning your drawn text may not match the glyph advances the underlying EDIT control uses.
WinUI should work nicely if you can take a dependency on >= Windows 10.
There's also the Scintilla text editor which supports a DirectWrite mode. https://www.scintilla.org/ScintillaDoc.html (set SCI_SETTECHNOLOGY = SC_TECHNOLOGY_DIRECTWRITE). This will work on >= Windows 7 (or Vista with SP2 Service Pack Platform Update).

"Hide" text box from automatic Win10 keyboard showing

My goal is to show Windows 10 on-screen keyboard when user clicks on text box.
Windows 10 has option to show its on-screen keyboard automatically, even outside of Tablet mode, if specific option is enabled in settings.
However, it seems this logic has some serious issues when working with WPF applications - flickering, not showing up at all etc. You can easily test it on simple WPF application with several text boxes, if you have touch screen Win10 device.
So, I've decided to control keyboard myself, which now works perfectly, with automatic keyboard display option disabled. However, I can't ensure that every users Windows 10 will have this option disabled, so I'd like to make Windows "ignore" clicks on text boxes in my WPF application, so only application itself controls keyboard visibility.
So, my question is - is there any way to make Windows ignore focus on particular text boxes?
PS. If there is no clear way to do this, I would be grateful for any hints towards how Windows actually gets information about WPF text box being edited, so I can maybe play around with my own TextBox implementations, which will not trigger this logic.
Update:
It seems, it is possible to remove "hooks" keyboard is using to find out that text box is focused, by using FrameworkElementAutomationPeer instead of TextBoxAutomationPeer in custom implementation of TextBox, yet this ruins possibility to use this text box in automation (which I don't like).
I don't have a touch screen device to test on - but from my quick mouse clicking tests I seen there is a TextBox.Focusable = false;
https://msdn.microsoft.com/en-us/library/system.windows.uielement.focusable(v=vs.110).aspx
This how ever makes it unable to get keyboard input, so maybe put another method on a TextBox like:
txtBoxTestFocus_MouseDown or txtBoxTestFocus_TouchDown which then could set txtBoxTestFocus.Focusable = true;
Not sure is this will help, as I've been unable to test it sorry

Virtual OnScreenKeyboard in Silverlight

I'm trying to build an OnScreenKeyboard to fill Textboxes in a Silverlight Web Application. The Keyboard has to be multilingual so that when I have set the language to chinese and enter a small letter like an "a", a combobox has to appear with the chinese signs.
The OSK under Windows XP is too small for the touchscreen which I'm using.
I already built a Keyboard with Buttons that contain strings but they do not simulate the Keypress Event like a real Keyboard.
Is there a similar function like System.Windows.Forms.SendKeys for Silverlight? This is only usable in Windows.Forms which I can not use in Silverlight.
I'm working with Expression Blend 3 and Visual Studio 2008.(Silverlight Version 3)
I would be very glad for some help.
Regards Knut
Here is an article describes how to attached Kyeboard behavior to UI controls http://www.orktane.com/Blog/post/2009/11/09/Virtual-Input-Keyboard-Behaviours-for-Silverlight.aspx

Is it possible to install different fonts on windows phone 7 emulator?

I made a demo application using Silverlight where I have given certain Unicode of Hindi language to be displayed on a textbox as a text. ऋ ऊ उ ई इ आ, unicode positions are '\u090B', '\u090A', '\u0909', '\u0908', '\u0907','\u0906' respectively.
So when I pass this whole thing as a string to the textbox.text property it shows at the debug time as the exact value is to the textbox but when I go through the emulator the display shows empty boxes.
Is this require installation of different fonts on emulator? If so then how can I do this? Is it possible to build an application for Windows Phone 7 which can support different languages?
You can embed fonts in your WP7 applications in the same way that you embed fonts for any Silverlight application as decribed in the Embedding fonts in Silvelright blog post by Paul Yanez. You simply check the Embed checkbox in the Text pane in Expression Blend.
NOTE: You will need to make sure that you are licensed to use the font in this way or that it is free for use in this way.

Touchscreen Windows 7 WPF

I have an app which I need to make accessible for Windows Touch. It is not a multi-touch application. I've looked at Microsoft's guidelines for touch applications which is interesting. There is one thing I am not clear on though, that is text input.
I would like a keyboard to appear when I click in a TextBox field. Is there a way to use the built-in on screen keyboard for this?
The first monitor I tested with was a Wacom. It is an older unit that uses a pen. It had some software that pulled up an on screen keyboard whenever I clicked in any text field (in any application). It was very handy. I thought this feature was using built-in Windows Tablet software because it didn't look like it came from a third party. A newer monitor I just purchased (Elo) does not have this feature though.
Answering my own question so it won't show up as unanswered any longer... From my comment above:
Looks like I've found the problem. The general purpose driver for the monitor wasn't installing it as a Tablet PC monitor. The Windows 7 only driver will provide a Tablet PC control panel settings. Now a keyboard shows up whenever I click in a TextBox field. The Windows XP compatible driver must have been using a legacy sub-system...

Resources