Solved

Blank TabControl after removing TabPage

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

19 Experts available now in Live!

Get 1:1 Help Now