473,387 Members | 1,624 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,387 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 3183
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.