我找到了一个使用以下代码的解决方法:
- Imports Autodesk.AutoCAD.Runtime
- Imports Autodesk.AutoCAD.Windows
- Public Class Class1
- Public p As PaletteSet
- Public uc As UserControl1
- <CommandMethod("run")> _
- Sub run()
- If p = Nothing Then
- p = New PaletteSet("test")
- uc = New UserControl1
- p.Add("palette1", uc)
- p = Nothing
- p = New PaletteSet("test")
- uc = New UserControl1
- p.Add("palette1", uc)
- p.Visible = True
- p.Dock = DockSides.None
- End If
- p.Visible = True
- End Sub
- End Class
但我不知道问题出在哪里。任何人
非常感谢。 |