Click here to Skip to main content
15,888,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am working on small application that would take keyboard key values and simulate keyboard command.

My Idea is to have a main Textbox control and whenever I press keyboard key label with that key name dynamically get added to Textbox, user can enter as many as key he want,

So it would be like Textbox as Parent control and one or more Labels as its children.
I also want cancel button on that label so I guess My label would be custom control so that user can remove that whenever entered wrong key.

My could be like
C#
private void KeyDown(object sender, KeyEventArgs e)
        {

            //txtname.Text = e.Key.ToString();

            Label lblfocus = new Label();
            lblfocus = TextFocusedFirst();
            lblfocus.Text = e.Key.ToString();

        }

now lblfocus would be added dynamically to my Parent control Textbox.

Thanks In advance
Posted
Updated 1-Sep-13 23:21pm
v2
Comments
Sadique KT 2-Sep-13 5:08am    
Why can't you directly add e.Key value to the Textbox ??
chandan0285 2-Sep-13 5:20am    
I want to submit multiple value also for example Tab+V, and suppose some one has entered v wrongly in place of p, he could delete that instantly.
Sadique KT 2-Sep-13 5:27am    
I did not understand.. Exactly what is your requirement...
A lot of methods are there to add and append text to the text box, even you can delete it same ..
Which kind of application you are doing? WPF/Windows?
chandan0285 2-Sep-13 5:50am    
Similar to the adding tag in "stackoverflow.com" during posting question.

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