Environment.SetFocus Method

Sets the focus to the control.
Public Function SetFocus( _ 
Optional ByVal keyEventArgs As KeyEventArgs = null _ 
) As Boolean
This language is not supported or no code example is available.
public bool SetFocus( 
KeyEventArgs keyEventArgs = null 
)
This language is not supported or no code example is available.

Parameters

keyEventArgs
KeyEventArgs

Optional. The KeyEventArgs to simulate the OnKeyDown event after the control getting the focus.

Return Value

bool
Remarks
 
When using Renderer different from rendererType.Native, use this method to set the focus to the control.

.NET Framework

Supported in: 4.5, 4.6, 4.7

In this article

Definition