Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Blank TabControl after removing TabPage

Posted on 2013-10-25
4
Medium Priority
?
448 Views
Last Modified: 2013-10-27
I have a TabControl in a Windows Forms app (VB 2008). Some of the tabs aren't used for certain versions of my app. I use conditional compilation to .Remove those that won't be used, which has worked fine.

However, I'm creating a new version which doesn't need to display the first TabPage of the TabControl, and I'm running into a problem. I have specified a new page for index=0, but now when the application starts, the TabControl is always completely blank. If I click on one of the tabs, a proper page displays.

What is blanking the control, and how do I overcome that?
0
Comment
Question by:ElrondCT
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
Ess Kay earned 1500 total points
ID: 39601483
you somewhere drop your tabs or hide them

look inside your form.load function first, if not, maybe the tab visibility is set to false
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39601484
if you can't find it, do something like

tabcontrol1.tabs(0).visible = true
inside the form load
0
 
LVL 20

Author Comment

by:ElrondCT
ID: 39601700
I am intentionally doing a .Remove of the first tab (in the Form Load event handler). However, your mention of .Visible caused me to trace what was happening with that property on my desired tab (even though it's not normally listed as a property of the TabPage). It turned out that I was trying to select the original first tab, even though it had been removed, which turned off the .Visible property of the tab I wanted to display. Eliminating the spurious selection keeps my desired tab visible.
0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 39604729
Glad i helped you find the problem
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview

876 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