Visual Basic 2010中的面板问题
我创建了一个面板,并使用代码添加了到其他表单的链接。
Private Sub Panel1_Paint_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
AdminLogin.TopLevel = False
Me.Panel1.Controls.Add(AdminLogin)
AdminLogin.Show()
End Sub
面板显示面板内的 adminlogin 表单,但是当我单击 adminlogin 内的任何按钮时,adminlogin 表单会闪烁。 为什么会出现这种眨眼现象?我怎样才能停止它?我还在面板中添加了 me.refresh 但它不起作用?
I created a panel and I added a link to other form using the code
Private Sub Panel1_Paint_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
AdminLogin.TopLevel = False
Me.Panel1.Controls.Add(AdminLogin)
AdminLogin.Show()
End Sub
The panel is displaying the adminlogin form which is inside the panel but when I click any buttons inside the adminlogin the adminlogin form blinks.
Why this blink is occurring ? how can I stop it?I had also added me.refresh inside the panel but it is not working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它闪烁是因为您在每次绘制面板时添加一个控件,当您单击按钮时会发生这种情况。
仅当尚未添加控件时才添加该控件。
当然,这并不意味着您的整体设计没有缺陷。
It is blinking because you are adding a control every paint the panel which happens when you click on a button.
You only add the control if it is not already been added.
Of course this doesn't mean your overal design isn't flawed.