Shandy's Blog

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

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

My name is Andrew Sutton, aka Shandy.

I am currently living and working in the UK as a software developer. 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

JunJuly 2005Aug
SMTWTFS
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

Articles

Archives

Topics

Image Galleries

.NET

Blogs I Read

Others

VB.Classic

Sunday, July 24, 2005 #

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 @ 5:00 PM

Having caught up yesterday on my blog reading I noticed CodeIt.Once for VS 2005 Beta 2. I have downloaded both 2003 & 2005 versions and although I can't get the 2005 version to load correctly I'm having a play around with the 2003 version. I'd hoped to have had more of a look at CodeIt.Once than I've been able to but hopefully today I can investigate it a bit more as for a relatively inexperienced .NET programmer like myself I can see it could help me out quite a bit.

posted @ 12:49 PM