Syncfusion.XlsIO.Base
Example 


AddOptionButton() Method

Adds a IOptionButtonShape width default dimension
Syntax
'Declaration
 
Overloads Function AddOptionButton() As IOptionButtonShape
'Usage
 
Dim instance As IOptionButtons
Dim value As IOptionButtonShape
 
value = instance.AddOptionButton()
IOptionButtonShape AddOptionButton()

Return Value

OptionButton Shape
Example
The following code illustrates how to add a IOptionButtonShape to the IOptionButtons collection.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Add option button
            IOptionButtonShape optionButton = worksheet.OptionButtons.AddOptionButton();
            
            //Set dimensions
            optionButton.Top = 1;
            optionButton.Left = 1;
            optionButton.Width = 100;
            optionButton.Height = 20;
            
            //Set text
            optionButton.Text = "Option";
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.38

See Also