Shandy's Blog

Where Andrew Sutton, aka Shandy rants and rambles on as the fancy takes him

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

My name is Andrew Sutton, aka Shandy.

I am currently living and working in the UK within the garment industry as an IT specialist. This blog contains mainly IT related issues.

I was a Microsoft VB MVP for a couple of years (Apr 2004-Mar 2006) and was a vbCityLeader between April 2003 and June 2007.

If you are looking for my Sri Lanka or Morocco experiences check out Shandy's Sri Lanka Blog or Shandy's Morocco Blog. My personal (Non IT) blog is now at Shandy's Place

OctNovember 2008Dec
SMTWTFS
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Articles

Archives

Topics

Image Galleries

.NET

Blogs I Read

Others

VB.Classic

Sometimes I really despair. I am currently trying (note not succeeding) to produce a wrapper for the .NET 1.x Tab Control, which IMHO is woefully short of functionality. I was making some headway until I discovered a couple of interesting points

  1. If you add a TabPage taken from one TabPageCollection into another TabPageCollection it is removed from the first TabPageCollection. I can live with that. A nuisance but I can live with it.
  2. TabPageCollections are 0 based. Collections are 1 based. This makes utilising a Collection class instead of a TabPageCollection difficult because you have to remember to convert the indexes between the two all the time.

So a rather simple problem of producing one collection to keep track of visible and invisible PageTabs (by default the visible property is ignored but that's another story) suddenly starts to get a bit more complicated. I can't use a single TabPageCollection because adding any TabPages from the actual control's TabPages into my own TabPageCollection removes the TabPage from the tab control's TabPages. And using a standard collection also holds perils (which a 30 minute debugging session has revealed) as I have to remember to keep changing the index when referencing between TabPageCollections and standard collections.

My real gripe is why aren't ALL collections 1 based (or 0 based for that matter - I don't care which). Personally I think it is better to be illogical but consistant rather logical but inconsistant.

So now I am researching how to create a 0 based class.

The thing that annoys me is that all this takes time. Yes, I'll figure out how to create a 0 based collection class, probably learning some useful points along the way but as with the great majority of my .NET projects I am in danger of losing interest in it because it is taking way too long to create something useful.

OK, I'll tuck my soapbox away, pour myself a beer and start looking into creating a 0 based collection class. If anyone has already created a 0 based collection class or knows where the code for one is please let me know. I have little interest in re-inventing the wheel in this particular instance. I'm more interested in getting my TabControlExtensions class up and running :)

posted on Sunday, July 24, 2005 5:00 PM