Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / May 2006

Tip: Looking for answers? Try searching our database.

TabControl.SelectedTab.Name issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 24 May 2006 22:29 GMT
Hello All,
I’m having a issue with the TabControl.SelectedTab.Name in the
SelectedIndexChanged method. All I want to do is keep track of what tab the
control is currently on. I have tried the following. I get an Index error or
Object is not an instance of a Object error. Is there a work around?
Thank you in advance.

Terry

gstrPrevTab = gstrCurrentTab
gstrCurrentTab = MyTabControl.SelectedTab.Name

And

Select Case MyTabControl.SelectedTab.Name
Case pgMyPage.Name
//do something here and move on
Case pgMyPage2.Name
//Same as above.
FUnky - 25 May 2006 06:05 GMT
> Hello All,
> I'm having a issue with the TabControl.SelectedTab.Name in the
[quoted text clipped - 17 lines]
> Case pgMyPage2.Name
> //Same as above.

Terry,

your first solution is exactly what u want (place those two lines in the
selectedindexchanged event) .. i m not sure why u r getting those errors ..
probably the problem lies somewhere else.

FUnky
Terry - 25 May 2006 15:59 GMT
FUnky,
I figured out what my issue was. When I was hiding/Clearing the tabpages I
was making a call like this: MyTabControl.TabPages.Clear(). Instead of using
the Clear() I started to use the MyTabControl.TabPages.Remove(MyTabPage).
Once I started using the Remove() the errors were no longer taking place. I
guest the Clear() isn't the same as the Remove().
Thank you for Responding to my post!

Terry

> > Hello All,
> > I'm having a issue with the TabControl.SelectedTab.Name in the
[quoted text clipped - 25 lines]
>
> FUnky

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.