Click here to Skip to main content
Licence 
First Posted 22 Jan 2003
Views 57,993
Bookmarked 17 times

Presto, Expando! Meet ExpandoBox

By | 22 Jan 2003 | Article
An expanding group-box like control

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

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralExpando Box PinmemberGarfield39085:25 13 Jan '06  
GeneralReal rounded borders Pinmembersecovel12:32 27 Sep '05  
GeneralVery Nice Control PinmemberBadger08116:36 28 Aug '04  
GeneralCool control... one thing though PinmemberRay Cassick4:48 24 Jan '03  
GeneralRe: Cool control... one thing though PinmemberIbanezPlayer13:53 24 Jan '03  
Generalv--- That said... PinmemberMatt Philmon2:53 24 Jan '03  
GeneralRe: v--- That said... PinmemberIbanezPlayer13:57 24 Jan '03  
GeneralMissing the Point PinmemberHeath Stewart18:14 23 Jan '03  

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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