How do I add a Pane menu? |
Post Reply |
Author | |
mstuart
Groupie Joined: 06 April 2010 Location: United States Status: Offline Points: 36 |
Post Options
Thanks(0)
Posted: 03 November 2010 at 4:30pm |
Hi all,
I can't work out how to add a popup menu to a Pane. I've searched the forum, looked at the samples, and also looked in the help, but can't find anything that shows how to do this in VB6. Can someone help me please? I've added the following event, but it's not working: Private Sub DockingPane_PanePopupMenu(ByVal Pane As XtremeDockingPane.IPane, ByVal x As Long, ByVal y As Long, Handled As Boolean) If Pane.Id = 1 Then Dim PaneMenu As CommandBarPopup Set PaneMenu = CommandBars.ActiveMenuBar.Controls.Add(xtpControlButtonPopup, 1, "Popup") With PaneMenu.CommandBar.Controls .Add xtpControlButton, 111, "New Filter" End With End If End Sub Regards, Mark Stuart
|
|
Regards,
Mark Stuart Product: Xtreme SuitePro (ActiveX) v13.2.1 Platform: WinXP (32bit)/Win7 (64bit) Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
Hi,
You have to enable the menu button on the pane (Pane.Options = PaneHasMenuButton) and then in the event you've mentioned, you have to use the ShowPopup function from the CommandBar to show the custom menu. Is this what you mean? It's documented in the Help File (albeit in C#.NET, but easy enough to translate to VB6). private void frmMain_Load(object sender, System.EventArgs e) { MyColor = new System.Drawing.Color[15]; MyColor[0] = System.Drawing.Color.AliceBlue; MyColor[1] = System.Drawing.Color.Beige; MyColor[2] = System.Drawing.Color.Chartreuse; MyColor[3] = System.Drawing.Color.DarkBlue; MyColor[4] = System.Drawing.Color.Cyan; MyColor[5] = System.Drawing.Color.Green; MyColor[6] = System.Drawing.Color.Magenta; MyColor[7] = System.Drawing.Color.Orange; MyColor[8] = System.Drawing.Color.Yellow; MyColor[9] = System.Drawing.Color.Salmon; MyColor[10] = System.Drawing.Color.Turquoise; MyColor[11] = System.Drawing.Color.Red; MyColor[12] = System.Drawing.Color.SteelBlue; MyColor[13] = System.Drawing.Color.Brown; MyColor[14] = System.Drawing.Color.Honeydew; Pane A, B; A = MDIDockingPaneManager.CreatePane(1, 200, 120, DockingDirection.DockTopOf, null); A.Title = "Pane 1"; A.Options = XtremeDockingPane.PaneOptions.PaneHasMenuButton; B = MDIDockingPaneManager.CreatePane(2, 200, 120, DockingDirection.DockLeftOf, A); B.Title = "Pane 2"; B.Options = XtremeDockingPane.PaneOptions.PaneHasMenuButton; } public System.Drawing.Color [] MyColor; private void MDIDockingPaneManager_PanePopupMenu(object sender, AxXtremeDockingPane._DDockingPaneEvents_PanePopupMenuEvent e) { if (e.pane.Id == 1 || e.pane.Id == 2) { CommandBar Popup; CommandBarControl Control; XtremeCommandBars.CommandBarControls Controls; Popup = CommandBars.Add("Popup", XtremeCommandBars.XTPBarPosition.xtpBarPopup); Controls = Popup.Controls; for (int x = 500; x < 515; x++) { Control = Controls.Add(XtremeCommandBars.XTPControlType.xtpControlButton, x, MyColor[x - 500].ToString(), -1, false); } Popup.ShowPopup(XtremeCommandBars.XTPTrackPopupFlags.TPM_RIGHTBUTTON, e.x, e.y); } } |
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
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 |