Garry's Mod Wiki

DButton

Description

A standard Derma button.

By default, a DButton is 22px tall.

Parent

Derives from DLabel.

Example

The DButton is exactly what you think it is - a button!

local frame = vgui.Create( "DFrame" ) frame:SetSize( 300, 250 ) frame:Center() frame:MakePopup() local DermaButton = vgui.Create( "DButton", frame ) // Create the button and parent it to the frame DermaButton:SetText( "Say hi" ) // Set the text on the button DermaButton:SetPos( 25, 50 ) // Set the position on the frame DermaButton:SetSize( 250, 30 ) // Set the size DermaButton.DoClick = function() // A custom function run when clicked ( note the . instead of : ) RunConsoleCommand( "say", "Hi" ) // Run the console command "say hi" when you click it ( command, args ) end
Output:

Page Links


Special Pages


Wikis

?

Render Time: 53ms

DB GetPage 3
Generate Html 26
SaveChanges (1) 10
Render Body 0
Render Sidebar 11