Customising CXTPToolBar with combo |
Post Reply |
Author | |
brianh
Groupie Joined: 30 April 2004 Location: United Kingdom Status: Offline Points: 83 |
Post Options
Thanks(0)
Posted: 20 July 2004 at 11:25am |
I have a CXTPToolBar that contains a combo box. In OnCreateControl() I create and add the CXTPControlComboBox object for the toolbar. This all works fine but if you customise the toolbar by clicking on the 'toolbar options' button on the end of the toolbar and deselect the combo control, and then later add it back in again, you get an exception when you use it. The OnCreateControl() function does not appear to get called a second time when you restore the combo but the control does not seem to be the original one - but the list box still contains all the items added to the original!! Can anyone tell me how I should be handling this situation? Thanks. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Take a look at the DynamicPopups sample and possible even the
CommonControls sample. I believe the DynamicPopups sample does
what you are describing.
|
|
brianh
Groupie Joined: 30 April 2004 Location: United Kingdom Status: Offline Points: 83 |
Post Options
Thanks(0)
|
Yes these samples do add controls to the toolbar but in my case I store a pointer to the control which becomes invalid after hiding/showing the control on the toolbar. If I just use FindControl() to get the control this works okay after hiding/showing it but the data that was added to the original control with SetItemData() is missing, and it no longer has a current selection (never mind the one it had when it was hidden) which makes no sense for my application. What I need is a notification when the control is destroyed so I can clean up if necessary (I don't store pointers with SetItemData() but I might in the future) and a notification when it is redisplayed so I can initialize it properly. Are there any such notifications? Thanks. |
|
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 |