Click here to Skip to main content
15,881,588 members
Articles / Programming Languages / Visual Basic
Article

Advanced Shape Control

Rate me:
Please Sign up or sign in to vote.
4.81/5 (26 votes)
4 Sep 20022 min read 194.9K   3.4K   65   25
Advanced Shape Control

Introduction

For some reason microsoft decided that we don't need the shape control that comes with Visual Studio 6.0, and removed it from VS.NET and left us to buy a third party control or develop one by our own.

Well, with the extensive namespaces that dot net supports for GDI+ and Windows Controls, it's easy to develop and extend the old shape control. The main purpose of this control is, its a lightweight control and  improves the user interface very much by grouping controls with out using a Group box or other controls.

This article is also a good resource for GDI+, and propertygrid control. I am developing this control as a Windows Extended controls library, to which i will be adding more controls in future. So, any suggetions for custom controls are welcome.

This article assumes that you have good understanding of GDI+, PropertyGrid and Windows Controls.

Refer to my other article on propertygrid Using PropertyGrid

Image 1

NameSpaces Used 

VB.NET
System.ComponentModel
System.ComponentModel.Design.Serialization
System.Text
System.Drawing
System.Drawing.Drawing2D
System.Globalization
System.Reflection
System.Windows.Forms

Topics Covered 

  • GDI +
  • Windows Controls
  • PropertyGrid

Description

The attached project has a demo showing how to use the control. Well, using the control is fairly simple yet very extensive. It supports 4 shapes with Solid colors, Gradiant fill, Textures, Hatch fills, shadows, 3D Borders,text and 3D border styles. Using these combinations you can create a variety of effects. The main purpose of this control is to improve the visual appearance of the forms, so use of 1 or 2 instances will be enough to achive the result.

Image 2

Properties 

Properties are divided into sub categories as 

Borderproperties

Image 3

 

 

 

 

 

TextProperties

Image 4

HatchProperties

Image 5

GradiantProperties     

 Image 6

ShadowProperties

Image 7

 

 

 

Each of these properties can be expanded from propertygrid and customized based on the requirement also these properties can be turned on or off by a Drawxxxx property.   

ToDo Features

  • Implement support for other shapes
  • Implement a C# version
  • Implement 3D Borders for all shapes

Notes

  • Please post any remarks,bugs to this article's thread
  • Suggestions are welcome for windows controls as part of my Windows Extended Controls Library

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


Written By
Web Developer
United States United States
Working as consultant in Client/server,Web Development, Automation areas using C#,Vb,Vb.net,Asp.net,Sql Server,Xml,Html&Dhtml etc..
Looking for a challenging project in .NET

Comments and Discussions

 
Questionwhy do we need Relfection? Pin
Southmountain17-Jun-22 7:48
Southmountain17-Jun-22 7:48 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey18-Feb-12 3:12
professionalManoj Kumar Choubey18-Feb-12 3:12 
GeneralBadge Designer Pin
yogeshcprajapati@hotmail.com Yogesh18-Aug-09 7:03
yogeshcprajapati@hotmail.com Yogesh18-Aug-09 7:03 
GeneralShare- RoundedRectangle not working Pin
sbkrishnan2511-Nov-08 22:38
sbkrishnan2511-Nov-08 22:38 
Generalparameter is not valid.Error Pin
Ezbase13-Jan-08 5:28
Ezbase13-Jan-08 5:28 
GeneralBorderStyle Bug Pin
MQUINNUSA18-Jun-07 11:09
MQUINNUSA18-Jun-07 11:09 
GeneralThanx ....Great control Pin
ammsamm21-Apr-07 13:05
ammsamm21-Apr-07 13:05 
QuestionRead ShapeEx using xmlReader ?? Pin
Prajakta Patil16-Jan-07 17:46
Prajakta Patil16-Jan-07 17:46 
AnswerRe: Read ShapeEx using xmlReader ?? Pin
yogeshcprajapati@hotmail.com Yogesh15-May-09 6:40
yogeshcprajapati@hotmail.com Yogesh15-May-09 6:40 
QuestionThanks! But we need your help... Pin
Prajakta Patil17-Dec-06 18:24
Prajakta Patil17-Dec-06 18:24 
GeneralDisplaying ShapeEx in my toolbox Pin
echelon38097-Dec-06 2:16
echelon38097-Dec-06 2:16 
GeneralRe: Displaying ShapeEx in my toolbox Pin
Edmondo Gigli5-Jan-10 1:00
Edmondo Gigli5-Jan-10 1:00 
GeneralGenerating Shapes at Runtime Pin
Chandan_Kr30-Aug-06 0:55
Chandan_Kr30-Aug-06 0:55 
GeneralVB.NET 2003 Pin
fissidens4-Nov-05 23:26
fissidens4-Nov-05 23:26 
GeneralTransparent Fill Pin
muralikannur6-Mar-05 21:52
muralikannur6-Mar-05 21:52 
GeneralRe: Transparent Fill Pin
Mohan Patil11-Mar-07 18:48
Mohan Patil11-Mar-07 18:48 
GeneralRe: Transparent Fill Pin
a_annunz20-Feb-08 5:11
a_annunz20-Feb-08 5:11 
AnswerRe: Transparent Fill Pin
dcallaghan11-Dec-08 5:59
dcallaghan11-Dec-08 5:59 
GeneralSSL Pin
won pau hua23-Dec-04 20:40
won pau hua23-Dec-04 20:40 
Generalneed line control Pin
njpost4123-Feb-04 10:34
njpost4123-Feb-04 10:34 
GeneralExcellent Control. Fill Color bug... Pin
Anonymous21-Nov-03 17:53
Anonymous21-Nov-03 17:53 
GeneralExpandableObjectConverter busted Pin
elitecommerceserver17-Sep-03 18:14
elitecommerceserver17-Sep-03 18:14 
GeneralRe: ExpandableObjectConverter busted Pin
Anonymous19-Jun-04 2:28
Anonymous19-Jun-04 2:28 
GeneralGood work Pin
Nish Nishant11-Sep-03 3:21
sitebuilderNish Nishant11-Sep-03 3:21 
GeneralThx...I was looking for this type of control Pin
WGenc4-Aug-03 10:23
WGenc4-Aug-03 10:23 

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

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