i have created an user control and have added it into my form.
i have coded the usercontrol as when got focus its value increases by 1 and an msgbox showing its value is displayed. when i had run the form and set the focus to the usercontrol it messaged the increasing value of the control 39 times
Code:Private Sub MyComboTxt_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus MyCombo.Visible = True MyCombo.Focus() MyLabel.Visible = False MyCombo.Text = MyLabel.Text If Len(Trim(MyCombo.Text)) <> 0 And MyCombo.Items.Count <> 0 Then MyCombo.DroppedDown = True MyCombo.SelectAll() End If MyCombo.Text = MyCombo.Text + 1 MsgBox(MyCombo.Text) end sub




Reply With Quote