DTextEntry/OnGetFocus

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Dev20 (Talk | contribs)
(Creation of OnGetFocus page as a useful func to override)
Newer edit →

Revision as of 21:51, 21 September 2019

 DTextEntry:OnGetFocus( )

DescriptionPanelFunc

Called whenever the DTextEntry gains focus.

Examples

Example

local dTextEntry = vgui.Create("DTextEntry")
dTextEntry:SetText("Enter text here")

dTextEntry.OnGetFocus = function()
    self:SetText("") -- Clear the text box for user input
end

Output:

Text entry clears when user clicks it to begin typing
Personal tools
Navigation