Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I have a windows application wherein on a textbox I have set the autocomplete property. Now this property works well when values are inserted with the use of a keyboard. However mine would be a touchscreen application and a keyboard may/may not be used. I also have softboard/onscreen keyboard to enter values which is made up of normal C# buttons. I want the autocomplete to fire on the click of these buttons.
I hope i have made my problem pretty clear.
Can somebody help please?

Regards,
Sunit
Posted
Comments
Toli Cuturicu 11-Mar-11 13:02pm    
Your question is very clear. I voted you 5. Sadly I don't know the answer.
Sunit Parab 11-Mar-11 13:29pm    
Thanx Toli for considering goin through my question.

1 solution

Hi If you use SendKeys function instead of appending a text from the soft keyboard then the autocomplte will be trigger.

C#
private void button1_Click(object sender, EventArgs e)
 {
     textBox1.Focus();
     SendKeys.Send("{A}");
 }


Autocomplete mode work by hooking the current key state and the previous text in the textbox. So if you emulate the key state it supposed to work. I am not sure how you can do this with the touch screen.
 
Share this answer
 
Comments
Sunit Parab 11-Mar-11 13:44pm    
Thanks Albin...... That worked!!
Albin Abel 11-Mar-11 13:47pm    
You are welcome Sunit

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