Click here to Skip to main content
11,791,059 members (73,683 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
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
Edited 17-Feb-13 20:20pm
Sergey Alexandrovich Kryukov at 18-Feb-13 1:53am
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
0 OriginalGriff 1,329
1 Maciej Los 835
2 ppolymorphe 780
3 KrunalRohit 686
4 CPallini 661

Advertise | Privacy | Mobile
Web04 | 2.8.1509028.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2015
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