简体   繁体   中英

Panel problem in visual basic 2010

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?

Why this blink is occurring ?

It is blinking because you are adding a control every paint the panel which happens when you click on a button.

how can I stop it?

You only add the control if it is not already been added.

Of course this doesn't mean your overal design isn't flawed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM