473,804 Members | 4,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ugly groupbox caption font after .NET 1.1 SP1 upgrade

Hi!

I have this medium sized solution with a couple of projects and stuff.
The generated application has an <appname>.exe.m anifest file to enable
XP themes. In the main window of the application I have several group
boxes, and even some group boxes within other group boxes.
FlatStyle=Syste m on these group boxes has always worked just fine.
Round corners on the borders and blue caption text (standard
Luna/Silver theme).

Just now, I installed .NET Framework 1.1 SP1 and all the group boxes
that were inside other group boxes has these large ugly fonts in the
caption which doesn't even fit the designated space. The group boxes
that are placed directly on the form works just fine. It's only the
ones inside other group boxes.

I've verified this on several computers. pre-SP1 works, post-SP1
doesn't. I've also created a blank project with a single form. One
group box within another group box. Same result.

Visual Studio.NET 2003 7.1.3088 (Visual Basic.NET 2003)
Windows XP Professional SP2 English
..NET Framework 1.1.4322 SP1

Has anyone else encountered this? Any recommendations on how to solve
it?

Best regards,

Dennis "Dempa" Sjogren
Dalarna University, Sweden

Nov 21 '05
23 2176
* "Mick Doherty" <EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> scripsit:
You obviously like to read, unlike me.
I never read a book about .NET, but I read the documentation. Sometimes
reading is necessary... though I avoid reading because it's
time-consuming.
I would still like to see a completely new set of controls to replace the
existing wrapped common controls, but then I guess that's what third party
control suites are for. If off the shelf controls worked as expected then I
would probably be bored with programming anyway, since I spend most of my
time playing with broken controls.


:-)

That's what we are doing here in the group day by day: Spending our
time discussing possible bugs and issues, and finding fixes and
workarounds. I would miss that too. But I agree that a completely new
set of controls that is not a wrapper around the existing common
controls would be great.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #21
"Dennis Sjogren" <la********@gma il.com> wrote in message news:<ch******* *@odbk17.prod.g oogle.com>...
Hi!

I have this medium sized solution with a couple of projects and stuff.
The generated application has an <appname>.exe.m anifest file to enable
XP themes. In the main window of the application I have several group
boxes, and even some group boxes within other group boxes.
FlatStyle=Syste m on these group boxes has always worked just fine.
Round corners on the borders and blue caption text (standard
Luna/Silver theme).

Just now, I installed .NET Framework 1.1 SP1 and all the group boxes
that were inside other group boxes has these large ugly fonts in the
caption which doesn't even fit the designated space. The group boxes
that are placed directly on the form works just fine. It's only the
ones inside other group boxes.

I've verified this on several computers. pre-SP1 works, post-SP1
doesn't. I've also created a blank project with a single form. One
group box within another group box. Same result.

Visual Studio.NET 2003 7.1.3088 (Visual Basic.NET 2003)
Windows XP Professional SP2 English
.NET Framework 1.1.4322 SP1

Has anyone else encountered this? Any recommendations on how to solve
it?

Best regards,

Dennis "Dempa" Sjogren
Dalarna University, Sweden


We've also seen it here. One thing we tried was changing the
FlatStyle property from System to Standard. This fixes the problem,
but it disables the XP styling of the groupbox.

Corey
Nov 21 '05 #22


Heres how to fix it:

Workaround 1:
Currently a workaround here is that we may put the nested child
GroupBoxes into a Panel. Since the Panel is invisible, this can have the
same visual effect.

Workaround 2:
Derive from the GroupBox class and override its WndProc function to
process the ¡°WM_PRINTCLIEN T¡± message correctly:

//Please add the following using statement:
using System.Runtime. InteropServices ;

