473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

ComboBoxRenderer not painting correct on Vista

Evening,

I have a slight erk with the ComboBoxRenderer running under Vista and was
hoping someone could shed some light on this for me.

I've created a custom control that inherits from Button - no problems there
:)

The problem comes with the actual painting of the custom button... The Visa
one blends in almost perfectly with the textbox component of a combo - BUT a
custom painted one shows up as ugly and grey; both in design and run time...
Can anyone explain why or let me know if I am missing something that is
Vista specific?

As I don't have another Vista machine to test this on and don't know another
developer who has Vista I'm stumped...

<code>

#region Fields

private ButtonState buttonState;
private ComboBoxState comboBoxState;

#endregion

protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!ComboBoxRenderer.IsSupported)
{
ControlPaint.DrawComboButton(e.Graphics,
this.ClientRectangle, buttonState );
}
else
{
ComboBoxRenderer.DrawDropDownButton(e.Graphics,
this.ClientRectangle, comboBoxState);
}
}
</code>

I do also SetStyle on the control during initialisation

<code>
private void SetControlStyles()
{
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
}
</code>

Thanks
Brendon

Oct 30 '07 #1
1 2740
Never mind - I found the problem; it appears the Shell Programmers shafted
the ComboBox AGAIN with an upgrade to the OS and development environment
*cry*

So I need to handle the DrawThemeBackground API to render the vista themes
including the Aero visual style -.-

Any MVP's able to give more of a heads up as when/if this will ever get
fixed?

Brendon

"Brendon Bezuidenhout" <ab****@bezfamily.netwrote in message
news:C8**********************************@microsof t.com...
Evening,

I have a slight erk with the ComboBoxRenderer running under Vista and was
hoping someone could shed some light on this for me.

I've created a custom control that inherits from Button - no problems
there :)

The problem comes with the actual painting of the custom button... The
Visa one blends in almost perfectly with the textbox component of a
combo - BUT a custom painted one shows up as ugly and grey; both in design
and run time... Can anyone explain why or let me know if I am missing
something that is Vista specific?

As I don't have another Vista machine to test this on and don't know
another developer who has Vista I'm stumped...

<code>

#region Fields

private ButtonState buttonState;
private ComboBoxState comboBoxState;

#endregion

protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!ComboBoxRenderer.IsSupported)
{
ControlPaint.DrawComboButton(e.Graphics,
this.ClientRectangle, buttonState );
}
else
{
ComboBoxRenderer.DrawDropDownButton(e.Graphics,
this.ClientRectangle, comboBoxState);
}
}
</code>

I do also SetStyle on the control during initialisation

<code>
private void SetControlStyles()
{
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
}
</code>

Thanks
Brendon
Oct 31 '07 #2

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

Similar topics

0
by: Harry_Crow | last post by:
I'm painting in the Non Client area of the control. I'm facing some flicker problem. Is it possible to achive Double buffer painting in Non Client area. The SetStyle with...
5
by: marfi95 | last post by:
I am having to resort to Mick's methods when it comes to hiding/showing tabpages of my tab control since .NET doesn't work correct. I think I have it finally workign the way I need, but because I...
9
by: salad | last post by:
Due to an earlier posting I read in this newsgroup regarding Office 2007 beta, I downloaded it. After I DL'd it, I got an invitation from MS to get WinVista. I am now wondering if, since both...
1
by: Noman Ali | last post by:
Hi, I am facing some problems in Data Grid bool Column. Data Grid bool Column is not painting correctly after Scrolling in .net 1.1. Any one knows how to correct this?? Thankx in advance. ...
56
by: Squishy | last post by:
I tried installing my VS2005 Pro on Vista Ultimate 32 bit RTM today and got errors stating that VS2005 was not compatible with Vista. Microsoft......please pull your finger out of my ass and tell...
6
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: -...
4
by: Marina Levit | last post by:
I am trying to do some processing on a background thread while keeping the UI painting. However, this is a generic server side call routine - and it needs to block until the server side call...
0
by: Ray | last post by:
i use ComboBoxRenderer.DrawDropDownButton method in my application to paint a dropdown button, it shown the same as standard combobox control in xp, but in vista, it is different to standard...
3
by: SabrinaFather | last post by:
I recently discovered that the old VB3 could be installed under Vista Home Edition (i.e a 32 bits code) and be run quite well. Everything appears to be correct (adding new code, running the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.