Solved

Blank TabControl after removing TabPage

Posted on 2013-10-25
4
370 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 500 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

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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, f…

867 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