Yorumun Metin Yönünü Değiştir
Contents
[
Hide
]
Microsoft Excel, kullanıcılara ek bilgi eklemek ve verileri vurgulamak için hücrelere yorum eklemelerine izin verir. Geliştiriciler, hücreye özel hizalama ayarlarını ve metin yönünü belirtmek için yorumu özelleştirmek isteyebilir. Aspose.Cells, görevi başarmak için API’lar sağlar.
Aspose.Cells, yoruma metin yönü belirlemek için Shape.TextDirection özelliği sağlar. Aşağıdaki örnek kod, yorum için metin yönünü belirlemek için Shape.TextDirection özelliğinin kullanımını göstermektedir.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create directory if it is not already present. | |
bool IsExists = System.IO.Directory.Exists(dataDir); | |
if (!IsExists) | |
System.IO.Directory.CreateDirectory(dataDir); | |
// Instantiate a new Workbook | |
var wb = new Workbook(); | |
// Get the first worksheet | |
var sheet = wb.Worksheets[0]; | |
// Add a comment to A1 cell | |
var comment = sheet.Comments[sheet.Comments.Add("A1")]; | |
// Set its vertical alignment setting | |
comment.CommentShape.TextVerticalAlignment = TextAlignmentType.Center; | |
// Set its horizontal alignment setting | |
comment.CommentShape.TextHorizontalAlignment = TextAlignmentType.Right; | |
// Set the Text Direction - Right-to-Left | |
comment.CommentShape.TextDirection = TextDirectionType.RightToLeft; | |
// Set the Comment note | |
comment.Note = "This is my Comment Text. This is test"; | |
dataDir = dataDir + "OutCommentShape.out.xlsx"; | |
// Save the Excel file | |
wb.Save(dataDir); |