Public Class Form1 Dim flg As Integer = 0 Dim ms As String = "10" Private Sub TextBox1_Enter(sender As Object, e As EventArgs) Handles TextBox1.Enter flg = 1 ms = "t15" TextBox1.Text = "3" End Sub Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyData = Keys.Enter Then TextBox2.Text = "4" InvokeMethod() TextBox2.Select() End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click flg = 5 ms = "18" MsgBox(ms) End Sub Private Sub TextBox2_Enter(sender As Object, e As EventArgs) Handles TextBox2.Enter TextBox2.Text = ms End Sub Private Sub TextBox2_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox2.KeyDown If e.KeyData = Keys.Enter Then flg = Val(TextBox2.Text) End If End Sub Delegate Sub InvokeDelegate() Private Sub TextBox1_Leave(sender As Object, e As EventArgs) TextBox1.BeginInvoke(New InvokeDelegate(AddressOf InvokeMethod)) End Sub Public Sub InvokeMethod() If flg = 1 Then MsgBox("tbx") ms = "20" MsgBox(ms) flg = 2 End If End Sub End Class