CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 18

Threaded View

  1. #1
    Join Date
    Feb 2007
    Posts
    46

    [Resolved] Saving Tab Control State on application exit

    Hi Guys, Im trying to output the text property of all my open tabs when the application exits.

    Code:
                
    String strOpenTabs = "";
    
                for (int intTab = 0; intTab < tabMainTabs.TabPages.Count; intTab++)
                {
                    tabMainTabs.SelectedIndex = intTab;
    
                    if (tabMainTabs.SelectedTab.Text != "Welcome")
                    {
                        strOpenTabs += tabMainTabs.SelectedTab.Text + ", ";
    
                    } // End if
    
                } // End for loop
    This code adds all open tabs text value to a string (which is then written out to a file). The problem im having is that Count always equals 0. Ive trade changning

    Code:
    tabMainTabs.TabPages.Count
    to
    Code:
    tabMainTabs.TabCount
    with the same results.

    Im geussing the tab control has already been removed? anyone have any ideas how I can get past this issue?

    Thanks in advance

    Rich

    Resolved: Tab control does not have an event suited to this nor does form closing as far as I was able to find out. I have settled for keeping a record of what tabs are opened and closed through the applications running as writing this out instead of doing it on application end.
    Last edited by Rich...; March 28th, 2007 at 08:28 AM. Reason: resolved

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

Featured