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

Advanced Shape Control

By , 4 Sep 2002
Rate this:
Please Sign up or sign in to vote.

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

NameSpaces Used 

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.

Properties 

Properties are divided into sub categories as 

Borderproperties

 

 

 

 

 

TextProperties

HatchProperties

GradiantProperties     

 

ShadowProperties

 

 

 

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

About the Author

Sreenivas Vemulapalli
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

 
GeneralMy vote of 5 Pinmembermanoj kumar choubey18-Feb-12 3:12 
GeneralBadge Designer Pinmemberyogeshcprajapati@hotmail.com Yogesh18-Aug-09 7:03 
GeneralShare- RoundedRectangle not working Pinmembersbkrishnan2511-Nov-08 22:38 
Generalparameter is not valid.Error Pinmemberkhandelwalpankajcdac13-Jan-08 5:28 
GeneralBorderStyle Bug PinmemberMQUINNUSA18-Jun-07 11:09 
GeneralThanx ....Great control Pinmemberammsamm21-Apr-07 13:05 
QuestionRead ShapeEx using xmlReader ?? PinmemberPrajakta Patil16-Jan-07 17:46 
AnswerRe: Read ShapeEx using xmlReader ?? Pinmemberyogeshcprajapati@hotmail.com Yogesh15-May-09 6:40 
QuestionThanks! But we need your help... PinmemberPrajakta Patil17-Dec-06 18:24 
GeneralDisplaying ShapeEx in my toolbox Pinmemberechelon38097-Dec-06 2:16 
GeneralRe: Displaying ShapeEx in my toolbox PinmemberEdmondo Gigli5-Jan-10 1:00 
GeneralGenerating Shapes at Runtime PinmemberChandan_Kr30-Aug-06 0:55 
GeneralVB.NET 2003 Pinmemberfissidens4-Nov-05 23:26 
GeneralTransparent Fill Pinmembermuralikannur6-Mar-05 21:52 
GeneralRe: Transparent Fill PinmemberMohan Patil11-Mar-07 18:48 
GeneralRe: Transparent Fill Pinmembera_annunz20-Feb-08 5:11 
AnswerRe: Transparent Fill Pinmemberdcallaghan11-Dec-08 5:59 
GeneralSSL Pinmembersunyz23-Dec-04 20:40 
Generalneed line control Pinmembernjpost4123-Feb-04 10:34 
GeneralExcellent Control. Fill Color bug... PinsussAnonymous21-Nov-03 17:53 
GeneralExpandableObjectConverter busted Pinmemberelitecommerceserver17-Sep-03 18:14 
GeneralRe: ExpandableObjectConverter busted PinsussAnonymous19-Jun-04 2:28 
GeneralGood work PineditorNishant S11-Sep-03 3:21 
GeneralThx...I was looking for this type of control PinmemberWGenc4-Aug-03 10:23 

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.

| Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 5 Sep 2002
Article Copyright 2002 by Sreenivas Vemulapalli
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid