Displaying PopUp menu from one commandbar |
Post Reply |
Author | ||
ianp
Moderator Group Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
Post Options
Thanks(0)
Posted: 24 January 2005 at 9:23am |
|
I have an SDI form which contains a commandbar control and a docking pane. The docking pane loads a form which contains a second commandbar control. Each commandbar control contains a control of type xtpControlPopup. On the SDI form, the PopUp has several controls added to its commandbar.controls collection On the DockingPane form, the PopUp has no controls added to its commandbar.controls collection. However, it needs to display the same controls as the SDI PopUp. Is is possible to re-use the SDI PopUp on the Docking Pane? Or do I have to add the controls to both forms??? |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
I'm thinking you can use the Copy method to copy from one to
another. But I have not tried this myself, so I can't say for
sure.
I'm thinking something like this: Private Sub rtfText_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If (Button = 2) Then If CommandBars.DesignerControls Is Nothing Then Exit Sub Dim Control As CommandBarControl, ContextControl As CommandBarControl Dim Popup As CommandBar Set Control = frmForm1.CommandBars.DesignerControls.Find(, ID_CONTEXT_MENU) If Control Is Nothing Then Exit Sub &nbs p; Set Popup = frmForm2.CommandBars.Add("Popup", xtpBarPopup) For Each ContextControl In Control.CommandBar.Controls &nbs p; ContextControl.Copy Popup Next &nbs p; Popup.ShowPopup End If End Sub |
||
ianp
Moderator Group Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
Post Options
Thanks(0)
|
|
Thanks SuperMario, that's exactly what I'm after...
Oddly, if you copy the controlpopup from form1, to form2, all the commandbar.controls are all disabled???
|
||
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 |