Garry's Mod Wiki

Revision Difference

DTextEntry:OnGetFocus#551548

<function name="OnGetFocus" parent="DTextEntry" type="panelfunc">⤶ <function name="OnGetFocus" parent="DTextEntry" type="panelhook">⤶ <ispanel>yes</ispanel> <description>Called whenever the DTextEntry gains focus.</description> <description>Called whenever the <page>DTextEntry</page> gains focus.</description> <realm>Client and Menu</realm> </function> <example> <code> local dTextEntry = vgui.Create("DTextEntry") dTextEntry:SetText("Enter text here") -- Make the text field clear when you click into it. dTextEntry.OnGetFocus = function(self) self:SetValue("") end </code> <output>Text entry clears when user clicks it to begin typing</output> </example>