Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a right click
Message
Information générale
Forum:
ASP.NET
Catégorie:
Menus
Divers
Thread ID:
00779983
Message ID:
00780888
Vues:
14
This message has been marked as the solution to the initial question of the thread.
Joe,

Okay, now the lightbulb went on and I understand now. You are looking for a context-menu at design time. Unfortunately, I haven't done this but I can refer you to an expert in the industry that should be able to help. His name is Les Smith and he has a book called "Writing Add-ins for Visual Studio .NET". His web site is http://HHISoftware.com.

>No not really. When making an addin you cant use a visual contextmenu object because you dont have a form. It has to be done in code. What I want would add a context menu item to the popup that has; cut, copy, paste, run to cursor, and add 'task list shortcut' while you are in the VS.IDE. So then when you are coding you select some text and right click you get a popup with; cut, copy, paste, 'JoesAddin' when you click JoesAddin the code is modified in the editor (or whatever other task) as per the addin code. This is strictly for developers not for the usual end users. Sorry for not being clear. The code should look something this; Note: This code adds the addin to the standard menu but does not add the addin to the popup menu as it appears it should.
>    Public Sub OnConnection(ByVal application As Object, _
>                            ByVal connectMode As Extensibility.ext_ConnectMode, _
>                            ByVal addInInst As Object, _
>                            ByRef custom As System.Array) _
>                                    Implements Extensibility.IDTExtensibility2.OnConnection
>
>        applicationObject = CType(application, EnvDTE.DTE)
>        addInInstance = CType(addInInst, EnvDTE.AddIn)
>        If connectMode = Extensibility.ext_ConnectMode.ext_cm_UISetup Then
>            Dim objAddIn As AddIn = CType(addInInst, AddIn)
>            Dim CommandObj As Command
>
>            Try
>                CommandObj = applicationObject.Commands.AddNamedCommand(objAddIn, "LetsTestAddins", "LetsTestAddins", _
>                                                "Executes the command for LetsTestAddins", True, 59, Nothing, 1 + 2) _
>                                                    '1+2 == vsCommandStatusSupported+vsCommandStatusEnabled
>                CommandObj.AddControl(applicationObject.CommandBars.Item("Tools"))
>
>                m_objDTE = CType(application, EnvDTE.DTE)
>                m_objCommandBarButton = _
>                        m_objDTE.CommandBars.Item("GROOVYADDIN").Controls.Add(MsoControlType.msoControlButton)
>                ' Set properties
>                m_objCommandBarButton.Caption = "YourCaption"
>                m_objCommandBarButton.TooltipText = "My ToolTip"
>            Catch e As System.Exception
>            End Try
>        End If
>    End Sub
>
>    Private Sub m_objCommandBarButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, _
>                                            ByRef CancelDefault As Boolean) Handles m_objCommandBarButton.Click
>        MsgBox("Your code here...")
>    End Sub
>
>
>
>
>
>>Hi Joe,
>>
>>In steps 2 and 3 below, I discuss how to add menu bars to a context menu. Isn't this what you are asking for?
>>
>>>In an addin the 'form' is the endusers work, maybe a source module. What I want to do is a context menu. However, it's in a VS.NET addin. I know how to add menu items to the regular menus... But not to the context menu.
>>>
>[snip]
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform