Delegate Sub InvokeDelegate() Private Sub TextBox1_Leave(sender As Object, e As EventArgs) TextBox1.BeginInvoke(New InvokeDelegate(AddressOf InvokeMethod)) End Sub
Public Class Form1 Dim ms As String = "on" Private Sub TextBox1_Enter(sender As Object, e As EventArgs) Handles TextBox1.Enter Label1.Text = "" TextBox1.Text = ms ms = "on" End Sub Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyData = Keys.Enter Then TextBox2.Select() End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click TextBox2.Text = "bc : " & ms ms = "BC" TextBox1.Text = ms & Now.ToString("ssfffff") End Sub Private Sub TextBox2_Enter(sender As Object, e As EventArgs) Handles TextBox2.Enter TextBox2.Text = ms End Sub Private Sub TextBox1_Leave(sender As Object, e As EventArgs) Handles TextBox1.Leave WWW() End Sub Private Sub TextBox2_MouseEnter(sender As Object, e As EventArgs) Handles TextBox2.MouseEnter ms = "on" End Sub Private Sub Button1_MouseEnter(sender As Object, e As EventArgs) Handles Button1.MouseEnter ms = "off" End Sub Private Sub WWW() Label1.Text = ms & Now.ToString("ssfffff") End Sub End Class