Click here to Skip to main content
Licence CPOL
First Posted 26 Jan 2007
Views 27,087
Downloads 228
Bookmarked 21 times

Simple Bevel Control

By | 26 Jan 2007 | Article
A simple control for visually grouping controls with edges / bevels
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

Software Developer

Germany Germany

Member



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
GeneralArtifacts when resizing PinmemberJustAResearcher9:51 6 Nov '09  
GeneralVery Nice Pinmembersunnyandy9:06 27 Sep '08  
Thank you very much!
I always liked the Bevels from Delphi, too Smile | :)
QuestionHow about ControlPaint PinmemberOleg A.Lukin22:37 29 Jan '07  
AnswerRe: How about ControlPaint PinmemberOlliFromTor23:07 29 Jan '07  
GeneralToolbox Pinmemberfraveu7:51 29 Jan '07  
GeneralRe: Toolbox PinmemberOlliFromTor21:45 29 Jan '07  
GeneralRe: Toolbox [modified] Pinmemberfraveu2:48 30 Jan '07  
GeneralExcellent PinmemberPatrick Sears9:47 26 Jan '07  
GeneralNice Pinmemberricmil427:25 26 Jan '07  
GeneralRe: Nice PinmemberIlíon5:18 29 Jan '07  

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
Web04 | 2.5.120604.1 | Last Updated 26 Jan 2007
Article Copyright 2007 by OlliFromTor
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid