تغيير الخط واللون لخلية
Contents
[
Hide
]
في هذا الموضوع، سنناقش كيفية تغيير الخط ولون الخط لخلية في GridDesktop. توفر هذه الميزة تحكمًا أعمق في أوراق العمل للمطورين. باستخدام هذه الميزة، يمكن للمطورين تخصيص الخط واللون لأي خلية مطلوبة.
تغيير الخط واللون لخلية
لتغيير الخط واللون لخلية باستخدام Aspose.Cells.GridDesktop، يُرجى اتباع الخطوات التالية:
- الوصول إلى أي ورقة عمل مرغوبة
- الوصول إلى خلية تحتاج إلى تغيير الخط واللون
- إنشاء خط مخصص
- تعيين الخط للخلية إلى الخط المخصص
- وأخيرًا، تعيين لون الخط للخلية إلى أي لون مطلوب
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 | |
// Accessing the worksheet of the Grid that is currently active | |
Worksheet sheet = gridDesktop1.GetActiveWorksheet(); | |
// Accessing a cell using its name | |
GridCell cell = sheet.Cells["A1"]; | |
// Creating a customized Font object | |
Font font = new Font("Arial", 10, FontStyle.Bold); | |
// Setting the font of the cell to the customized Font object | |
cell.SetFont(font); | |
// Setting the font color of the cell to Blue | |
cell.SetFontColor(Color.Blue); |
إذا كنت تحتاج فقط إلى الحصول على معلومات حول الخط أو لون الخط للخلية، فيمكنك أيضًا استخدام طرق GetFont و GetFontColor للخلية.