title | ms.custom | ms.date | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adding Values to a Combo Box Control | Microsoft Docs |
11/04/2016 |
|
article |
|
|
|
22a78f98-fada-48b3-90d8-7fa0d8e4de51 |
9 |
mikeblome |
mblome |
ghogen |
You can add values to a combo box control as long as you have the Dialog editor open.
Tip
It's a good idea to add all values to the combo box before you size the box in the Dialog editor, or you may truncate text that should appear in the combo control.
-
Select the combo box control by clicking on it.
-
In the Properties Window, scroll down to the Data property.
[!NOTE] If you are displaying properties grouped by type, Data appears in the Misc properties.
-
Click in the value area for the Data property and type in your data values, separated by semicolons.
[!NOTE] Do not put spaces between values because spaces interfere with alphabetizing in the drop-down list.
-
Click Enter when you are finished adding values.
For information on enlarging the drop-down portion of a combo box, see Setting the Size of the Combo Box and Its Drop-Down List.
Note
You cannot add values to Win32 projects using this procedure (the Data property is grayed out for Win32 projects). Because Win32 projects do not have libraries that add this capability, you must add values to a combo box with a Win32 project programmatically.
-
After entering values in the Data property, click the Test button on the Dialog Editor Toolbar.
Try scrolling down the entire value list. Values appear exactly as they are typed in the Data property in the Properties window. There is no spelling or capitalization checking.
Press ESC to return to the Dialog box editor.
For information on adding resources to managed projects, please see Resources in Desktop Apps in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see Creating Resource Files for Desktop Apps. For information on globalization and localization of resources in managed apps, see Globalizing and Localizing .NET Framework Applications.
Win32