Solved

VB.net TabControl Irregularity

Posted on 2013-01-26
5
243 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

18 Experts available now in Live!

Get 1:1 Help Now