Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  Windows Development  »  Creating controls that resemble the Microsoft control suite. 1 - Introduction.
Creating controls that resemble the Microsoft control suite. 1 - Introduction.
by Steven Sartain | Published  10/17/2001 | Windows Development | Rating:
Steven Sartain

Steven Sartain is a consultant currently designing and leading a VB.NET project using n-tier architecture and WebServices for Accuride International Ltd.

During his 8 year career as a developer and development lead, Steve has designed and implemented a diverse number of mission critical software solutions using VB, VBA, MS Access, C/C++, ASP, Delphi, DCOM & MTS, SQL Server, Oracle, SQL Anywhere and others. See his Resume for details.

He is also a Director of Iridium Software - a UK based bespoke software development house.

Steve is always open to take over a challenging programming opportunity. If you experience a need for a professional consultant who has all the necessary skills to take a proposition from first client meeting through to profitably and elegantly completed projects; I'm sure Steve could assist. See his Resume and Professional Statement for details.

 

View all articles by Steven Sartain...
Creating controls that resemble the Microsoft control suite. 1 - Introduction.

Part I - An understanding and the first step into the unknown

One of my biggest gripes during the advancement of the Visual Basic language (and probably my only gripe in .NET) is the control set that Microsoft distributes. With each release of Windows and various other Microsoft products, the environment changes to keep our ever increasing thirst for change satisfied. The only disadvantage with this is that Microsoft obviously feels that we shouldn't be exposed to those "if only we could" controls. This stance by Microsoft has kept the 3rd party control developers market very lucrative. We have had the ability to use Visual Basic to accomplish some of what we desire, although sometimes only the hardiest developers tread those paths. Using the .NET suite opens doors that most Visual Basic developers have never stepped through, we have all the power we need, and all we need to do is to learn how to harness it.

Whilst the control library included with .NET is much more feature rich than in previous Visual Basic releases; it still leaves us feeling a little empty. Microsoft has tried to create a common interface for its controls (and with good reason). The labels caption property has now been replaced with the new Text property, as has the caption property on the button (formally commandbutton). The new menu editor make creating and managing menus at design time a pleasure, although they still look like the ones from Visual Basic 3. This goes some way to achieve a commonality between the controls, although one has to ask questions like "Why is there a readonly property on the textbox but not on the combobox?"

The following series of articles will demonstrate how to create a feature rich set of controls that will be the backbone of all your future .NET developments, and of course will resemble the current Microsoft look-and-feel. You'll learn some of the does and don't of the language and hopefully along the way will come to love the language as much as I have!

Toolbar

Maybe it's me, but I love my applications to look and feel like they are the hottest product off the shelf. The easiest was to achieve this is to build a control library that you can enhance and upgrade with time; giving your applications a short back-and-sides every so often.

One component that doesn't remain static is the toolbar (not surprisingly based on the title of this article). We have seen a wide variety of toolbars from Microsoft, and not surprisingly the latest version of the .NET suite comes with its own bundle of joy.

For a development of this scale I found it difficult not to dive into developing using all the "hacks" that I'm accustomed to using in order to achieve an equivalent look. Instead I opted to investigate the language first (a much more sensible approach). During the course of this article I have taken almost as many steps backwards as forwards as I have learnt and understand more of the .NET framework. I'm sure that this will be only the first of many revisions of this article; Microsoft may even distribute an equivalent toolbar with the final release of Visual Studio .NET.

Before stepping into the unknown and creating a control of the complexity of the toolbar we must first design and plan an object hierarchy for our new tool suite. Since the toolbar needs various control contained within it to function; we should consider creating these controls first. With all the new OO features new included with Visual Basic .NET, we now have the capability to deliver this result in a correct manner and with a structured approach.

The first thing we need to decide is what controls we would like to have this new look-and-feel, and what we require them to do in addition to the normal duties they perform. I have listed the controls that this article will cover - the list is likely to grow as I consider new controls that lend themselves to this style.

FlatButtonA button that has the new GUI styling of .NET
FlatComboA flat style combobox, again using the new look
FlatTextboxYou've guessed it
FlatCheckboxAnd again
FlatListboxAnd again
FlatListboxExtendedA listbox that will allow "fast" population of large quantities of data.
FlatMainMenuThe new "Main Menu" look and feel
FlatMenuItemThe popup menu class, this control also doubles as the dropdown from the FlatMainMenu

To be continued ...

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:4.42857142857143 out of 5
 35 people have rated this page
Article Score13575
Sponsored Links