Hi, I have a form where I want buttons at the very bottom edge of the form, with no gap to the border. These buttons shall be "auto-hide", so they only show when the mouse is in for example the lower 20 pixels of the form. So I use the MouseMove event to trigger this, like code below. However, if mouse leaves the form across the bottom edge, where the buttons are, then the buttons will obviously remain. But I want them to hide. So I need for this purpose to hide the buttons by some other event. Hence I try to hide them in the form's MouseLeave event. But this makes the buttons unclickable and in an erratic state, flashing on and off when the mouse goes over the button.. Why is this? And how can I avoid this problem to get such autohide feature?
Private Sub ZgScale_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If e.Y > Me.ClientSize.Height - 30 Then
Button1.Visible = True
Else
Button1.Visible = False
End If
End Sub
Private Sub ZgScale_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseLeave
Button1.Visible = False
End Sub