Occurs when the shape receives focus.
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), or by calling the Select or SelectNextControl method, focus events occur in the following order:
When you change the focus by using the mouse or by calling the Focus method, focus events occur in the following order:
For more information about how to handle events, see Consuming Events.
Do not try to set focus in the LostFocus event handler. Doing so can cause your application or the operating system to stop responding.
The following example shows how to respond to the GotFocus event in an event handler. This example requires that you have a RectangleShape control named RectangleShape1 on a form.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.