I am currently using EasyTabs for C#, and it's working fine but I need to be able to at least change the title of the tab from my application, and I can't seem to find anything that will let me do that so far. I'm talking about changing the tab name not the entire form name just the tab names at the top of the screen.
so I need to be able to take a variable from Form1 and change the tab name, again not all the tabs, but specific tabs that get opened, depending on the page, the variable will be different and each tab needs to be named respectively, just as it would if you were going to different sites in different tabs in chrome.
I have looked at all possible stack overflow questions that already exist and none have really helped, so any help on this would be greatly appreciated, and at this point, I would be happy with even only have tab names and not being able to change the favicon, but both would be amazing.
AppContainer.cs
using System;
using EasyTabs;
public partial class AppContainer : TitleBarTabs
{
public AppContainer()
{
InitializeComponent();
AeroPeekEnabled = true;
TabRenderer = new ChromeTabRenderer(this);
Icon = Properties.Resources.icon;
Text = "Example";
}
public override TitleBarTab CreateTab()
{
return new TitleBarTab(this)
{
Content = new Form1
{
Text = "New Tab"
}
};
}
private void AppContainer_Load(object sender, EventArgs e)
{
}
}
Form1.cs
using EasyTabs;
using System.Windows.Forms;
public partial class Form1 : Form
{
protected TitleBarTabs ParentTabs
{
get
{
return (ParentForm as TitleBarTabs);
}
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
Program.cs
using System.Windows.Forms;
using EasyTabs;
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
AppContainer container = new AppContainer();
container.Tabs.Add(
new TitleBarTab(container)
{
Content = new Form1
{
Text = "New Tab"
}
}
);
container.SelectedTabIndex = 0;
TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext();
applicationContext.Start(container);
Application.Run(applicationContext);
}
}