Home » Visual Studio

Orientation of input keyboard mode


I am developing an application in windows phone 7 that supports both orientation.I have a textbox in my application.

When i change the orientation from portrait to landscape the input keyboard does not work fine in landscape mode.

I have one more issue in my app.I am using webbrowser control inside scrollviewer.I am now able to scroll but the scrollbar is not visible.Can i make it visible?

Can you please help me in this?

Thanks in advance.


1 Answer Found


Answer 1

Hi Reshmi,

  Can you be more specific about the problem you are seeing with the input  keyboard in landscape  mode? 

  As for the ScrollViewer, I believe there are two issues here: 

In the Beta release the ScrollViewer  only shows the scroll  bars while scrolling.  They fade in when the user starts manipulating the content and fade out again when the user lifts their finger.  The WebBrowser control  internally handles scrolling of the web content and so the ScrollViewer never get's the manipulation events.




I'm developing a Windows Mobile 6.5 Professional, application which requires me to fix the screen orientation to Portrait mode. How can I go ahead with it.


I tried the code in MSDN http://msdn.microsoft.com/en-us/library/ms229671%28VS.90%29.aspx

This is not working.

Please help me with this issue asap



Business problem: To receive input from card readers, barcode readers etc. being connected via USB and claiming being a keyboard while there's also a genuine keyboard attached however users actually perceive the devices being what they are, i.e. only the genuine keyboard is actually being percepted as a keyboard.

The devices as card readers and barcode readers are configured to emit data as:

1) Send a character stating that now they start emitting data, currently CTRL-B.

2) Send the characters representing the data to emit.

3) Send a character stating that now emission of data is complete, currently CTRL-C.

This approach has been attempted:

*) Use the TextCompositionManager singleton to intercept characters and set the Handled  property of the TextCompositionEventArgs event argument accordingly, i.e. as a CTRL-B is received, intercept all following characters until a CTRL-C is received. The event handler is added by an invocation of TextCompositionManager.AddPreviewTextInputHandler(...).

At first glance everything works beautifully. The problem starts as the input focus is at e.g. a TextBox which has a KeyBinding for CTRL-C for invoking the Copy WPF Command, i.e. one of the Cut/Copy/Paste commands because it clearly seems like KeyBindings are served before processing takes place at the TextCompositionManager.

I must say that I thought the TextCompositionManager was designed to support keyboard interception as I aim for and therefore at first processing would take place at the TextCompositionManager and afterwards, if the Handled property was left as False, to KeyBindings etc.

Therefore my question is: How to effectively intercept the keyboard input so I can effectively solve the business problem described above? Comment: Specifying NotACommand for a TextBox's KeyBinding for CTRL-C is not a good idea as this should also be in operation unless a CTRL-B has been received before without a CTRL-C has been received until now.


Best regards,

Henrik Dahl



I am trying to call or access the soft input panel (SIP) or digital keyboard for a handheld ( Datalogic Pegaso) using  vb.net 2005 application on windows ce environment. we need to show tha digital keyboard as soon as the user focus any textbox. somebody know how to do it?

how to call soft input panel (SIP) or digital keyboard on windows ce

I am trying to call or access the soft input panel (SIP) or digital keyboard for a handheld ( Datalogic Pegaso) using  vb.net 2005 application on windows ce environment. we need to show tha digital keyboard as soon as the user focus any textbox. somebody know how to do it?



I have 5 instances of TextBox similar to the code sample above. None of them can be typed in. Spaces can be typed. You can select text. You can paste text such as "well, pretty much anything". But letters, numbers, punctuation, symbols, etc. do not appear. Can anyone tell me what is going on?


Hi! So I am trying to create a portion of my program that takes keyboard input and types it on the screen as it is being recieved. I would do a windows control but I am implimenting double buffering and the controls are not looking good, plus I don't understand how to get and set text.

So what I want is to have a string variable and append characters to the end of the string each time a character is pressed. I have experimented with WM_CHAR and WM_KEYDOWN but I am not sure how to convert their parameter into a char to append to my string. Basically I'm making my own text box which doesn't need to do much but take letters and numbers.

Thanks for your time!


Hi all,

How can you catch the keystrokes from a QWERTY keyboard on a Windows Mobile Smartphone device when using a fullscreen GUI (DirectX or GAPI).

WM_CHAR and WM_KEYDOWN both return the 'numbers' instead of the ASCII value of the corresponding alphabetical characters, while the character without a number do return their corresponding ASCII values. Another problem is that the 'Fn' and the shift/Capslock key do not give access to the special/capped characters.

Most likely the phone is in number mode, but setting EM_SETINPUTMODE to IM_SPELL on the main hwnd does not have any effect; this probably only works when using form elements?

When using forms the solutions would be to enable the IME (also see this weblink: http://www.smartphonedn.com/qa/ime_enable.html). But this can not be used in when using a fullscreen GUI. The best solution would be to have access to the IME methods without showing an input field behind the fullscreen GUI.

Does anybody know how to take advantage of the IME methods when using a fullscreen GUI interface (I assume there must be some low level access to the IME so you can use it in your own controls) or does anybody have any other solutions that will work to use the Smartphone keyboards?

p.s. We already tried to manually map all these keys using WM_KEYDOWN, but this is an impossible task considering the amount of different keyboard layouts (QWERTY/AZERTY and within these two layouts there are a lot of different layouts for the special characters and numbers).

See some examples of differnt keyboard layout which are all used on Windows Mobile Smartphones:







I'm a beginner in C# after learning C++. I wanted to use XNA 4.0 with C# to create 2D\3D games. There are some differences, but quite a bit is the same as C++. I'm working on creating a Pong clone game with XNA and I've created the basic AI for a paddle and now I need to be able to use the Up and Down keys to move your paddle up and down.

I want something like this:

if (Keys.Up)



Apparently I can't do that as it says it can't convert it into a boolean. What do I have to do? I'm running Visual Studio 2010. Any help is appreciated, thanks in advance.

Well, I know you can do a getc er whatever the function is, but I actually want to stream the input like a device, I'm working on a DJ program and I want to use the keyboard as a controller, and if possible, be aware of which keyboard is being used (like plugging in multiple keyboards, ie regular keyboard and then 1 or 2 of the same type of keypad usb devices). Is this possibible? Liek, an HID handler in the windows api?
I am trying input an integer into an integer validated HtmlEdit box using SendKeys and have even tried the SetProperty of the HtmlEdit box but because it is being validated, I cannot set it and nothing shows up in the box.  My question is, is there a way to send integer keys rather than just strings?  This affects several text boxes throughout the application and has me at a standstill for those test case associated.


I am trying to get the spell checker to work in my WPF RichTextBox and I have not been able to come up with a solution myself, or find one online.

My RichTextBox is defined as:


This works if my keyboard input language is EN (en-US). However since I am from Denmark, my keyboard input language is da-DK.

I have tried various things, for example:

InputLanguageManager.SetInputLanguage(this.TestSpellChecker, CultureInfo.CreateSpecificCulture("en-US"));

However this sets the entire input language to EN, and thus I am unable to use my Danish keyboard, but it does work with spell check. I have also tried setting the Culture on the CurrentThread, however each Run still gets the "da-DK" tag, and thus spell check does not work for English.

Is it possible to use a Danish keyboard, but actually get spell check in English? 

The only other solution I have found is to run through the entire Flow Document and change all da-DK tags to en-US, but that just seems a bit silly.

I am using Win 7 (64 bit, English Language) and .NET 4

Thank you in advance!

Best Regards



Hey all-

I have a DataGridView in which I wanted to host a DateTimePicker, so I used the example from:


Has anyone gotten this example working properly for keyboard input?  It works great when you use the mouse, but under certain circumstances the value from the editing control doesn't get back into the datagridview.

To reproduce: 

Enter the date cell with the mouse Type a new month with the numeric keys only Hit Tab or enter to leave the cell.

Now, the above works fine if you leave the editing control with the mouse, or if you use the up/down arrow keys to change the month value. 

I did some debugging in the editing control, and it appears that if the follow the  steps about the EditingControlFormattedValue property is not being called after the OnValueChanged function fires.  Normally that property is being retrieved prior to the EndEdit event on the datagridview.

Does anyone have any ideas on what to check? 




This is probably a question that comes up a lot.  I've seen some posts related to it that suggest that it may exist, but they are either vague or they are describing the error highlighting language services.  I've never seen it working myself.

Will Intellipad ship with language services that provide the ability to add text completion/suggestion (like VS) and/or syntax highlighting in the Input Window when you are in DSL Grammar Mode?  I see that the input window has error highlighting, which is different from the syntax highlighting (typically in blue for keywords like 'Class' or 'Integer') I'm talking about.  If it will, does any of this functionality work in the November CTP?  Is there any syntactic magic I need to apply to my .mg file to get it to work?

Something like this would be very useful so that people who arn't fluent in my DSL (everyone else but me) can have a good experience while coding in it.

Documentation references,  links to blog entries, or links to other forum posts talking about this would also be appreciated.




Can i change the input mode width InputModeEditor.SetInputMode for an inputbox? I need to take only numbers from an inputbox.

Best regards.

Hi, i am trying to change input panel mode to numeric when my textbox got focus, but nothing is working for me, completly no effect.
I have already tried this solutions:

Process p = Process.GetCurrentProcess();


SendMessage(p.MainWindowHandle, Tapi.EM_SETINPUTMODE, 0, Tapi.EIM_NUMBERS);


InputModeEditor.SetInputMode(textBox, InputMode.Numeric);
(i also tried above solutions with [DllImport("coredll")] public static extern int GetFocus() insted of p.MainWindowHandle, but without success)

But nothing is working! I put this code into my OnGotFocus method which is called after textBox received focus, so why it is not working?

I need your help. I am working on this for two days now.


I'm making an application for Windows Mobile 6 smartphone using VS 2008 in C#. There's this textbox where I want the inputmode to change automatically to numeric mode. But I'm having problems doing so. I've tried InputModeEditor.SetInputMode(this.textBox1, InputMode.Numeric) but it gives the error "the name InputModeEditor does not exist in the current context". I assume it's because it needs the Microsoft.WindowsCE.Forms but when I use it I get "Error 6 The type or namespace name 'WindowsCE' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)". (if I missing and assembly reference I don't know how or where to add it).


