Hi jvcoach , I will just add something to ChrisF answer, and let me know if thats what you want..
TextBox textBox1;
public SilverlightControl1()
{
InitializeComponent();
textBox1 = new TextBox();
textBox1.MouseLeftButtonDown += new MouseButtonEventHandler(textBox1_MouseLeftButtonDown);
}
void textBox1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
InvokeEvent(sender, null);
}
public event EventHandler FireEvent;
public void InvokeEvent(object sender, EventArgs e)
{
EventHandler handler = FireEvent;
if (handler != null) handler(sender, e);
}
/////Here its in vb.net code snippet please try the below code :
Public Partial Class SilverlightControl1
Inherits UserControl
Private textBox1 As TextBox
Public Sub New()
InitializeComponent()
textBox1 = New TextBox()
AddHandler textBox1.MouseLeftButtonDown, AddressOf textBox1_MouseLeftButtonDown
End Sub
Private Sub textBox1_MouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
InvokeEvent(sender, Nothing)
End Sub
Public Event FireEvent As EventHandler
Public Sub InvokeEvent(ByVal sender As Object, ByVal e As EventArgs)
Dim handler As EventHandler = FireEvent
RaiseEvent handler(sender, e)
End Sub
End Class