Windows user control

Hi all ,

I need a help in using windows user control.

I built a user control of simple keyboard . I seems like the windows calculator .

My target is to pass the value I typed in the keyboard control into the textbox that called this control.

In other words, when the click event is called in certain textbox, the user control will appeare, and after pushing close button on the control the value I types will passed to the textbox.

How can I link between the calling textbox and the usercontrol result.

Best regards...



Answer this question

Windows user control

  • Allan-Nielsen

    this should be under windows forms section.

    one question though, is your keyboard control going to be a dialog window/form


  • Radim Hampel

    You need to provide a delegate, a method that is called from the control to the parent. You could even create an event that is the same as the key pressed event and hook that up between the two, so a click in the control fires a key pressed event in the textbox.



  • Larry Smith

    I'd put the keyboard on a small form that you popup with ShowDialog() when the user clicks the textbox. Give the form a constructor that takes a TextBox argument so you can position the keypad in the right place and put the result back into the textbox.


  • Windows user control