471,896 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 3103
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
reply views Thread by zermasroor | last post: by

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.