Solved

VB.net TabControl Irregularity

Posted on 2013-01-26
5
242 Views
Last Modified: 2013-02-04
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?


1
0
Comment
Question by:murbro
  • 3
5 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38824117
Its to do with your custom painting I think.
0
 

Author Comment

by:murbro
ID: 38824373
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
0
 
LVL 27

Expert Comment

by:Ark
ID: 38829854
e.graphics.clear(color.white)?
0
 

Author Comment

by:murbro
ID: 38831607
Hi. Thanks, but it still doesn't seem to work
0
 

Author Closing Comment

by:murbro
ID: 38850787
Thanks
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now