Solved

VB.net TabControl Irregularity

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

789 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