public class FixedGroupBox : GroupBox
{
[DllImport("User 32.dll", ExactSpelling = true, CharSet =
CharSet.Auto)]
public static extern bool GetClientRect(H andleRef hWnd, [In,
Out] ref RECT
rect);
private const int WM_PRINTCLIENT = 0x0318;
[StructLayout(La youtKind.Sequen tial)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
public RECT(int left, int top, int right, int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public RECT(System.Dra wing.Rectangle r)
{
this.left = r.Left;
this.top = r.Top;
this.right = r.Right;
this.bottom = r.Bottom;
}
public static RECT FromXYWH(int x, int y, int width, int
height)
{
return new RECT(x, y, x + width, y + height);
}
public System.Drawing. Size Size
{
get
{
return new
System.Drawing. Size(this.right - this.left, this.bottom - this.top);
}
}
}
private void WmPrintClient(r ef Message m)
{
RECT rect = new RECT();
GetClientRect(n ew HandleRef(this, Handle), ref rect);
Graphics graphics = Graphics.FromHd c(m.WParam);
Brush b = new SolidBrush(Back Color);
graphics.FillRe ctangle(b, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top);
graphics.Dispos e();
b.Dispose();
m.Result = (IntPtr)1;
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_PRINTCLIENT:
WmPrintClient(r ef m);
break;
default:
base.WndProc(re f m);
break;
}
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #23
Very nice, but I get exactly the same result with the following code:

\\\
using System.Windows. Forms;

public class FixedGroupBox : GroupBox
{
private const int WM_PRINTCLIENT = 0x0318;

protected override void WndProc(ref Message m)
{
if (m.Msg == WM_PRINTCLIENT)
m.Result = (IntPtr)1;
else
base.WndProc(re f m);
}

}
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rich Tomanio" <ri************ *@nojunksiemens .com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..


Heres how to fix it:

Workaround 1:
Currently a workaround here is that we may put the nested child
GroupBoxes into a Panel. Since the Panel is invisible, this can have the
same visual effect.

Workaround 2:
Derive from the GroupBox class and override its WndProc function to
process the ¡°WM_PRINTCLIEN T¡± message correctly:

//Please add the following using statement:
using System.Runtime. InteropServices ;

public class FixedGroupBox : GroupBox
{
[DllImport("User 32.dll", ExactSpelling = true, CharSet =
CharSet.Auto)]
public static extern bool GetClientRect(H andleRef hWnd, [In,
Out] ref RECT
rect);
private const int WM_PRINTCLIENT = 0x0318;
[StructLayout(La youtKind.Sequen tial)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
public RECT(int left, int top, int right, int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public RECT(System.Dra wing.Rectangle r)
{
this.left = r.Left;
this.top = r.Top;
this.right = r.Right;
this.bottom = r.Bottom;
}
public static RECT FromXYWH(int x, int y, int width, int
height)
{
return new RECT(x, y, x + width, y + height);
}
public System.Drawing. Size Size
{
get
{
return new
System.Drawing. Size(this.right - this.left, this.bottom - this.top);
}
}
}
private void WmPrintClient(r ef Message m)
{
RECT rect = new RECT();
GetClientRect(n ew HandleRef(this, Handle), ref rect);
Graphics graphics = Graphics.FromHd c(m.WParam);
Brush b = new SolidBrush(Back Color);
graphics.FillRe ctangle(b, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top);
graphics.Dispos e();
b.Dispose();
m.Result = (IntPtr)1;
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_PRINTCLIENT:
WmPrintClient(r ef m);
break;
default:
base.WndProc(re f m);
break;
}
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Nov 21 '05 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3781
by: Randall Sell | last post by:
Can anyone confirm if I am being an idiot, or is this a bug in the CSS implementation of Netscape 7.x/Mozilla 1.4 ... give the following single HTML: <html> <head> <style type="text/css"> <!-- caption {
4
16727
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go, then a generic element's font will do OK, too. What's the correct way to do this, please (so that it will also work for IE 6)? The motivation for this is that I have some text on the screen and I want to insert a textarea element between the...
8
3948
by: Wally | last post by:
I would like to have an image with a caption displayed below it. The size of the image will vary. The caption should not extend beyond the width of the image. How can I cause the text of the caption to wrap so that it will stay within the (varying) width of the image? Any ideas?
3
16882
by: Mr.Clean | last post by:
I am trying to mimic a Windows GroupBox control using fieldset, label and radio buttons. The problem lies in that I can not correctly do the radio buttons relative to the groupbox and the label doesn't get placed in the right place. The word Female should be to the right of the radio button. Should I use a label for the radio button's caption here instead? Can anyone help out? http://www.austinmetrobaseball.com/groupbox.html
0
3051
by: Chenghui Li | last post by:
We have a problem with the Windows XP theme: We have a IDE which allows other developers to develop visual programs for their customers. Our IDE allow them to set font for window captions easyly (through a dialog). It works fine fo W98, 2000, NT, and XP is the theme is Classic. But on XP if the theme is "Windows XP", the we have a problem: if the developer set the caption font to be say, "Script" (and all non-default font), then the...
1
1395
by: r_ahimsa_m | last post by:
Hello, Why the rule: caption { font-style: bolder; } on document containing:
14
2831
by: Roedy Green | last post by:
Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
5
1187
by: Rob Panosh | last post by:
Hello, If I set the font of a form and menustrip all the controls and menu options will show using this font. The only issue I am having is the text that shows in the caption of the the form (me.text) is not honoring the font, I'm guesing that it should use the font assigned to the menu. Does anybody know how to set font for the foms caption? Thanks, Rob
2
3635
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts" are supposed to be in the font: Georgia, but they are showing up in "Times New Roman"...blah! I can't find anything wrong in the code, but who am I trying to fool? I know nothing about this stuff. The code is below. The parts that I *think*...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.