Click here to Skip to main content
15,886,809 members
Articles / Desktop Programming / Windows Forms

The Grouper - A Custom Groupbox Control

Rate me:
Please Sign up or sign in to vote.
4.88/5 (130 votes)
22 Jan 20067 min read 337.2K   13.2K   272  
The Grouper is a special groupbox control that is rounded and fully customizable. The control can paint borders, drop shadows, and has other features like gradient and solid backgrounds, custom text, and custom icons.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Design;

namespace CodeVendor.Controls
{
	/// <summary>
	/// Summary description for TestControl.
	/// </summary>
	public class TestControl : System.Windows.Forms.UserControl
	{
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private HatchStyle V_Style;

		/// <summary>Custom TypeEditor for selecting a HatchStyle Brush.</summary>
		[Category("Appearance"), Description("Custom TypeEditor for selecting a HatchStyle Brush."), Editor(typeof(HatchBrushTypeEditor), typeof(UITypeEditor))]
		public HatchStyle HatchStyle{get{return V_Style;} set{V_Style=value; this.Refresh();}}

		public TestControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call

		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
		}
		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

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
Software Developer (Senior) Codevendor
United States United States
Please visit my personal website https://codevendor.com for my latest codes and updates.

Comments and Discussions