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?
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
@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, 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