Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have written a data entry program in C# that automatically switches the input language as the user tabs or clicks different entry text boxes.

There is a status for Traditional Chinese that can accept either Chinese or English this status is toggled by sending a SHIFT character from the keyboard or the program.

The two different statuses look like these: (note the fourth icon from the left)

Chinese Input:
<img src="http://www.jimkay.tw/files/Chinese.JPG"/>;

English Input:
<img src="http://www.jimkay.tw/files/English.JPG">

The problem is that when I start the program I cannot predict which of the two settings will appear when I first set the input to Chinese (it remains stable while the program is running.)

If I could find something I could read, I would know what the current setting is, but I have searched through the control block during debugging and when I change the setting, I see nothing different.

How or what can I access to know the current status?
Posted
Updated 14-May-19 10:16am
v4

Well, I'm posting the answer to my own question which I found by wandering the Help system.

this instruction did the job:

WorkBoPoMoFo.ImeMode = System.Windows.Forms.ImeMode.On;

"WorkBoPoMoFo" is the name of a text block on my form where the user can type input.

ImeMode is only valid for Japanese, Traditional Chinese, and Simplified Chinese. That is why nobody else could see what I was talking about-they are using other languages.

Thanks to all those who tried to help. I'm posting the answer in case someone else hits this problem.
 
Share this answer
 
You can use InputLanguage.CurrentInputLanguage.LayoutName or InputLanguage.CurrentInputLanguage.Culture.Name to check the current status.

InputLanguageChanged event would be a help to catch the change.
 
Share this answer
 
v2
Comments
TaipeiJim 3-Feb-11 5:35am    
I have looked at the name in both status situations and they are exactly the same.

"zh-TW" that's the problem.
Prerak Patel 3-Feb-11 5:52am    
Are you sure that you used CurrentInputLanguage and not DefaultInputLanguage? I've checked here for DE and US. It works.
Anyways, have a look at InputLanguageChanged, that may help.
OriginalGriff 3-Feb-11 6:28am    
The OP wrote:

InputLanguage.CurrentInputLanguage

That's copied and pasted from my program. Yes, I'm sure.
Prerak Patel 3-Feb-11 6:36am    
You would like to check InputLanguageChangedEventArgs in InputLanguageChanged.
I you want to access data about regional settings like language, use can refer to
Thread.CurrentThread.CurrentCulture object.
 
Share this answer
 
Comments
Prerak Patel 3-Feb-11 6:40am    
I think OP is asking for input language from language bar.
The Current Culture remains "zh-TW" through it all.

The really odd thing is that the language bar settings do not show any function assigned to just the SHIFT key, but that key continues to switch between "Chinese/English input (Shift)"

If I hover my mouse over the icon, I get that hint and it's the only place I see that.

So there must be someplace where Windows 7 keeps this information but I just can't find it.
 
Share this answer
 
Comments
Prerak Patel 3-Feb-11 6:44am    
Use "Add Comment" or "Reply" to a comment, don't add your comments as answer.
Prerak Patel 3-Feb-11 6:52am    
And what you are saying is not quite clear but Alt+Shift is default shortcut to switch input languages.
TaipeiJim 3-Feb-11 8:20am    
But I'm not switching input languages. The language icon--first icon-- remains CH for Chinese. The third icon--because I have both new phonetic and Cangjie methods installed--can be changed but it remains the same in my situation. The fourth icon is the only one changing in my problem and I get the '(shift) instruction as a tool-tip by hovering over the icon with my mouse pointer. It seems the new phonetic Chinese can take input in either Chinese or English. My wife, who has only new phonetic installed also needs to switch to English for things like URLs and other Internet stuff that isn't in Chinese. Perhaps that's what makes this confusing. The Chinese language setting has to support English too.
PR1ST 14-May-19 16:01pm    
Have any update about this problem "Chinese/English mode (Shift)" of Chinese IME.? I'm finding a solution too, to input only English text for a textbook.
Unfortunately, I have to advise you to NOT use the English setting within the Chinese Language choice.

whether it's the font that gets used or just something hard-coded in the Chinese Language support: the English is pretty much an unusable mess. Both the characters and the spacing are rather wide and rather strange.

The worst thing is that you cannot search the resulting text when using ordinary English. The characters are entirely different.

So far, I have not solved this problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900