DTextEntry.SetHighlightColor

From GMod Wiki

Jump to: navigation, search
Function
Syntax DTextEntry:SetHighlightColor( Color Highlight Color )
Where is this used?
Description:
Sets the highlight color of a DTextEntry.
Returns: nil
Part of Library: DTextEntry
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DTextEntry.SetHighlightColor]DTextEntry.SetHighlightColor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the highlight color of a DTextEntry object to green.
Used onNewerClient.png
Code
local ParentPanel = vgui.Create("DFrame")
	ParentPanel:SetSize(ScrW()/7, ScrH()/12)
	ParentPanel:Center()
	ParentPanel:SetTitle("Highlight Color Test")
	ParentPanel:SetDeleteOnClose(true)
	ParentPanel:MakePopup()
 
local TextEntry = vgui.Create( "DTextEntry", ParentPanel )
	TextEntry:SetSize(ScrW()/9, ScrH()/30)
	TextEntry:SetValue("Highlight Color Test")
	TextEntry:SetPos(ParentPanel:GetWide()/2-TextEntry:GetWide()/2,
	ParentPanel:GetTall()/2-TextEntry:GetTall()/5)
	TextEntry:SetEnterAllowed(false)
 
	-- Uses Simple RGBA (Red, Green, Blue, Alpha) Colors. --
	TextEntry:SetHighlightColor(Color(50,255,10,200))
 
	TextEntry:SelectAllOnFocus(true)
	TextEntry:RequestFocus()
OutputDTextEntry Highlight.png
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox