简体   繁体   中英

c# winform combobox different display

I am using Visual Studio 2010 and .NET 3.5 and I am seeing a combobox display differently in different project. I drop in the combobox the same way from the toolbox and change the dropdownstyle to DropDownList . But depending on the project, the combobox may look like it is indented (similar look as in DropDown ), with the field highlighted in blue. But in the other project, the combobox has a more 3D feel. I would love to provide a screenshot but I don't have enough reputation to post images. :-( I am guessing it's probably due to some project settings maybe? Because I create the combobox the exact same way in both projects - I added a new Form and drop a combobox on the form and change the dropdownstyle to DropDownList ; however, they look differently in the dialog when the project is run. Any help would be appreciated.

Solve my own problem. Somehow Application.EnableVisualStyles(); was removed in program.cs. Once I added Application.EnableVisualStyles(); before calling the main form, the comobobox looks the way I wanted

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM