469,267 Members | 979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

ComboBox & XP Styles

Hello!

I'm using VB.NET 2003 and Windows Forms application type.

Question: Why ComboBoxes are not changing their arrearance to XP-Styles look
althought other UI Components does when I use the following code in my Sub
Main ...

System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New frmMain)

.... is there a way to ensure it by forcing style change to ComboBoxes
somehow?

--
Thanks in advance!

Mika
Nov 20 '05 #1
4 3050
Hi,

To get a control to display in an xp style you have to set its
flatstyle to flatstyle.system. The combobox doesnt support flatstyles.
Maybe this will help.
http://www.thecodeproject.com/vb/net/flatcombo.asp

http://msdn.microsoft.com/library/de...tylestopic.asp

Ken
------------------
"Mika M" <m i k a .ma*****@kolumbus.fi> wrote in message
news:ua**************@TK2MSFTNGP09.phx.gbl...
Hello!

I'm using VB.NET 2003 and Windows Forms application type.

Question: Why ComboBoxes are not changing their arrearance to XP-Styles
look
althought other UI Components does when I use the following code in my Sub
Main ...

System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New frmMain)

... is there a way to ensure it by forcing style change to ComboBoxes
somehow?

--
Thanks in advance!

Mika

Nov 20 '05 #2
> Hi,

To get a control to display in an xp style you have to set its
flatstyle to flatstyle.system. The combobox doesnt support flatstyles.
Maybe this will help.
http://www.thecodeproject.com/vb/net/flatcombo.asp

http://msdn.microsoft.com/library/de...tylestopic.asp
Ken


Thanks Ken of your reply, but ...

I have made another smaller windows forms application too. It has the
following code (code below) on the same form (frmMain) as the only one
ComboBox, and this ComboBox XP style is working just fine without any extra
code or property. This is why I'm wondering why ComboBoxes XP style is not
working same way on the bigger application forms too. Any succestions?

<System.STAThread()> _
Public Shared Sub Main()
System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New frmMain)
End Sub

-- Mika
Nov 20 '05 #3
* "Mika M" <mika .m a h o n e n@kolumbus.fi> scripsit:
I have made another smaller windows forms application too. It has the
following code (code below) on the same form (frmMain) as the only one
ComboBox, and this ComboBox XP style is working just fine without any extra
code or property. This is why I'm wondering why ComboBoxes XP style is not
working same way on the bigger application forms too. Any succestions?


Are you using any other controls (maybe 3rd party controls) on the form?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
> Are you using any other controls (maybe 3rd party controls) on the form?

Yes, C1FlexGrid (.NET) in both applications - because I like to make simple
things by simple way too :)). This can't be reason for this problem because
ComboBoxes XP style is working just fine with smaller application. Anyway
when I created smaller application, even there ComboBoxes XP style was not
working immediately, but suddenly after few 'Run' modes it was ok :)

Bigger application contains also MainMenu, ImageList, ToolTip,
ErrorProvider, TabControl, CheckBox control. All these controls are VS.NET
controls - except C1FlexGrid (.NET).

There were also 'AddNew' -problem with CheckBox control, but of the link
http://support.microsoft.com/default...b;en-us;326440 I found how
to solve it. Is there collected list of bugs (possibly with solving aid too)
somewhere? I have also problems with DataBindings, but I'll try to go solve
them one by one :'(

-- Mika
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ben Coats | last post: by
3 posts views Thread by Brian | last post: by
3 posts views Thread by Dave Wurtz | last post: by
3 posts views Thread by sagar | last post: by
2 posts views Thread by Ola K | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.