Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

 

Many thanks in advance.

 

Chong

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...