Results 1 to 5 of 5

Thread: [RESOLVED] [2008] Odd tab page display in panel

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] [2008] Odd tab page display in panel

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: [2008] Odd tab page display in panel

    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?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Odd tab page display in panel

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [2008] Odd tab page display in panel

    They contain a couple of labels and datagridview

    I thought one of these would work - but it is not

    Code:
    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
    Here are the controls

    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
    languagePanel contains languageTabCtl - which has three tabs - languageTab, SpecialtiesTab and OtherTablesTab.

    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!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [2008] Odd tab page display in panel

    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!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width