كيفية التحكم في شريط علامة الورقة

سيناريوهات الاستخدام المحتملة

عندما تحتاج إلى ضبط عرض شريط الصفحة في Excel، تحتاج إلى معرفة كيفية التحكم في شريط تبويب الورقة، مثل إخفاء أو إظهار شريط تبويب الورقة، تغيير عرض شريط تبويب الورقة، تحديد علامة تبويب مرئية أولى، وما إلى ذلك. تدعم Aspose.Cells هذه الميزات. توفر Aspose.Cells الخصائص والأساليب التالية لمساعدتك في تحقيق أهدافك.

كيفية التحكم في شريط تبويب الورقة باستخدام Aspose.Cells for .NET

يوضح هذا المثال كيف:

  1. إنشاء دفتر عمل.
  2. إضافة بيانات إلى الخلايا في ورقة العمل الأولى.
  3. عرض علامة الورقة وتعيين عرض شريط التبويب.
//Instantiating an Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the newly added worksheet
Worksheet ws = workbook.Worksheets[0];
Aspose.Cells.Cells cells = ws.Cells;
//Setting the value to the cells
Aspose.Cells.Cell cell = cells["A1"];
cell.PutValue("Fruit");
cell = cells["B1"];
cell.PutValue("Count");
cell = cells["C1"];
cell.PutValue("Price");
cell = cells["A2"];
cell.PutValue("Apple");
cell = cells["A3"];
cell.PutValue("Mango");
cell = cells["A4"];
cell.PutValue("Blackberry");
cell = cells["A5"];
cell.PutValue("Cherry");
//Display the sheet tab and set the width of the tab bar
workbook.Settings.ShowTabs = true;
workbook.Settings.SheetTabBarWidth = 150;
workbook.Save("out.xlsx");

معاينة ملف النتائج: