Syncfusion.XlsIO.Base
Example 


VAlignment Property

Vertical alignment of the text.
Syntax
'Declaration
 
Property VAlignment As ExcelCommentVAlign
'Usage
 
Dim instance As ITextBox
Dim value As ExcelCommentVAlign
 
instance.VAlignment = value
 
value = instance.VAlignment
ExcelCommentVAlign VAlignment {get; set;}
Example
By default ExcelCommentVAlign.Top is set to VAlignment. Here for example, we set ExcelCommentVAlign.Center to HAlignment property.
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 textbox
            ITextBox textbox = worksheet.TextBoxes.AddTextBox(5, 5, 200, 100);
            
            //Set text
            textbox.Text = "Text";
            
            //Set alignment
            textbox.VAlignment = ExcelCommentVAlign.Center;
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also