.NET

Reply
Member
Alex_AMF
Posts: 3
Registered: ‎04-29-2014
Message 1 of 2 (143 Views)
Accepted Solution

How To Resize Palettes

143 Views, 1 Replies
04-29-2014 11:27 AM

Hello,

 

I have an AutoCAD .Net plugin for the company I am working at.

 

Unfortunately, whenever I start my application, the palette set starts off too small (width). Take a look:

 

p_set.png

 

The height is fine but the width isn't wide enough. How do I go about adjusting the width of my plugin when it starts up? 

 

Here's the code I use to start up my palette set.

<CommandMethod("Hunter-P")> _
Public Sub HunterP()
    'Tool Palette
     If ps Is Nothing Then
         ps = New Autodesk.AutoCAD.Windows.PaletteSet("Hunter Palette Set", "", New Guid("{ECBFEC73-9FE4-4aa2-8E4B-3068E94A2BFA}"))
         ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu Or Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton Or _
                            Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton
        projPalette = New tpProjectToolPalette(Me)
        convPalette = New tpConveyorToolPalette(Me)
        ps.Add("Projects", projPalette)
        ps.Add("Conveyors", convPalette)
     End If

     ps.Visible = True
     convPalette.Visible = False

     'Activate Project ToolPalette
     ps.Activate(0)
     If m_DocData Is Nothing Then
           m_DocData = New MyDocData
     End If

     AddHandler AcApp.DocumentManager.DocumentActivated, AddressOf Me.DocumentManager_DocumentActivated
     AddHandler AcApp.DocumentManager.DocumentToBeDeactivated, AddressOf Me.DocumentManager_DocumentToBeDeactivated
End Sub

 Any ideas?

 

Thanks!

Alex

I was able to solve it by adding these two lines of code after my ps.Visible = True

 

ps.Size = New System.Drawing.Size(335, 600) 'Resizing
ps.Dock = Autodesk.AutoCAD.Windows.DockSides.Left

Member
Alex_AMF
Posts: 3
Registered: ‎04-29-2014
Message 2 of 2 (130 Views)

Re: How To Resize Palettes

04-29-2014 12:06 PM in reply to: Alex_AMF

I was able to solve it by adding these two lines of code after my ps.Visible = True

 

ps.Size = New System.Drawing.Size(335, 600) 'Resizing
ps.Dock = Autodesk.AutoCAD.Windows.DockSides.Left

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.