Print Page | Close Window

Contextmenu with TabWorkspace?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5058
Printed Date: 20 June 2025 at 5:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Contextmenu with TabWorkspace?
Posted By: Martin
Subject: Contextmenu with TabWorkspace?
Date Posted: 15 September 2006 at 8:34am
Hello,
 
we are using version v10.1 of the ActiveX toolkit in a C# environment.
 
We have created a tabbed MDI interface and now we want to right click a tab so we can show a popmenu/contextmenu with for example a Close option, so we can close the current selected tab.
 
Can anyone tell me if and how we can accomplish this?
 
Thanks very much.
 
Cheers,
Martin



Replies:
Posted By: SuperMario
Date Posted: 15 September 2006 at 4:42pm
Catch the RClick event of the tabbed workspace, then you can display a popup.  Here is the VB6 code....

Private Sub Workspace_RClick(ByVal Item As XtremeCommandBars.ITabControlItem)
    If Not Item Is Nothing Then
        Debug.Print Item.Caption
        Item.Selected = True
        Workspace.Refresh
       
        Dim Popup As CommandBar
        Dim Control As CommandBarControl
       
        Set Popup = CommandBars.Add("Popup", xtpBarPopup)
       
        With Popup.Controls
            .Add xtpControlButton, ID_FILE_NEW_FILE, "&New", -1, False
            .Add xtpControlButton, ID_FILE_CLOSE, "Close", -1, False
            Set Control = .Add(xtpControlButton, 35002, "&Workspace Actions")
            Control.BeginGroup = True
        End With
   
        Popup.ShowPopup
        Workspace.Refresh
    End If
End Sub


Posted By: Martin
Date Posted: 18 September 2006 at 4:17am
Hey,
 
thanks for your quick reply!
 
I got it working in my C# project.
 
However, is there any way I can query the X and Y coords of the mouse cursor within C#?
 
Because now I use unmanaged code using the imported GetCursorPos API function, and I'd rather not use unmanaged code....
 
Edit: Or better yet, keep the popup "attached" to the tab, so that when I rightclick it on a non-active tab it doesn't show there, but on the active tab. Hope I make sense
 
TIA,
mace



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net