Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 19 Mar 2008 15:31:04 -0700,    group: microsoft.public.dotnet.framework.windowsforms.controls        back       


Flat ComboBox appears 3D   
I having a display problem with a flat style ComboBox contained in a Panel. 
The ComboBox displays incorrectly with a 3D border and is missing the 
dropdown arrow when I run my application under Windows XP. The ComboBox will 
temporarily repaint correctly if I move the form using the mouse off the edge 
of the screen then bring it back. Once I click where the dropdown arrow 
should be, the ComboBox reverts to the 3D effect. Can anyone advise me how to 
correct this? None of these behaviors occur when I run the application under 
Vista. 

The ComboBox is a standard .NET ComboBox with no property changes other than 
the FlatStyle property being set to “Flat”. The control is not subclassed and 
has no custom event handlers. Both the Panel and the Form the Panel rests on 
have custom backgrounds. The application is set to use double buffering.
 
Thanks for any help you can provide.

Regards,
Keith
date: Wed, 19 Mar 2008 15:31:04 -0700   author:   Keith Furino Keith

RE: Flat ComboBox appears 3D   
Hi Keith,

I'm not exactly sure what is happening, but I believe your problem is caused 
by the custom background.  The documentation for FlatStyle even gives a 
warning for using FlatStyle.System, although there may be issues for 
FlatStyle.Flat as well.  It may well be that the Flat style is just paint 
ontop of the 3D control which isn't triggered when it should.  Try tweaking 
the background rendering, and perhaps call Invalidate on the ComboBox 
whenever the background is repainted.

-- 
Happy Coding!
Morten Wennevik [C# MVP]


"Keith Furino" wrote:

> I having a display problem with a flat style ComboBox contained in a Panel. 
> The ComboBox displays incorrectly with a 3D border and is missing the 
> dropdown arrow when I run my application under Windows XP. The ComboBox will 
> temporarily repaint correctly if I move the form using the mouse off the edge 
> of the screen then bring it back. Once I click where the dropdown arrow 
> should be, the ComboBox reverts to the 3D effect. Can anyone advise me how to 
> correct this? None of these behaviors occur when I run the application under 
> Vista. 
> 
> The ComboBox is a standard .NET ComboBox with no property changes other than 
> the FlatStyle property being set to “Flat”. The control is not subclassed and 
> has no custom event handlers. Both the Panel and the Form the Panel rests on 
> have custom backgrounds. The application is set to use double buffering.
>  
> Thanks for any help you can provide.
> 
> Regards,
> Keith
> 
>
date: Sat, 22 Mar 2008 03:30:00 -0700   author:   Morten Wennevik [C# MVP]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us