C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Next: Right-click on the TabControl and select Properties. This will present you with the Properties dialog.
Properties: You can use this dialog to adjust many important visual settings and also the TabPages themselves.
Tip: Please remember that users might get frustrated with complicated user interfaces.
Tip: You should leave these alone unless your application's goal is to cause headaches.
Typically: It is smartest to use the default user interface colors for most applications.
SelectTab: Another thing you can do, as we see here, is programmatically change the selected tab.
Tip: This code can restore a tab to the one that was open when the application last closed. It can focus a tab on start up.
C# program that uses SelectTab and SelectedIndex
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// After initialize, select the second tab.
tabControl1.SelectTab("tabPage2");
// This is another way to select the second tab.
// ... You don't need both ways!
tabControl1.SelectedIndex = 1;
}
}
}
However: When you get too many tabs, the metaphor breaks down and it might be better to start using buttons for the appearance.