Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how do i create Onscreen keyboard in c# that can use inside the same project
im developing a windows form application named ABC,client using touch screen monitor.so i needs to use on screen keyboard inside this application.i tried code below.
but it wont work on the same project.it works on the othere applications like note pad,word .

please someone help me thank you.

What I have tried:

 protected override CreateParams CreateParams
        {
            get
            {
                CreateParams param = base.CreateParams;
                param.ExStyle |= 0x08000000;
                return param;
            }
        }


private void button2_Click(object sender, EventArgs e)
        {
            SendKeys.Send("1");
        }
Posted
Updated 22-Feb-18 3:38am
Comments
BillWoodruff 22-Feb-18 16:53pm    
Why aren't you trying to use the built-in Windows on-screen keyboard ?

start here: https://www.google.cl/search?q=c%23+Windows+on-screen+keyboard

and check this out:

https://sourceforge.net/directory/?q=on-screen+keyboard

1 solution

Not an easy going ...

1st you need to create a Method on the Form which provides the TouchKeyboard. This Method has to look if any of your Textboxes got the Focus. Perhaps it looks also if you need a special restriction to the TouchKeyboard (for example only numeric inputs).
2nd you create your TouchKeyboard - for example as a Dialog. This Dialog holds all the Buttons for the different needed characters which should be used. Each of this Buttons modifies the Text-Property of your Dialog (you need and you should not use SendKeys). If your input is finished your Text-Property holds the final Input.
3rd your Form-method opens the Dialog and because it knows which Control the Dialog requested it could also position the Dialog matching to the calling Control. When your Dialog has finished you only need to write it's Text-Property-Content to the calling Control.

...
 
Share this answer
 
Comments
Shani Weerasinghe 22-Feb-18 8:18am    
Can you please give me some Links that explains ?
Ralf Meier 22-Feb-18 9:25am    
What special Information do you need ?
- Creating a Dialog ?
- Catching Events ?
- Iterating through the Controls-Collection of your Form ?
- Reflection ?
...
- all of them ?
Shani Weerasinghe 22-Feb-18 9:40am    
if you available please tell me all of them.im really massed up with this.:(
Ralf Meier 22-Feb-18 14:28pm    
Of course I could give you some Links - but you could also find the same Links by yourself.
Call Google and enter C#" and then the Keywords I have posted and you will get severall (thousands ?) of examples ...
Ralf Meier 23-Feb-18 16:11pm    
Of course you could downvote my answer - it's your decision.
In fact this answer is the way you have to go - or let it be ...
If you want to go a step ahead you should realize that it isn't helpful to wait that someone does your work for you.
The real answer I could give to you is : start using Google ... and try to improve yourself ...

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