Garry's Mod Wiki

DTextEntry:SetPaintBackground

  DTextEntry:SetPaintBackground( boolean show )

Description

Sets whether to show the default background of the DTextEntry.

Arguments

1 boolean show
false hides the background; this is true by default.

Example

Overrides the background of a DTextEntry and changes its color on every text change.

local frame = vgui.Create( "DFrame" ) frame:SetTitle("Colored TextEntry!") frame:SetSize( 300, 100 ) frame:Center() frame:MakePopup() tEntryBG = vgui.Create("DPanel", frame) tEntryBG:Dock(TOP) tEntryBG:SetBackgroundColor(color_white) tEntry = vgui.Create("DTextEntry", tEntryBG) tEntry:SetPaintBackground(false) tEntry:Dock(FILL) tEntry.OnChange = function() tEntryBG:SetBackgroundColor(ColorRand()) end
Output:
bgoverride.gif