Drawing Close Button in derma?

Well since SetType is a nil value what’s another way to setup my own close button so I can color it red and such?



local button = vgui.Create("DButton", Your_Parent)
button:SetText("Close")
button:SetSize(250, 10)
button:SetPos(100, 24)
button:SetColor(color_white) // Changes text color to white.

button.DoClick = function()
DermaPanel:Remove() // Replace DermaPanel: with your DermaPanel name. (local --->menu<--- = vgui.Create("DFrame") 
end

function button:Paint(w,h)
draw.RoudedBox(6, 0, 0, w, h, Color(204, 0, 0)) // Button Color.
end


  • I’m an idiot -

You have to rename DermaPanel to the name of your VGUI.

Aka:



local pan = vgui.Create("DFrame")
pan:SetTitle("test")
pan:Center()
pan:ShowCloseButton(false)
pan:MakePopup()


You’d change DermaPanel:Remove() to pan:Remove()

Thanks so much man!