// The path to the documents directory. System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName()); System::SharedPtr project = System::MakeObject(dataDir + u"Project5.mpp"); // Create a new project task auto ganttChartView = System::DynamicCast_noexcept(project->get_Views()->ToList()->idx_get(0)); if (ganttChartView != nullptr) { ganttChartView->get_TableTextStyles()->Clear(); ganttChartView->get_TableTextStyles()->Add([&]{ auto tmp_0 = System::MakeObject(1); tmp_0->set_Color(System::Drawing::Color::get_Red()); tmp_0->set_Field(Aspose::Tasks::Field::TaskName); return tmp_0; }()); ganttChartView->get_TableTextStyles()->Add([&]{ auto tmp_1 = System::MakeObject(1); tmp_1->set_Color(System::Drawing::Color::get_Gray()); tmp_1->set_Field(Aspose::Tasks::Field::TaskDurationText); return tmp_1; }()); ganttChartView->get_TableTextStyles()->Add([&]{ auto tmp_2 = System::MakeObject(2); tmp_2->set_Color(System::Drawing::Color::get_Blue()); tmp_2->set_FontStyle(System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic | System::Drawing::FontStyle::Underline); return tmp_2; }()); }