我已经根据鼠标是否在组件内部显示并隐藏了一个按钮(btnImageRemove),但是当我点击该按钮时,事件不会触发。
Private Sub btnImageRemove_Click(sender As Object, e As EventArgs) Handles btnImageRemove.Click
lblAvatar.Image = Nothing
lblAvatar.Tag = Nothing
End Sub
Private Sub lblAvatar_MouseLeave(sender As Object, e As EventArgs) Handles lblAvatar.MouseLeave
btnImageRemove.Visible = False
End Sub
Private Sub lblAvatar_MouseEnter(sender As Object, e As EventArgs) Handles lblAvatar.MouseEnter
btnImageRemove.Visible = True
btnImageRemove.BringToFront()
End Sub
Private Sub btnImageRemove_MouseClick(sender As Object, e As MouseEventArgs) Handles btnImageRemove.MouseClick
lblAvatar.Image = Nothing
lblAvatar.Tag = Nothing
End Sub
我已尝试按钮上的所有点击和鼠标点击事件,以及占据其区域的所有组件,但我无法为该按钮触发事件
缩小范围会导致更多: 我已经缩小到如果我在运行时添加任何东西以显示/隐藏按钮,在另一个事件中,按钮不会触发单击事件,也不会变为橙色(默认的dotnetbar按钮操作)