Expandir Minimizar
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

Control.CanFocus Propriedade

Obtém um valor indicando se o Controlarar pode receber o foco.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (em System.Windows.Forms. dll)
[BrowsableAttribute(false)]
public bool CanFocus { get; }

Valor da propriedade

Tipo: System.Boolean
true if the control can receive focus; otherwise, false.

In order for a control to receive input focus, the control must have a handle assigned to it, and the Visible and Enabled properties must both be set to true for both the control and all its parent controls, and the control must be a form or the control's outermost parent must be a form.

The following code example sets focus to the specified Control, if it can receive focus.

public void ControlSetFocus(Control control)
{
   // Set focus to the control, if it can receive focus.
   if(control.CanFocus)
   {
      control.Focus();
   }
}


public void ControlSetFocus(Control control)
{
    // Set focus to the control, if it can receive focus.
    if (control.get_CanFocus()) {
        control.Focus();
    }
} //ControlSetFocus


Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.