How to make multiple Derma panels?

So I haver one derma panel but I would like multiple on the same screen. I’m not sure on how to do that exactly. I tried messing around but I didn’t figure anything out. Anyone know? Here is my first panel code:


net.Receive( 'OpenIt', function()
		local base = vgui.Create( 'DFrame' )
			base:SetSize( 470, 235 )
			base:SetPos( 50, 50 )
			base:ShowCloseButton( true )
			base:MakePopup()
			base:SetDraggable( false )
			base:SetTitle( 'Admin Help' )
			function base:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 0,0, 0 ) )
				surface.SetDrawColor( 33, 255, 0 )
				surface.DrawOutlinedRect( 1, 1, w-2, h-2 )
			end
		local button = vgui.Create( 'DButton' )
			button:SetParent( base )
			button:SetSize( 150, 100 )
			button:SetPos( 5, 26 )
			button:SetText( 'RDM' )
			button.DoClick = function()
			function button:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! I have been RDMed!" )
		end 
		local button2 = vgui.Create( 'DButton' )
			button2:SetParent( base )
			button2:SetSize( 150, 100 )
			button2:SetPos( 160, 26 )
			button2:SetText( 'RDA' )
			button2.DoClick = function()
			function button2:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! I have been RDAed!" )
		end	
		local button3 = vgui.Create( 'DButton' )
			button3:SetParent( base )
			button3:SetSize( 150, 100 )
			button3:SetPos( 315, 26 )
			button3:SetText( 'NLR' )
			button3.DoClick = function()
			function button3:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! This person is breaking New Life Rule!" )
		end	
		local button4 = vgui.Create( 'DButton' )
			button4:SetParent( base )
			button4:SetSize( 150, 100 )
			button4:SetPos( 5, 130 )
			button4:SetText( 'Propkill' )
			button4.DoClick = function()
			function button4:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! This person is Prop-Killing!" )
		end
		local button5 = vgui.Create( 'DButton' )
			button5:SetParent( base )
			button5:SetSize( 150, 100 )
			button5:SetPos( 160, 130 )
			button5:SetText( 'Propblock' )
			button5.DoClick = function()
			function button5:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! This person is Prop-Blocking!" )
		end
		local button6 = vgui.Create( 'DButton' )
			button6:SetParent( base )
			button6:SetSize( 150, 100 )
			button6:SetPos( 315, 130 )
			button6:SetText( 'Minge' )
			button6.DoClick = function()
			function button6:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 33, 255, 0 ) )
			end
			RunConsoleCommand( "say", "`Help! This person is Mingeing!" )
		end
end )

  • Thanks!

why are you creating derma buttons? without panels?

  1. You don’t have to do


button:SetParent( base )


You can just do



local button = vgui.Create( 'DButton', base )


  1. Just create a new VGUI element named base2 to create a second panel. I.E.


	local base2 = vgui.Create( "DFrame" )


  1. Why is your Paint function inside your DoClick function?

just stop posting and go back to the australian outback please
i cant tell if you just want to gain ratings or you want to gain posts
probably both

can you elaborate what you want to do, multiple DFrame s? Or multiple DPanel s?

just asking… idiot he shouldn’t have that much buttons without derma panels.

What do you mean “Derma panels”? Literally, “derma panels” is just another way of saying DFrame.

He COULD simplify his code a little bit if he wanted by using Derma_Query, but then he’d be limited to 4 options.

yep sorry now i get the questition lolcats.