Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a user control.I want to show a form on mouse enter of that user control.The location of the form is set to the location of the user control i.e the form will be seen in the position of the user control on mouse enter.But the form flickers continuously when the form appears on mouse enter of the user control.How to resolve it?
Private Sub user_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
        
        infoForm.Hide()
           
    End Sub
    Private Sub user_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs)
      
        Dim cntrl As UserControl = CType(sender, UserControl)

        Dim p As Point = cntrl.PointToScreen(New Point(0, 0))
     
        infoForm.Location = p
        infoForm.Show()
      

    End Sub


infoForm is the form that I want to display and above code contains the mouse leave and mouse enter events.
Posted
Updated 17-Feb-13 20:20pm
v2
Comments
Sergey Alexandrovich Kryukov 18-Feb-13 1:53am    
It happens. I bet you are doing something wrong on mouse events. What?
—SA

1 solution

try setting the double buffered to tru in your control e.g.

VB
Public Sub New()
  Me.DoubleBuffered = True
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900