Raises the GotFocus event.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
When the user selects text in a TextBox control, the control saves the selection. When a TextBox control gets focus, the selection is the same as when the TextBox loses focus. When the TextBox gets focus for the first time, the entire text is selected.
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.Notes to Inheritors
When overriding in a derived class, be sure to call the base class’s method so that registered delegates receive the event.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)