Hey guys,
Is this the correct way to make a section of a DFrame and Fill it with a Button.OnClick?
Menu = vgui.Create("DFrame")
Menu:SetSize(1000, 600)
Menu:Center()
Menu:SetVisible(true)
Menu:SetTitle("Menu Example")
Menu:MakePopup()
function Menu.Paint(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(255, 255, 255, 255))
end
local d = vgui.Create("DPanel", Menu)
d:SetSize(970, 610)
d:SetPos((ScrW()/2)+250-500, (ScrH()/2)+110-300)
d:MakePopup()
function d.Paint(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(200, 200, 200, 200))
end
// Section
local Content = vgui.Create("DExample1", d)
Content:Dock(FILL)
Content:SetVisible(false)
... CODE ...
// Make Section visible with a Button.OnClick
Content:SetVisible(true)
I'm having a problem with this code, if I make 'Content' (DExample1) visible the moment I create it, it works. But if I set it's visibility to 'false' and then use the button to change it's visibility to 'true' I can't click on it's CheckBoxes and etc...
Already tried to set it's zIndex to the highest with Panel:SetZPos(index) but it doesn't seem to work.
Could you not just put the content code in the button.DoClick function so that when you click the button it creates the code.
I could do that but it doesn't fix my problem.
Tried changing zIndex to 32767 (max = 2^15-1) and still can't click it.
Sorry, you need to Log In to post a reply to this thread.