B
Benjamien De Vos
hello,
I made a usercontrol, and I add it to my form at runtime. If my mouse enters
that control, a sub has to start.
But for some reason, the trigger doesn't work. When I enter the usercontrol
with my mouse nothing happens.
Can anyone please help me? this is the code:
For Each oCard In arlCardsHand
Dim newUcSmallCard As New ucSmallCard
newUcSmallCard.showCard(oCard)
pnlHand.Controls.Add(newUcSmallCard)
newUcSmallCard.Enabled = True
newUcSmallCard.Location = New System.Drawing.Point(iPlace, 8)
newUcSmallCard.Size = New System.Drawing.Size(64, 88)
iPlace = iPlace + 91
AddHandler newUcSmallCard.MouseEnter, AddressOf smallcard_MouseEnter
Next
and then the sub that should start (but doesn't )
Private Sub smallcard_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim smmcrd As ucSmallCard = sender
MessageBox.Show("u klikte op " & smmcrd.Card.ToString)
UcCard1.showCard(sender.Card)
End Sub
I made a usercontrol, and I add it to my form at runtime. If my mouse enters
that control, a sub has to start.
But for some reason, the trigger doesn't work. When I enter the usercontrol
with my mouse nothing happens.
Can anyone please help me? this is the code:
For Each oCard In arlCardsHand
Dim newUcSmallCard As New ucSmallCard
newUcSmallCard.showCard(oCard)
pnlHand.Controls.Add(newUcSmallCard)
newUcSmallCard.Enabled = True
newUcSmallCard.Location = New System.Drawing.Point(iPlace, 8)
newUcSmallCard.Size = New System.Drawing.Size(64, 88)
iPlace = iPlace + 91
AddHandler newUcSmallCard.MouseEnter, AddressOf smallcard_MouseEnter
Next
and then the sub that should start (but doesn't )
Private Sub smallcard_MouseEnter(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim smmcrd As ucSmallCard = sender
MessageBox.Show("u klikte op " & smmcrd.Card.ToString)
UcCard1.showCard(sender.Card)
End Sub