0
votes

How can I populate values in a wxComboBox dynamically, I know we can populate it while initializing it like this, but I want to do it e.g. when a user clicks a button

wxArrayString   m_arrItems;

// Create common wxArrayString array
m_arrItems.Add( wxT("Solid") );
m_arrItems.Add( wxT("Transparent") );
m_arrItems.Add( wxT("Dot") );

ComboBox1 = new wxComboBox(this, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_arrItems, 0, wxDefaultValidator, _T("ID_COMBOBOX1"));

Thanks

2

2 Answers

2
votes

See its members inherited from wxItemContainer: Set(), Append(), Insert().

-1
votes

See EVT_COMBOBOX_DROPDOWN/EVT_COMBOBOX_CLOSEUP.