Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Popup Menu in .NET

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
hippe013
647 Views, 2 Replies

Popup Menu in .NET

popup menu.png

 

In the past, when I've wanted a popup menu, I would use Dos Library's dos_popupmenu, while using LISP. Does anyone know how to create one in .NET?

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: hippe013

@hippe013, you should find this thread I started in the .NET forum a while back useful:

 

https://forums.autodesk.com/t5/net/gripdata-onhover-how-to-add-a-context-menu/m-p/5667410#M44865

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
hippe013
in reply to: Jeff_M

@Jeff_M, Thank you Jeff. This has certainly pointed me in the right direction.

 

I've posted the following code for how I've implemented the ContextMenuStrip. I am using this to get the user input rather than using keywords.

 

 

Public Class MyCommands
        Public mnu As System.Windows.Forms.ContextMenuStrip
        Public aDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
        Public ed As Editor = aDoc.Editor
        Public db As Database = aDoc.Database

       <CommandMethod("TestPopupMenu")> _
        Public Sub TestPopupMenu()
            
            If mnu Is Nothing Then
                mnu = New System.Windows.Forms.ContextMenuStrip
                mnu.Items.Add("PlotStyle")
                mnu.Items.Add("LineType")
                mnu.Items.Add("Color")
                mnu.Items.Add("Freeze")
                AddHandler mnu.ItemClicked, AddressOf mnu_ItemClicked
            End If
            mnu.Show(Windows.Forms.Cursor.Position)
        End Sub

        Private Sub mnu_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)
            ed.WriteMessage(vbCrLf + e.ClickedItem.ToString)
        End Sub

    End Class

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report