Click here to Skip to main content
Rate this: bad
good
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)
        
        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 17-Feb-13 19:49pm
Edited 17-Feb-13 20:20pm
v2
Comments
Sergey Alexandrovich Kryukov at 18-Feb-13 1:53am
   
It happens. I bet you are doing something wrong on mouse events. What?
—SA

1 solution

Rate this: bad
good
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
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,108
1 OriginalGriff 8,186
2 CPallini 2,613
3 Richard MacCutchan 2,231
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
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