Home > Computers and Internet > Control Design in .NET 2.0

Control Design in .NET 2.0

24-Apr-06 06:04 pm EST Leave a comment Go to comments
In .NET 1.x, the usage of Collections seemed to always be the way to group objects together and to perform group operations (leveraging IEnumerable as shamelessly as possible).  Yet in certain instances, the design philosophy of .NET objects aren’t Collection-oritented.  And this apparent dichotomy in design philosophy can confuse the novice developer.

Take for example a question I had put to me by a novice developer studing Visual Basic .NET at Red River College in Winnipeg, MB.  She was using VS 2k5 to develop a Windows Form that leveraged the new CheckedListBox control & needed to make the checkboxes therein appear "disabled" to that users couldn’t check them, and so that when the control had new Items added to it they would scroll.  She discovered that simply turning the containing CheckedListBox control itself to "Enabled = False’ didn’t do what she needed.

Not being immediately familiar with the control, I expected to find the control was actually a well-designed container with the Items being a collection of CheckBox controls.  But this wasn’t the case!  Imagine my surprise to learn that the Items are strings, whcih map to what would otherwise be the Text property of each of the child CheckBox elements.  And the checkboxes themselves are accessed as array elements from another property of the CheckedListBox.

Am I just nuts here?  Or does anyone else feel that a Collection of Checkboxes within the control might have made more sense?  Any philosophical guesses at why MS might have designed the control this way would prove enlightening to this developer.

Incidentally, I was able to help the RRC student with her problem by simply setting individual properties that simulated the effect desired, starting with setting the CheckedListBox.CheckOnClick = False within the CheckedListBox_SelectedIndexChanged event.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Terry Glavin

CHRONICLES

Techno Manor

Geek's Corner

VM.Blog.

an IT blog.. and an occasional rant

Yammer Site Status

Is Yammer down? Offline? Broken? Undergoing scheduled maintenance? When will it be back? Find out here.

jalalaj

A journey full of wonderful experiences

Azure and beyond

My thoughts on Microsoft Azure and cloud technologies

TechCrunch

Startup and Technology News

Ottawa Citizen

Ottawa Latest News, Breaking Headlines & Sports

National Post

Canadian News, World News and Breaking Headlines

Targeted individuals's

One Government to rule them all.

Joey Li's IT Zone

Everything about IT

jenyamatya

Unravelling the magik of code...

The Bike Escape

Because Cycling is Life

The Ross Report

Now you know where you need to know more...

Lights in the Dark

A journal of space exploration

Strength Rehabilitation Institute

Bridging the gap between physiotherapy and exercise.

The Ross Report

Now you know where you need to know more...

Little Girl's Mostly Linux Blog

Nothing to see here. Move along...

David Eedle

Geek, tech, programmer, business owner. Serial starter of things. Occasional finisher. Oh, and please don't call me Dave.

%d bloggers like this: