Type
FormField.Type property
Returnerar formulärfältstypen.
public FieldType Type { get; }
Exempel
Visar hur man infogar en kombinationsruta.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Please select a fruit: ");
// Infoga en kombinationsruta som låter en användare välja ett alternativ från en samling strängar.
FormField comboBox = builder.InsertComboBox("MyComboBox", new[] { "Apple", "Banana", "Cherry" }, 0);
Assert.AreEqual("MyComboBox", comboBox.Name);
Assert.AreEqual(FieldType.FieldFormDropDown, comboBox.Type);
Assert.AreEqual("Apple", comboBox.Result);
// Formulärfältet kommer att visas i form av en "select" html-tagg.
doc.Save(ArtifactsDir + "FormFields.Create.html");
Se även
- enum FieldType
- class FormField
- namnutrymme Aspose.Words.Fields
- hopsättning Aspose.Words