I have created the text box at run time and but when I create a sub routine for a DoubClick, this Sub never run even if I double click the text box to clear the value in it. Below is my code, please help you have any idea why.

Private WithEvents txtRank As System.Windows.Forms.TextBox

Private Sub txtBoxCreate()

Dim txtRank As New TextBox()

nlApplicant.SuspendLayout()
With txtRank
.Width = 20
.Height = h
.Location = New Point(x, y)
.AutoSize = True
.MaxLength = 2
.BackColor = System.Drawing.Color.White
.Visible = True
.Anchor = AnchorStyles.Bottom
.Show()
End With
pnlApplicant.Controls.Add(txtRank)
pnlApplicant.ResumeLayout(True)
End Sub

Private Sub txtRank_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtRank.DoubleClick
txtRank.Text = ""
End Sub
Thanks!

Chong