M
M
Maxim K2021-10-06 21:14:15
C++ / C#
Maxim K, 2021-10-06 21:14:15

How to change color of EasyTabs tab?

I use the code to create new tabs:

public void CreateNewTab(string url)
        {
            var newtab = new TitleBarTab(ParentTabs) { Content = new BrowserMain(url, true) { Text = "New Tab" } };
            if (ParentTabs.InvokeRequired)
            {
                ParentTabs.Invoke(new Action(() =>
                 {
                     ParentTabs.Tabs.Insert(ParentTabs.SelectedTabIndex + 1, newtab);
                     ParentTabs.SelectedTabIndex++;
                     ParentTabs.RedrawTabs();
                     ParentTabs.Refresh();
                     ParentTabs.ForeColor = Color.Red;   // нарисовать красным
                 }));
            }
            else
            {
                ParentTabs.Tabs.Insert(ParentTabs.SelectedTabIndex + 1, newtab);
                ParentTabs.SelectedTabIndex++;
                ParentTabs.RedrawTabs();
                ParentTabs.Refresh();
            }
        }

I tried to make it stupid: ParentTabs.ForeColor = Color.Red;but the tabs themselves do not change color. Maybe there is a ready example?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question