Combo Box control in SOLIDWORKS property Manager Page
Combo box control will be automatically generated for all the properties of enumerator types. All values of enumerators will be considered as the items in the combo box:
using CodeStack.SwEx.Common.Attributes; using CodeStack.SwEx.PMPage.Attributes; using CodeStack.SwEx.Properties; using SolidWorks.Interop.swconst; public class ComboBoxDataModel { public enum Options_e { Option1, Option2, Option3 } [ComboBoxOptions(swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_Sorted)] public Options_e Options { get; set; } }
Additional options and style for combo box control can be specified via ComboBoxOptionsAttribute
Item Text
ComboBoxItemTextAttribute attribute can be used to specify user friendly title for the items to be shown in the combo box
using CodeStack.SwEx.Common.Attributes; using CodeStack.SwEx.PMPage.Attributes; using CodeStack.SwEx.Properties; using SolidWorks.Interop.swconst; public class ComboBoxDataModel { public enum OptionsCustomized_e { [Title("First Option")] //static title Option1, [Title(typeof(Resources), nameof(Resources.Option2Title))] //title loaded from resources Option2 } public OptionsCustomized_e Options2 { get; set; } }