private void CreateNewTab(string tabPageName, string fullPath, string text) { // Створюємо нову вкладку і текстбокс. TabPage tabPage = new TabPage { BackColor = Color.Black, BorderStyle = BorderStyle.None, Text = tabPageName, AccessibleDescription = fullPath }; FastColoredTextBox fctText = new FastColoredTextBox { Dock = DockStyle.Fill, BorderStyle = BorderStyle.None, Text = text, Font = new Font("Consolas", 10) }; ColorTheme.ColorChangerTextBox(fctText, currentTheme); tabPage.Controls.Add(fctText); // Додаємо в нову вкладку текст-бокс. tabOption.TabPages.Add(tabPage); // В головний параметр вкладок додаємо новий з усім функціоналом. // Створюємо нову вкладку і текст-бокс. tabOption.SelectedTab = tabPage; fctText.Select(); // Додамо контекстне меню в нову вкладку. tabPage.ContextMenuStrip = contextOptions; fctText.TextChanged += FcbTextBox_TextChanged; fctText.TextChangedDelayed += FcbTextBox_TextChanged; Text = tabPageName + " " + partialFormName; }