Repro case of nasty .NET 1.1 SP1 bug in groupbox control, Microsoft please read

Yesterday I blogged about a horrible huge bug in the groupbox control for winforms in .NET 1.1 SP1 on a themed XP system (and that's pretty much all XP systems nowadays, since .NET 1.1 SP1 is a mandatory fix on windows update.). Today I'll show you a repro case. It's a silly form with just two nested groupboxes. On a themed XP machine you'll see that the inner groupbox' caption is garbled and has a horrible font.

I've tested this on more XP machines and they all showed the same results, with different themes (native XP ones). I'll try to contact PSS later today to get a fix for this AND to get this fixed publicly, because a private PSS-call-us-fix is useless, as users of applications by ISV's first have to call PSS to grab the special fix, which most of them won't do.

Update: It seems to occur on .NET 2.0 beta1 as well.

Full code:


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WinAppTest
	/// Summary description for Form1.
	public class Form1 : System.Windows.Forms.Form
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.ComponentModel.Container components = null;

		public Form1()

		#region Windows Form Designer generated code
		/// Clean up any resources being used.
		protected override void Dispose( bool disposing )
			if( disposing )
				if (components != null) 
			base.Dispose( disposing );

		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		private void InitializeComponent()
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			// groupBox1
			this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.groupBox1.Location = new System.Drawing.Point(21, 27);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(336, 174);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "groupBox1";
			// groupBox2
			this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.groupBox2.Location = new System.Drawing.Point(81, 45);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.TabIndex = 0;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "groupBox2";
			// Form1
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(502, 278);
			this.Name = "Form1";
			this.Text = "Form1";


		/// The main entry point for the application.
		static void Main() 
			Application.Run(new Form1());


  • Just tested it in .NET v2.0 Beta1, still there. By the way, it must've something to do with the FlatStyle=FlatStyles.System setting. Change this, and it renders OK.

    What an ugly bug indeed. I'd really like to know what causes this one :)

  • Wolfgang: the Flatstyles.System is required otherwise you won't get themed groupbox controls on a themed XP. The stupid thing is: it did work in .NET 1.0 and .NET 1.1, but it's broken since SP1. Thanks for testing this on .NET 2.0 beta, so I can file a bug for them in the bug db. (or you can do that of course ;))

  • MVP's in Oz get free Premier support.

    I did not say this. I was not here.

  • Scott, there was already a bugreport of this, for .net 2.0 beta, and it was fixed dec. 10. See my comment in this thread. I'll try to contact the C#/.NET MVP lead to get this fixed pronto.

  • Join the crowd, we have identified a combobox bug that's caused some problems for us

Comments have been disabled for this content.