Derma Close Function

How would i close my derma menu with a Dbutton? Like for example, i have my function on my buttons DoClick but ive tryed remove(), exit() and close() yet nothin works.

Lua is case sensitive, so it would look like:


button:Remove()

Wouldn’t you just set the DFrame to invisible?

[lua]DFrame1:SetVisible(false)[/lua]

But just do it in the buttons DoClick function?

[lua]DButton1.DoClick = function()
DFrame1:SetVisible(false)
end[/lua]

This is better if you plan to open and close it alot

Okay, OP do you plan on ths derma menu opening and closing a alot? or is it just a one time menu?

[editline]07:12PM[/editline]

I think this is the most appropriate for a one time derma: **[DFrame.SetDeleteOnClose

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=DFrame.SetDeleteOnClose)**

This menu is for a npc shop and there are buttons to determine what the player says next. I want the final button just to end the shop panel.

Then you do want [lua]DFrame:SetVisible(false)[/lua]

Yep, im using the SetVisible(false)

Thanks for all the input guys!