Panel.SetVisible

From GMod Wiki

(Redirected from DFrame.SetVisible)
Jump to: navigation, search
Function
Syntax Panel:SetVisible( Boolean visible )
Description:
Shows or Hides the panel.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.SetVisible]Panel.SetVisible [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionShows the form, then when the button is clicked, the form is hidden.
Used onNewerClient.png
Code
function visibleExample()
 
     local myParent = vgui.Create("Frame");
     myParent:SetPos(100,100);
     myParent:SetSize(100,100);
     myParent:SetVisible(true);
 
     local myButton = vgui.Create("Button", myParent);
     myButton:SetPos(30,30);
     myButton:SetWide(100);
     myButton:SetText("Hide Form!");
 
     function myButton:DoClick()
 
           myParent:SetVisible(false);
 
      end
 
end
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox