Question

Goal

Resize the palette set on plugin start up so that it looks like so:

Palette Set Goal

Everything is correctly adjusted here and looks nice. This setup is saved when I close AutoCAD manually. Although, my goal would be to make the program make it start up like this.


Current Start-Up Result

Here's the result I get on start up:

Current Palette Set Result

As you can see, it's not wide enough. The width needs to get larger but the height is correctly set.


Current Attempt

Here is what I have when starting up my application:

<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
    ps.Dock = Autodesk.AutoCAD.Windows.DockSides.Left ' Docks the palette set to the left
    ps.Size = New System.Drawing.Size(350, 800) 'Sets the width and height
    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

This result seems to not actually dock the palette set. There is unwanted space at the bottom.

Current Palette Set After Code


How do we resize a palette set correctly?

Was it helpful?

Solution

I solved this issue by switching around my Dock and Size lines.

It becomes possible to resize it like so (while keeping it docked left)

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

This solved my issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top