silverlight - How to add a click event to a textbox created in code -


I am using Silverlight 3 and I want to create a handler and event ready to click the mouse in a text Can someone show me the right direction, the box which was made in the back code?

I need to make it so that when some text box is clicked, there are some things going to fire.

If you have an example in vb.net which would be better thanks Shannon

The following code will simulate a mouse click in the text box created in the rear code.

  Textbox Textbox 1; Boole MouseDown; Public SilverlightControl1 () {InitializeComponent (); Textbox1 = new text box (); Textbox1.MouseLeftButtonDown + = textBox1_MouseLeftButtonDown; Textbox1.MouseLeftButtonUp + = textBox1_MouseLeftButtonUp; MouseDown = False; } Zero text box 1_MouseLeftButtonUp (object sender, mousebutton and arranger E) {if (mouseDown) {// click here mouse >> mouseDOWN = wrong; } Zero text box 1_MouseLeftButtonDown (Object Sender, MouseButtonEventArgs e) {mouseDown = true; }  

You probably want to add an additional test that the time between the mouse down and the mouse is less than 500 milliseconds (to say) and that it has not moved more than the mouse Between a pixel or two


Comments