5,693,062 members and growing! (16,428 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Beginner License: The Code Project Open License (CPOL)

Simple Bevel Control

By OlliFromTor

A simple control for visually grouping controls with edges / bevels
C#, Windows, .NET, Visual Studio, Dev

Posted: 26 Jan 2007
Updated: 26 Jan 2007
Views: 14,028
Bookmarked: 16 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
17 votes for this Article.
Popularity: 4.46 Rating: 3.63 out of 5
1 vote, 5.9%
1
2 votes, 11.8%
2
2 votes, 11.8%
3
3 votes, 17.6%
4
9 votes, 52.9%
5
Sample Image - bevelcontrol.jpg

Introduction

Recently, I ran into the problem of grouping components visually. I wasn't satisfied with panels and groupboxes so I searched for an alternative. After some Googling, I decided to write a simple control by myself.

Background

"Good ol' Delphi" provided a nifty component called TBevel for visually grouping controls. It's not a container and acts only like a "spacer".

Controls like this are often used to divide buttons at the bottom of a form from the others above. Take a look at the "OK" and "Cancel" buttons in the screen shot. They are visually grouped together and divided from the rest.

Using the code

Provided are four additional properties:

BevelStyle Possible values:
public enum BevelStyle
{
  Lowered,
  Raised
}
BevelType Possible values:
public enum BevelType 
{
  Box, 
  Frame, 
  TopLine, 
  BottomLine, 
  LeftLine,
  RightLine, 
  Spacer                        
}
HighlightColor Possible values:
any Color
ShadowColor Possible values:
any Color

Points of Interest

Well, there are none... It's just a simple graphical control. Nothing special - but definitely a "nice to have".

There is only one thing I could mention here: The value BevelType.Spacer displays a dotted rect around the control only at designtime.

History

  • 26th January, 2007: Initial release

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

OlliFromTor



Occupation: Web Developer
Location: Germany Germany

Other popular Miscellaneous articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 9 of 9 (Total in Forum: 9) (Refresh)FirstPrevNext
GeneralVery Nicemembersunnyandy10:06 27 Sep '08  
GeneralHow about ControlPaintmemberOleg A.Lukin23:37 29 Jan '07  
GeneralRe: How about ControlPaintmemberOlliFromTor0:07 30 Jan '07  
GeneralToolboxmemberfraveu8:51 29 Jan '07  
GeneralRe: ToolboxmemberOlliFromTor22:45 29 Jan '07  
GeneralRe: Toolbox [modified]memberfraveu3:48 30 Jan '07  
GeneralExcellentmemberPatrick Sears10:47 26 Jan '07  
GeneralNicememberricmil428:25 26 Jan '07  
GeneralRe: NicememberIlíon6:18 29 Jan '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 26 Jan 2007
Editor: Deeksha Shenoy
Copyright 2007 by OlliFromTor
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project