InputModeEditor should only work for smartphone projects right? Well I'm pretty sure I'm doing one! "Windows Mobile 6 Standard Device" right?

Anyone has any ideas? Maybe without using InputModeEditor or something. I'm still a newbie when it comes to mobile applications.

Login to access an application want to use a virtual keyboard.
Thus, in this situation, I would stop using the keyboard by a user.
I have searched a lot about this subject and still can not find anything.
I am grateful to whoever can help me.

I am trying to invoke On-Screen keyboard through my VB code. I am using windows 7 and below code to open the keyboard. Everytime when i run this code i am getting error "Could not start On-Screen keyboard". Can someone help me to fix this error?

Dim proces As New Process
proces.StartInfo.UseShellExecute = False
proces.StartInfo.RedirectStandardOutput = True
proces.StartInfo.RedirectStandardError = True
proces.StartInfo.CreateNoWindow = False
proces.StartInfo.FileName = "C:\Windows\System32\OSK.EXE"
proces.StartInfo.WorkingDirectory = "c:\WINDOWS\system32\"
proces.StartInfo.Arguments = String.Empty

I want to be able to have a keyboard accessible to one or more of my controls at a time - each control should have its own keyboard and process the keyboard events appropriately - Does anyone have any suggestions or sample code on how to go about creating a custom keyboard similar to the SurfaceKeyboard - but will allow multiple at a time?

Hi all

i have a Check reader c40 from CTS company

this reader is a usb reader, that creates a Humern interface driver , and sends the READED check as a key press to where the cursor is placed

i want read this data while it is on the usb channel, or to monitor these key by LowLevelKeyboardProc

so, if we suppose that this reader acts like keyboard, we need to monitor the pressing that comes from one of these two keyboards

how would i do that?


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure