Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / March 2008

Tip: Looking for answers? Try searching our database.

Flat ComboBox appears 3D

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith Furino - 19 Mar 2008 23:31 GMT
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
Morten Wennevik [C# MVP] - 22 Mar 2008 11:30 GMT
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.

Signature

Happy Coding!
Morten Wennevik [C# MVP]

> 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
[quoted text clipped - 14 lines]
> Regards,
> Keith

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.