Problem with CommandBarPopup.DeleteAll() |
Post Reply |
Author | |
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
Posted: 21 February 2008 at 1:25pm |
Hello,
I have a CommandBarPopup on my main menu. I want to remove all items that belong to the popup (i.e. all siblings), and add new ones. Here's what my code does: CommandBarPopup popup = ...; popup.Controls.DeleteAll(); popup.Controls.Add( ... ); The problem is that after the call to DeleteAll, popup.Controls becomes null! Am I missing something? Best, Michal Blazejczyk |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
You better use the InitCommandsPopup event.
Private Sub CommandBars_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)
CommandBar.Controls.DeleteAll ''this will delete all siblings
CommandBar.Controls.Add(xtpControlButton, ID_BUTTON1,"caption") ''this will add a new button to the popup
End Sub
|
|
blazej
Groupie Joined: 09 February 2005 Location: Canada Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Good idea. I will try this.
But still, it would be interesting to know why my code does not work as is... Best, Michal |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
CommandBarPopup popup = ...;
popup.CommandBar.Controls.DeleteAll(); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |