Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to have a textbox in my window where someone can type something into it and when they hit enter, it generates something on the screen, say, a small box with that text in it. Is it possible to create and event or command for a textbox and have that textbox's text property bound to what it generates?

Thanks.
Posted

 
Share this answer
 
Comments
Nish Nishant 21-Sep-10 18:22pm    
Voted 5. Proposed as answer.
I guess you are talking about two-way binding.
See here.
 
Share this answer
 
Comments
industryunleash 21-Jul-10 13:00pm    
kind of, but I would want to be able to create a customer by typing in their name and hitting enter
I solved this problem by creating my own TextBox class, called CommandTextBox which registers 3 Dependency properties: command, commandParameter, and commandTarget.

I used this site for help: http://msdn.microsoft.com/en-us/library/system.windows.input.icommandsource.commandparameter.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