Click here to Skip to main content
13,051,413 members (45,763 online)
Rate this:
Please Sign up or sign in to 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)
    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
    End Sub

infoForm is the form that I want to display and above code contains the mouse leave and mouse enter events.
Posted 17-Feb-13 19:49pm
Updated 17-Feb-13 20:20pm
It happens. I bet you are doing something wrong on mouse events. What?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

Public Sub New()
  Me.DoubleBuffered = True
End Sub

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100