Garry's Mod Wiki

DTextEntry

Description

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.

Parent

Derives from TextEntry.

Example

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:SetText( "Placeholder Text" ) TextEntry.OnEnter = function( self ) chat.AddText( self:GetValue() ) -- print the form's text as server text end
Output:

Methods

Page Links


Special Pages


Wikis

?

Render Time: 52ms

Session 0
DB GetPage 3
Generate Html 28
SaveChanges 12
Render Body 0
Render Sidebar 6