Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IOptionButtons Interface > AddOptionButton Method : AddOptionButton(Int32,Int32,Int32,Int32) Method
One-based row index of the top-left corner of the new item.
One-based column index of the top-left corner of the new item.
Height in pixels of the new item.
Width in pixels of the new item.

AddOptionButton(Int32,Int32,Int32,Int32) Method

Adds new IOptionButtonShape to the IOptionButtons collection.
Syntax
'Declaration
 
Overloads Function AddOptionButton( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal height As Integer, _
   ByVal width As Integer _
) As IOptionButtonShape
'Usage
 
Dim instance As IOptionButtons
Dim row As Integer
Dim column As Integer
Dim height As Integer
Dim width As Integer
Dim value As IOptionButtonShape
 
value = instance.AddOptionButton(row, column, height, width)

Parameters

row
One-based row index of the top-left corner of the new item.
column
One-based column index of the top-left corner of the new item.
height
Height in pixels of the new item.
width
Width in pixels of the new item.

Return Value

Newly added item.
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(1, 1, 20, 100);
            
            //Set text
            optionButton.Text = "Option";
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also