I was wondering how I would go about making a panel on a Dframe be toggled by a separate button on the same Dframe. Ex, Pressing a button once and it brings up a panel on the Dframe, then pressing it again to make it dissapear.
Here is my code for the Panel, If needed I guess.
local CDMP1 = vgui.Create( "DPanel", FCDM )
CDMP1:SetSize( 300, 0 )
CDMP1:SetBackgroundColor(FCOLOURGREY)
CDMP1:Dock( LEFT )
And I don’t know if the button code is needed, so here it is:
local CDMBD1 = vgui.Create( "DButton", CDMP1 )
CDMBD1:SetPos( 20, 100)
CDMBD1:SetSize( 250, 30 )
CDMBD1:SetTextColor(Color(255,255,255,255))
CDMBD1:SetFont("ARRAFONT2")
CDMBD1:SetText( "ARRA" )
CDMBD1.Paint = function()
draw.RoundedBox(1, 0, 0, CDMBD1:GetWide(), CDMBD1:GetTall(), Color(64,64,64,255))
end
function CDMBD1:DoClick()
end
Thanks in advance.