Selected
Contenido
[
Ocultar
]OptionButtonControl.Selected property
Obtiene o establece un valor booleano que indica estoOptionButtonControl
está seleccionado o no.
public bool Selected { get; set; }
Observaciones
Nota: esta propiedad le permite seleccionar varios elementos en un grupo deOptionButtonControl
con el mismoGroupName
Depende de usted encargarse de deseleccionar un elemento seleccionado previamente cuando realiza estaOptionButtonControl
seleccionado.
Ejemplos
Muestra cómo seleccionar el botón de opción.
Document doc = new Document(MyDir + "Radio buttons.docx");
Shape shape1 = (Shape)doc.GetChild(NodeType.Shape, 0, true);
OptionButtonControl optionButton1 = (OptionButtonControl)shape1.OleFormat.OleControl;
// Deseleccionar el primer elemento seleccionado.
optionButton1.Selected = false;
Shape shape2 = (Shape)doc.GetChild(NodeType.Shape, 1, true);
OptionButtonControl optionButton2 = (OptionButtonControl)shape2.OleFormat.OleControl;
// Seleccione el segundo botón de opción.
optionButton2.Selected = true;
Assert.AreEqual(Forms2OleControlType.OptionButton, optionButton1.Type);
Assert.AreEqual(Forms2OleControlType.OptionButton, optionButton2.Type);
doc.Save(ArtifactsDir + "Shape.SelectRadioControl.docx");
Ver también
- class OptionButtonControl
- espacio de nombres Aspose.Words.Drawing.Ole
- asamblea Aspose.Words