Hi Guys, Im trying to output the text property of all my open tabs when the application exits.
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 changningCode: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
toCode:tabMainTabs.TabPages.Count
with the same results.Code:tabMainTabs.TabCount
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.




Reply With Quote