I make a panel visible that has a tab control on it.
The panel becomes visible - I can see all three tab pages.
But the contents of the tab page is blank - until I actually click a tab heading.
Why would that be?
Printable View
I make a panel visible that has a tab control on it.
The panel becomes visible - I can see all three tab pages.
But the contents of the tab page is blank - until I actually click a tab heading.
Why would that be?
What the tab page contains? User control? Are you making the user control visible on Tab click? Or are you loading the user controls on tab when tab is clicked?
The TabControl will not create the controls on a TabPage until that TabPage is actually selected. For instance, if you have a TabControl with two TabPages then, when it is first displayed, only the controls on the first TabPage are actually created until you select the second TabPage. Perhaps what you're doing is confusing that mechanism somehow.
You could try making the second TabPage the selected tab to begin with and then select the first one when your Panel becomes visible. That might force the creation of the controls on the first page. It's a workaround but it may be necessary.
They contain a couple of labels and datagridview
I thought one of these would work - but it is not
Here are the controlsCode:Private Sub languagePanel_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles languagePanel.VisibleChanged
'If languageTabCtl.SelectedTab IsNot Nothing Then languageTabCtl.SelectedTab.Refresh()
languageTabCtl.SelectedTab = LanguageTab
End Sub
languagePanel contains languageTabCtl - which has three tabs - languageTab, SpecialtiesTab and OtherTablesTab.Code:Me.languagePanel = New System.Windows.Forms.Panel
Me.languageTabCtl = New System.Windows.Forms.TabControl
Me.LanguageTab = New System.Windows.Forms.TabPage
Me.languageDGV = New System.Windows.Forms.DataGridView
Me.SpecialtiesTab = New System.Windows.Forms.TabPage
Me.Label11 = New System.Windows.Forms.Label
Me.Label10 = New System.Windows.Forms.Label
Me.specialtiesDGV = New System.Windows.Forms.DataGridView
Me.applicationsDGV = New System.Windows.Forms.DataGridView
Me.OtherTablesTab = New System.Windows.Forms.TabPage
Me.Label73 = New System.Windows.Forms.Label
Me.topicDGV = New System.Windows.Forms.DataGridView
Me.Label13 = New System.Windows.Forms.Label
Me.doctypeDGV = New System.Windows.Forms.DataGridView
Me.Label12 = New System.Windows.Forms.Label
Me.computerOSDGV = New System.Windows.Forms.DataGridView
The first time I visit this PANEL - make it VISIBLE - the first tab is drawn and full of data.
Click to another panel and come back to this panel - the "tabs headings" appear but the tab panel itself is blank!
Wow - sometimes the obvious doesn't appear too clearly!
The tab pages are made of "panels" - and I have a routine that handles the visibility of panels. The tab-panels were getting processed in the FOR EACH CTL loop - stupid bug.
Sorry for taking your time!