احصل على عرض نص بقيمة Cell
Contents
[
Hide
]
احصل على عرض نص بقيمة Cell
في بعض الأحيان ، قد يحتاج المطورون إلى حساب عرض قيمة الخلية لترتيب البيانات في بعض التخطيط. يوفر Aspose.Cells ملفCellsHelper.GetTextWidth طريقة تسمح للمطورين بالحصول على عرض نص قيمة الخلية. يوضح نموذج التعليمات البرمجية التالي كيفية الاستخدامCellsHelper.GetTextWidthللوصول إلى عرض نص قيمة الخلية.
تم إرفاق ملف المصدر المستخدم في مقتطف الشفرة التالي للرجوع إليه.
عينة من الرموز
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 | |
Workbook workbook = new Workbook(sourceDir + "GetTextWidthSample.xlsx"); | |
Console.WriteLine("Text width: " + CellsHelper.GetTextWidth(workbook.Worksheets[0].Cells["A1"].StringValue, workbook.DefaultStyle.Font, 1)); |