![]() |
Contextmenu with TabWorkspace? |
Post Reply ![]() |
Author | |
Martin ![]() Newbie ![]() ![]() Joined: 26 April 2005 Location: Netherlands Status: Offline Points: 30 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Martin ![]() Newbie ![]() ![]() Joined: 26 April 2005 Location: Netherlands Status: Offline Points: 30 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
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 |