What's the difference between Control.Select() and Control.Focus()?

后端 未结 6 2166
广开言路
广开言路 2020-12-04 01:35

In WinForms, to set focus to a specific control, I always seem to wind up calling Control.Select() and Control.Focus() to get it t

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 02:09

    Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the Select method or the ActiveControl property for child controls, or the Activate method for forms.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.focus.aspx

提交回复
热议问题