ListView ColumnHeader cutting off the font (not big enough)

  • Thread starter Thread starter Bob Dankert
  • Start date Start date
B

Bob Dankert

I have a ListView where I increased the font size to make it more readable.
Using visual styles (XP), the columnheader does not adjust it's height for
the font. Is there any way to disable visual styles on just the listview so
the columnheader will display correctly?

Alternateivly, is there someway to force the height (I do not think so with
HDI_HEIGHT being equal to HDI_WIDTH)?

Thanks,

Bob
 
Hi Bob,

Thanks for your feedback.

Can you show us some details of how you "increased the font size", using
system setting or customizing code? Also, I suggest you provide some code
snippet or a sample project to help us reproduce out your issue, then we
can understand your issue much better.

I will wait for your further feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Sure Jeffrey, very simple. Here is a complete solution. If you turn off
visual styles, this works fine. With visual styles on, the columnheader is
a locked height when it is supposed to scale for the font size. With visual
styles off (comment Application.EnableVisualStyles()), it scales the
columnheader as it is supposed to. If Visual Styles are enabled, the
listview is limited to using a font no larger than 16 pixels or so before it
has issues.

Thanks,

Bob

using System;
using System.Windows.Forms;
namespace lvBigHeader
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListView ListView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
public Form1()
{
this.ListView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.ListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
{this.columnHeader1});
this.ListView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 32F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.ListView1.Location = new System.Drawing.Point(8, 8);
this.ListView1.Size = new System.Drawing.Size(272, 216);
this.ListView1.View = System.Windows.Forms.View.Details;
this.columnHeader1.Width = 150;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.ListView1);
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1());
}
}
}
 
Hi Bob,

Thanks for your feedback!!

With your code snippet, I reproduced out your issue on my side. Currently,
I am contacting our product team for this issue, I will feedback any
further progress here ASAP. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Bob,

Sorry for letting you wait for so long.

After doing a lot of research with this issue, we find that this is a
windows OS bug, which the ComCtl6.0 header control forgets to apply the
font information to the drawing DC.

Because this is a Windows OS bug, there is almost no way for us to
workaround this issue.

If you feel this issue is critical for your product, you may contact our
PSS for a hotfix for this bug. Because this is a known issue, this support
instance will be free.
You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://www.microsoft.com/services/microsoftservices/supp.mspx

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks for the information. With this being a known bug, is there something
I can use to reference the bug?

Thanks,

Bob
 
Hi Bob,

Thanks for your feedback.

Yes, I have created this bug record(with your issue report) in the internal
database for the product team, so now it should be a known issue.
However, this is an internal database, I can not paste the record id
publicly. Currently, I suggest you send a email to me, then I will reply to
you with the bug record internal ID(note: there is no public referece link,
only internal record id). With this internal record id, you can contact the
PSS and request hotfix for this record.

At last, my email address is: (e-mail address removed)(remove the
"online."). Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top