How would i go about increasing the width of the DButton on .hover

I’m wanting to increase the width of my button when i hover over it how would i go about doing so?
this is what i got right now…



                surface.SetFont("Font12")
		local SizeX = surface.GetTextSize(string.upper(v.servername))
		local ServerTab = vgui.Create( "DButton", Frame )
		ServerTab:SetPos( xc, 10 )
		ServerTab:SetSize( SizeX + 4, ScrH()/19.2 )
		//ServerTab:SetSize(ServerText:GetWide(), ScrH()/19.2)
		ServerTab:SetText( "" )
		ServerTab:SetTextColor(Color(255,255,255))
		ServerTab.Hover = false
		ServerTab.OnCursorEntered 	= function() ServerTab.Hover = true end
		ServerTab.OnCursorExited	= function() ServerTab.Hover = false end
		//LocalPlayer():ConCommand("connect " .. v.ip) end
		
		ServerTab.Paint = function()
			draw.RoundedBox( 0, 0, 0, ServerTab:GetWide(), ServerTab:GetTall(), Color( 60, 60, 60, 255 ) )
			//draw.DrawText(v.servername, "Font12", 5, ServerTab:GetTall()/4, Color(255, 255, 255, 255))
			
			if ServerTab.Hover then
				draw.RoundedBox( 0, 0, 0, ServerTab:GetWide(), ServerTab:GetTall(), Red )
				draw.RoundedBox( 0, 0, 0, ServerTab:GetWide(), ServerTab:GetTall(), blur )
				//draw.DrawText(v.servername, "Font12", 5, ServerTab:GetTall()/2, Color(255, 255, 255, 255))
			end
		end
		xc = xc + SizeX + 8


ServerTab:SetSize( x, y ) under the paint function where you check if the button is hovered.

im confused?

[editline]24th January 2016[/editline]

OHHHH i got it thanks!

[editline]24th January 2016[/editline]

how would i go about changing the pos of the button infront of the button that is on .hover

Set a variable up that holds the position, then if it’s hovered have it change that value.



local x = 10

if self.IsHovered then
    x = 20
end


Then use the variable to declare positioning upon drawing the button box.