Vertical Alignment for Text Box

Hi,
Where is the vertical alignment set in a textbox object on aspose.cells?

Also, in the following code, everything is working except the font.color, why is that?
Thanks,

Dim intTextBoxIndex As Integer = objWorkSheet.TextBoxes.Add(intR, intC, intH, intW)
Dim objTextBox As Aspose.Cells.TextBox = objWorkSheet.TextBoxes(intTextBoxIndex)
With objTextBox
.TextFrame.AutoSize = False
.Placement = Aspose.Cells.PlacementType.FreeFloating
.Font.IsBold = blnIsBold
.Text = strText
.FillFormat.ForeColor = clrBackGround
'.LineFormat.IsVisible = False
.LineFormat.Weight = 0
.Font.Color = Drawing.Color.AliceBlue

End With

Hi,

Thanks for considering Aspose.

We will support to set alignment settings for a textbox soon.

Also, in the following code, everything is working except the font.color, why is that?

Well, AliceBlue is not present on the standard excel color palette, so you need to add it on the palette first before setting the textbox's font color. You may use Workbook.ChangePalette() method for the task.
I think you need to add a line, e.g.,

Dim objWorkbook as Workbook = New Workbook();

//Update the 56th color (there are 56 colors (0-55 indexed) on the palette.

objWorkbook.ChangePalette(System.Drawing.Color.AliceBlue,55);

.................

Thank you.


Hi,

Please try this fix.The following codes show how to create a vertical alignment text box.

Workbook wb = new Workbook();
TextBoxes boxes = wb.Worksheets[0].TextBoxes;
int index = boxes.Add(0, 0, 200, 200);
boxes[0].Text = "test";
boxes[0].TextHorizontalAlignment = TextAlignmentType.Right;
boxes[0].TextVerticalAlignment = TextAlignmentType.Top;
boxes[0].TextOrientationType = TextOrientationType.TopToBottom;
wb.Save(@"F:\FileTemp\dest.xls");