Dec 13, 2006 #1 bouwob Programmer Apr 12, 2006 171 US I have a groubbox that containes a border and would like to have it removed. I am using the groupbox to set up a set of radiobuttons but am getting design issues with not being able to remove the border. Any ideas?
I have a groubbox that containes a border and would like to have it removed. I am using the groupbox to set up a set of radiobuttons but am getting design issues with not being able to remove the border. Any ideas?
Dec 13, 2006 1 #2 JurkMonkey Programmer Nov 23, 2004 1,731 CA you will need to create a class that extends the group box and use it instead. public class CustomGroupBox : System.Windows.Forms.GroupBox { public CustomGroupBox() { } protected override void OnPaint(object sender, PaintEventArgs e) { e.Graphics.DrawRectangle(SystemPens.ControlDark, 0,0, this.Width - 1, this.Height - 1); //Draw a custom border // base.Paint(e); //comment out this line } } Upvote 0 Downvote
you will need to create a class that extends the group box and use it instead. public class CustomGroupBox : System.Windows.Forms.GroupBox { public CustomGroupBox() { } protected override void OnPaint(object sender, PaintEventArgs e) { e.Graphics.DrawRectangle(SystemPens.ControlDark, 0,0, this.Width - 1, this.Height - 1); //Draw a custom border // base.Paint(e); //comment out this line } }