Maybe I am doing this wrong?

So I am making a collapsible category so that it can be collapsed if the user does not want to see it, but when I do ‘AmmoCollapsible:Toggle()’ it messes up the button as well as the category itself like the size gets freaky. When I remove the toggle it does not mess up like it does when the toggle is in the code.

Here is my code:



local AmmoCollapsible = vgui.Create( "DCollapsibleCategory", frame )
AmmoCollapsible:SetPos( 25, 50 )
AmmoCollapsible:SetSize( ammow, ammoh )
AmmoCollapsible:SetExpanded( 0 )
AmmoCollapsible:SetLabel( "Ammo" )
AmmoCollapsible:Toggle()
		
local DermaList = vgui.Create( "DPanelList", frame )
DermaList:SetSpacing( 5 )
DermaList:EnableHorizontal( false )
DermaList:EnableVerticalScrollbar( true )
AmmoCollapsible:SetContents( DermaList )
		
local AmmoContentOne = vgui.Create( "DButton", frame )
AmmoContentOne:SetText( "AK-47" )
AmmoContentOne:SetTextColor( Color( 255, 255, 255 ))
AmmoContentOne:SetPos( 100, 100 )
AmmoContentOne:SetSize( 100, 30 )
AmmoContentOne.Paint = function( self, w, h )
	draw.RoundedBox( 0, 0, 0, w, h, Color( 176, 176, 176 ) )
end
AmmoContentOne.DoClick = function()
	frame:Remove()
end
DermaList:AddItem( AmmoContentOne )


This is what it looks like with the toggle:

Try moving the toggle after you’ve added everything

Apparently the size was not big enough for the button to show, which I just fixed. My current problem is how would I add a rectangle behind the button? I don’t want to override the current category I just want to add a rectangle that is below the button.