473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 3178
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oliver Hoehle | last post by:
Hello! This ist the source-code for an editable combobox implemented with HTML,CSS and Javascript. I have tested it with IE and Mozilla. But I don't know, if it will work in other browsers...
3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
4
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
3
by: Brian | last post by:
Can anyone give me the code I need to be able to use the matchentry functionality from VB6? I have a combo box with over 5000 numeric serial numbers and want to be able to enter the beginning...
3
by: Dave Wurtz | last post by:
Can anyone tell me how to get the current color of a combobox's button? I have a custom control that I want to look similar to a combobox. It contains a button control that I want to look like the...
3
by: sagar | last post by:
Hello everyone, I am developing a AJAX based IM application. I use javascript to dynamically generated small windows using nested <div> within the web-page. I use the following ways to set...
2
by: Ola K | last post by:
Hi guys, I wrote a script that works *almost* perfectly, and this lack of perfection simply puzzles me. I simply cannot point the whys, so any help on it will be appreciated. I paste it all here,...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
10
by: Academia | last post by:
I'm making my own ComboBox and would like the DropDown button to look like the system combo box. Do you know the Font for the "v" that is used in the regular combobox. Is that the letter vee...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.