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
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