Garry's Mod Wiki



A form which may be used to display text the player is meant to select and copy or alternately allow them to enter some text of their own . Do note that at least one of your DTextEntry's parents must either be an EditablePanel or derived from it (like a DFrame, for example), else it won't be able to focus and thus be unselectable. You must also call Panel:MakePopup on said panel or the DTextEntry will not work.

This does not clear out previously-pasted text properly.

Issue Tracker: 1588


Derives from TextEntry.


Creates a text entry form that allows you to print messages into the local player's chat window.

local frame = vgui.Create( "DFrame" ) frame:SetSize( 400, 200 ) frame:Center() frame:MakePopup() local TextEntry = vgui.Create( "DTextEntry", frame ) -- create the form as a child of frame TextEntry:SetPos( 25, 50 ) TextEntry:SetSize( 75, 85 ) TextEntry:SetValue( "Placeholder Text" ) TextEntry.OnEnter = function( self ) chat.AddText( self:GetValue() ) -- print the form's text as server text end


Page Links

Special Pages



Render Time: 57ms

DB GetPage 2
Generate Html 26
SaveChanges (1) 14
Render Body 0
Render Sidebar 12