Button.Select Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Sélectionne le Button.
public void Select ();
Exemples
L’exemple de code suivant ajoute deux Button contrôles à un document, puis sélectionne par programmation le premier bouton à l’aide de la Select méthode.
Cet exemple est destiné à une personnalisation au niveau du document.
private void SelectControl()
{
Microsoft.Office.Tools.Word.Controls.Button button1 =
this.Controls.AddButton(25, 25, 80, 30, "button1");
button1.Text = "Button 1";
Microsoft.Office.Tools.Word.Controls.Button button2 =
this.Controls.AddButton(25, 100, 80, 30, "button2");
button2.Text = "Button 2";
// Programmatically select the first button.
button1.Select();
}
Private Sub SelectControl()
Dim Button1 As Microsoft.Office.Tools.Word.Controls.Button = _
Me.Controls.AddButton(25, 25, 80, 30, "Button1")
Button1.Text = "Button 1"
Dim Button2 As Microsoft.Office.Tools.Word.Controls.Button = _
Me.Controls.AddButton(25, 100, 80, 30, "Button2")
Button2.Text = "Button 2"
' Programmatically select the first button.
Button1.Select()
End Sub