Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net TabControl Irregularity

Hi

In my VB.net I have a TabControl on a TaskPane as shown in the image.

When I click page three and go back to another page, part of page three still shows

on the right. When I then click the page I have gone to, it dissapears and looks as it should.

What might cause this? Is there a way to simulate the click with code?


User generated image
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Hi.

Even if I remove the paint code it still happens. The code on each page looks like the following code. I also use Me.Invalidate behind the click event but it only did once while I was changing the code around. How about if I simulate the Mouse Click event somewhere

   Private Sub TabPage1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles TabPage1.Paint

        Try
            Dim graphics As Graphics = e.Graphics()

            Dim rectBrush As New System.Drawing.Rectangle(0, 0, 450, 600)
            Dim brush As LinearGradientBrush
            brush = New LinearGradientBrush(rectBrush, Color.FromArgb(46, 100, 160), _
                            Color.White, LinearGradientMode.Horizontal)
            graphics.FillRectangle(brush, rectBrush)
        Catch ex As Exception

        End Try
    End Sub
e.graphics.clear(color.white)?
Hi. Thanks, but it still doesn't seem to work
Thanks