Html

Here’s my code:

[lua]
function GoldMembership()
local clogpanel = vgui.Create(“DPanelList”)
clogpanel:SetSpacing(2)
clogpanel:EnableHorizontal(false)
clogpanel:EnableVerticalScrollbar(true)
function clogpanel:Update()
self:Clear(true)
local GoldM = vgui.Create(“HTML”)
–GoldM:SetSize( clogpanel:GetWide() - 20, clogpanel:GetTall() - 50 )
GoldM:OpenURL(“http://www.ultimate-rp.net”)
self:AddItem(GoldM)
end
clogpanel:Update()
return clogpanel
end
[/lua]

I can never get it to fill the dlist entirely, any ideas?

**[Panel.SizeToContents

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Panel.SizeToContents)**
Maybe this will fix it?:smile:

It doesn’t work D:

you have to set the size i couldnt find any other way :SetSize(x,y)

for x,y i think you can use the parent_frame:GetWide() parent_frame:GetTall()

edit:

oh wait you have that… you dont need a panel list, does it just draw at the top left? you have to set parent too

[lua]

function GoldMembership()
local clogpanel = vgui.Create(“DPanelList”)
clogpanel:SetSpacing(2)
clogpanel:EnableHorizontal(false)
clogpanel:EnableVerticalScrollbar(true)
function clogpanel:Update()
self:Clear(true)
local GoldM = vgui.Create(“HTML”, clogpanel)
–GoldM:SetSize( clogpanel:GetWide() - 20, clogpanel:GetTall() - 50 )
GoldM:OpenURL(“http://www.ultimate-rp.net”)
self:AddItem(GoldM)
end
clogpanel:Update()
return clogpanel
end
[/lua]

Wait what exactly does this do?

shows a html page

[lua]GoldM:SizeToContents()[/lua]

[lua]
local GoldM = vgui.Create(“HTML”, clogpanel)
–GoldM:SetSize( clogpanel:GetWide() - 20, clogpanel:GetTall() - 50 )
GoldM:OpenURL(“http://www.ultimate-rp.net”)
GoldM:SizeToContents()
self:AddItem(GoldM)
[/lua]