Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Contextmenu with TabWorkspace?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Contextmenu with TabWorkspace?

 Post Reply Post Reply
Author
Message
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post Topic: Contextmenu with TabWorkspace?
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.