Switching IME during runtime
Input Method Editor (IME) provide users an efficient way to key in texts other than the default Latin text.

When the user has to switch between local language and the English “Advanced Key Settings” allow rapid switching.

But what if a single form contains multiple form elements, some of which expect input in local language and rest in English. Is it fair to burden user with the requirement to switch IME each time he changes field for input or rectification?

Of course not! There needs to be some way out… and there is…
I assume here that you are using controls from “Micosoft Forms 2.0 Object Library” for Unicode character inputs. The form controls expecting user input from IME as TextBox, ComboBox exposes a property namely IMEMode which can be modified at runtime to relieve users from manually changing language settings.
As shown above there are two textboxes one of which expects input in lacal language while the other in English. Place codes as below for the GotFocus event of the controls and you are done.
Private Sub TextBox1_GotFocus()
TextBox1.IMEMode = fmIMEModeOn
End Sub
Private Sub TextBox2_GotFocus()
TextBox2.IMEMode = fmIMEModeOff
End Sub
Setting the properties as above ensures that IME works only on Controls where it is expected to.
FootNote : This post is in response to comment by Phil on the post Storing Unicode Data in Databases. Got any such problem please post on any relevant page or on page Ides ?. I would try to post solution and in the process would learn a few new things. After all learning never stops…

I really don’t know how to Thank you!!! Excellent…way to process IME input !!!
FULL FIDA for you…
Thanks a Lot..
Comment by phil — April 16, 2007 @ 8:20 am
Hey Don’t mistake FIDA…(I ment to say) IM VERY GREATFUL…..for your HELP…..
Comment by phil — April 16, 2007 @ 8:23 am
Hello…
Is there a possiblity to Assigin one Locale to one TextBox..just imagine there is a form where you have to input.. 3 different languages…and each Textbox..has to be assigned to different…Languages..???
regards
Comment by phil — April 16, 2007 @ 8:44 am
Hi Phil,
Thanks!
About assigning multiple IMEs to multiple textboxes… Yes it should be possible… I was thinking of it while publishing this post but decided to defer it for later sometime.
http://msdn2.microsoft.com/en-us/library/ms776076.aspx list a range of functions for working with IME… which might faciliate the task…
Comment by Jalaj — April 16, 2007 @ 9:33 am
Hi..
Nice Info..Thanks Very Much…Kindly let me know..if you do modification..(ofcourse this is my favourit spot which i visit daily).
regards
Comment by phil — April 16, 2007 @ 10:54 am
I am having a problem with “Micosoft Forms 2.0 Object Library” and TextBox1.IMEMode = fmIMEModeOn I find some funny characters appear. Well Im trying to input Arabic(Egypt) but I don’t see the expected characters input. Even if I select keyboard manually I don’t see the desired output. when i select Keyboard Egypt for TextBox1.IMEMode = fmIMEModeOn only …. …. appears I really don’t know how to solve this problem.
Comment by phil — May 21, 2007 @ 4:20 am
Hi Phil,
First of all please check if this problem is just with the VB Form or the problem is also visible when using IME to type in other application (supporting unicode) as MS Word, Wordpad.
If other application too don’t work then the problem is due to a missing font. Try to trace a PC where IME is working fine and check for the fonts installed there.
Comment by Jalaj — May 21, 2007 @ 5:14 am
I have checked this sir. on the same form if i put ordinary text box instead of “Micosoft Forms 2.0 Object Library” it works very well but i want to change IME which will not be possible. Other application such as WordPad and MS-Word work fine so its not the problem with the font. I even tried the same issue on a different machine. Again the result is same. I only gives … …. on text box when IME is on.
Comment by phil — May 21, 2007 @ 5:41 am
Hello Sir..
Its always joy visiting your website…by the way…any update on this issue??? of IME not changing or Arabic characters not appearing properly..??? I shall be greatful if you can post a new sample for this….
Comment by phil — July 13, 2007 @ 10:14 am
[...] on and off every now and then. Not if the software you develop takes care of automatic switching. Switching IME during runtime details how to achieve automatic switching of [...]
Pingback by The Blog Revisited - 7 « Jalaj — December 6, 2007 @ 9:55 am