Come controllare la barra delle schede del foglio

Possibili Scenari di Utilizzo

Quando hai bisogno di regolare la visualizzazione della barra del foglio di Excel, devi sapere come controllare la barra delle schede del foglio, come nascondere o mostrare la barra delle schede, cambiare la larghezza della barra delle schede, specificare la prima scheda visibile e così via. Aspose.Cells supporta queste funzionalità. Aspose.Cells fornisce le seguenti proprietà e metodi per aiutarti a raggiungere i tuoi obiettivi.

Come controllare la barra delle schede del foglio usando Aspose.Cells for .NET

Questo esempio mostra come:

  1. Crea un libro di lavoro.
  2. Aggiungi dati alle celle nel primo foglio di lavoro.
  3. Visualizzare la scheda del foglio e impostare la larghezza della barra delle schede.
//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");

Anteprima del file di risultato: