C++ ile Çalışma Sayfası Sekmesi Rengini Ayarla
Contents
[
Hide
]
Aspose.Cells, bireysel çalışma sayfası sekmelerinin rengini değiştirmenize olanak tanır, böylece onları geri kalanından ayırt edebilirsiniz. Örneğin, Giderleri kırmızı, Satışları yeşil, Varlıkları mavi vb. yapabilirsiniz.
Microsoft Excel ile Çalışma Sayfası Sekmesi Rengini Ayarlama
- Mevcut çalışma sayfasının altındaki sekme sayfasında bir sekmeye sağ tıklayın.
- Sekme rengi‘ni seçin.
- Paletten bir renk seçin.
- Tamam‘a tıklayın.
Aspose.Cells ile Çalışma Taşraflarında Sekme Rengi Ayarı
Aşağıdaki örnek kod, Aspose.Cells ile sekme rengini ayarlamanın nasıl yapıldığını göstermektedir.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Path of input Excel file
U16String inputFilePath = srcDir + u"Book1.xlsx";
// Path of output Excel file
U16String outputFilePath = outDir + u"worksheettabcolor.out.xls";
// Create workbook
Workbook workbook(inputFilePath);
// Get the first worksheet in the book
Worksheet worksheet = workbook.GetWorksheets().Get(0);
// Set the tab color to red
worksheet.SetTabColor(Color::Red());
// Save the Excel file
workbook.Save(outputFilePath);
std::cout << "Worksheet tab color set successfully!" << std::endl;
Aspose::Cells::Cleanup();
}