表格在鼠标悬停时不断闪烁 [英] Form is flickering continuously on mouseover

查看:899
本文介绍了表格在鼠标悬停时不断闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户控件。我想在鼠标输入该用户控件时显示一个表单。表单的位置设置为用户控件的位置,即表单将在用户控件的位置看到鼠标输入时,表格会在用户控件的鼠标输入时连续闪烁。如何解决它?

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是我要显示的表单,上面的代码包含鼠标左键和鼠标输入均匀ts。



infoForm is the form that I want to display and above code contains the mouse leave and mouse enter events.

推荐答案

尝试在您的控件中将双缓冲设置为tru,例如



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

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


这篇关于表格在鼠标悬停时不断闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