Click here to Skip to main content
Click here to Skip to main content

Presto, Expando! Meet ExpandoBox

By , 22 Jan 2003
 

Introduction

ExpandoBox is a VB.NET custom control. It works like a groupbox. You can put controls inside it at design time; use it to keep radio button choices grouped together, or whatever else you feel the need to. The cool thing about ExpandoBox is that it expands and contracts. It is a great screen real estate saver. It comes with over 20 different color schemes, and creating your own is easy.

Details

ExpandoBox has 2 different orientations: Horizontal (expands left to right) and Vertical (Expands up and down). It also has 2 different border styles, Rounded and Rectangular. It can also be resized and dragged around a form. There are several other UI related properties such as CanMove, CanResize, CanToggle and ShowTitleBar. It supports Enabled and Disabled states well, too.

ExpandoBox is a great learning project. At least it was for me. I’ve developed several controls from the UserControl class, but this was my first class that inherits directly from Control. There are some cool GDI+ tricks, including how to draw text at different orientations.

ExpandoBox uses some cool VB.NET/OO features that did not exist in VB prior to .NET. There are overloaded functions, structures, private classes, and even an example of a public class that uses a friend constructor. It uses the standard .NET event signatures (ByVal sender As Object, e As System.EventArgs) and it’s own EventArgs class.

Conclusion

There are some great things in the ExpandoBox for both the new and experienced VB.NET developer to examine. The code is fairly well commented. Hope you enjoy. Not everything cool needs to be done in C#!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

IbanezPlayer
Web Developer
Malaysia Malaysia
Member
As an experienced programmer, I know how hard it is to find good code sometimes. I hope my articles and samples are as good for you as they are for me. Need more good code? Email me.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralExpando BoxmemberGarfield390813 Jan '06 - 5:25 
GeneralReal rounded bordersmembersecovel27 Sep '05 - 12:32 
GeneralVery Nice ControlmemberBadger08128 Aug '04 - 16:36 
GeneralCool control... one thing thoughmemberRay Cassick24 Jan '03 - 4:48 
GeneralRe: Cool control... one thing thoughmemberIbanezPlayer24 Jan '03 - 13:53 
Generalv--- That said...memberMatt Philmon24 Jan '03 - 2:53 
GeneralRe: v--- That said...memberIbanezPlayer24 Jan '03 - 13:57 
GeneralMissing the PointmemberHeath Stewart23 Jan '03 - 18:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 23 Jan 2003
Article Copyright 2003 by IbanezPlayer
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid