![]() |
Saving CXTPControlComboBox items |
Post Reply ![]() |
Author | |
esc67 ![]() Newbie ![]() Joined: 09 June 2005 Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() Posted: 04 April 2007 at 6:29pm |
How can I persist a dynamic list of items for a CXTPControlComboBox that is inside a command bar? I create a CXTPControlComboBox in CMainFrame::OnCreateControl in order to have a “command entry” box in a toolbox: CXTPControlComboBox* pCommandComboBox = (CXTPControlComboBox*)CXTPControlComboBox::CreateObject(); pCommandComboBox->SetDropDownListStyle(TRUE); pCommandComboBox->SetCaption(_T("Command >")); pCommandComboBox->SetStyle(xtpComboLabel); pCommandComboBox->SetFlags(xtpFlagControlStretched); lpCreateControl->pControl = pCommandComboBox; Each time the user types text in the textbox I add the string to the combobox list by calling InsertString. This gives the user a list of recently used commands. The problem is that the list of strings in the combobox are not persisted when the application quits. Apparently calling DoPropExchange on GetCommandBars() doesn’t work, so I tried saving and loading the items in my own file. However, the items get erased sometime after OnCreateControl is called. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |