Garry's Mod Wiki

Revision Difference

DTextEntry:OnGetFocus#550651

<function name="OnGetFocus" parent="DTextEntry" type="panelfunc"> <ispanel>yes</ispanel> <description>Called whenever the DTextEntry gains focus.</description> <realm>Client</realm>⤶ <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>