Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am new to .Net and I am developing 1 application in which I want to write code for onscreen(virtual) keyboard. If a button is pressed it should write where ever the cursor is pointing. Please help me with the code.
Any help will be kindly appreciated.

Thanks in advance.
Posted
Updated 4-Feb-11 22:22pm
v2
Comments
Estys 5-Feb-11 5:02am    
removed your "answer" and added it as comment to OriginalGriff's answer.

This may sound stupid, but bear with me:

If you do not have a touch screen, then how is the user going to press a button with the mouse cursor pointing somewhere else?

If you do have a touch screen, then doesn't it already have a virtual keyboard? Why re-invent the wheel?
 
Share this answer
 
Comments
Estys 5-Feb-11 5:01am    
from OP :
There is already a virtual keyboard in my device, but its very small. To type something we should be very very careful due to this small device, so my PM said to develop an onscreen keyboard and it should be big.
Sergey Alexandrovich Kryukov 5-Feb-11 17:28pm    
Griff, I know what I say sounds stupid, but I worked in the industries (several companies) where they use touch screens very often. And... the machine are not coming with any solutions like that or they are so bad that nobody uses them. Generally, many companies manufacturing equipment are wonderfully ignorant about writing software. I know there are exclusions...
--SA
You can use SendKeys to the active application, but every click changes focus and makes your keyboard the active application. This might be of help to you
Sending Keystrokes to another Application in C#[^]

Note that if your application is intended for international use with a variety of keyboards, the use of Send could yield unpredictable results and should be avoided.
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx[^]
 
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