Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 27th, 2007, 4:07 AM   #1
programmingnoob
Hobbyist Programmer
 
Join Date: Feb 2006
Posts: 155
Rep Power: 3 programmingnoob is on a distinguished road
tab control...

in c#, how do you determine the number of tabpages at runtime?

I mean the coder does not know beforehand how many tabs the user will need, so how does the coder handle the variable number of tab pages?

also, the number of tab pages should not effect the size of the form, which implies that great number of tab pages would imply lesser (but equal) area given to each tab page.

if you think i shouldnt be using tab control, then feel free to suggest alternatives too.... i just need some sort of tab functionality
programmingnoob is offline   Reply With Quote
Old Jun 27th, 2007, 9:27 AM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 422
Rep Power: 4 Wizard1988 is on a distinguished road
I haven't really used the tab control, but why not keep a variable and add one to it every time a new tab is created.
__________________

Wizard1988 is offline   Reply With Quote
Old Jun 27th, 2007, 10:59 AM   #3
john Wesley
Hobbyist Programmer
 
john Wesley's Avatar
 
Join Date: May 2006
Location: United Kingdom
Posts: 119
Rep Power: 3 john Wesley is on a distinguished road
Send a message via MSN to john Wesley Send a message via Yahoo to john Wesley
TabControl.TabPages.Count

Doesnt that work?

Also, when you add or remove tab-pages the size of the control does not change but rather the tab's either spread out or overrun.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles..
john Wesley is offline   Reply With Quote
Old Jun 27th, 2007, 1:25 PM   #4
programmingnoob
Hobbyist Programmer
 
Join Date: Feb 2006
Posts: 155
Rep Power: 3 programmingnoob is on a distinguished road
Quote:
Originally Posted by john Wesley View Post
TabControl.TabPages.Count

Doesnt that work?

Also, when you add or remove tab-pages the size of the control does not change but rather the tab's either spread out or overrun.
Property or indexer 'System.Windows.Forms.TabControl.TabPageCollection.Count' cannot be assigned to -- it is read only
programmingnoob is offline   Reply With Quote
Old Jun 27th, 2007, 4:02 PM   #5
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,198
Rep Power: 5 lectricpharaoh will become famous soon enough
Try something like this, where tc is your TabControl instance, and tp is a TabPage:
tc.Controls.Add(tp);
tc.Controls.Remove(tp);
If you want to get the count of tabs, the easiest way is probably to use the TabCount property.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing the look of a tab control crawforddavid2006 C# 4 Jun 18th, 2007 9:06 PM
How to add inherited control to toolbox. InfoGeek C# 3 Feb 8th, 2007 10:12 PM
questions on windows sendMessage and RichEdit control nomer C++ 1 Mar 3rd, 2006 3:51 AM
C programing control of the Serial Port. Light C++ 5 Feb 24th, 2005 3:14 PM
Show web user control hidden see07 C# 1 Feb 2nd, 2005 11:35 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC