Solved

Blank TabControl after removing TabPage

Posted on 2013-10-25
4
411 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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