private void tabControlEntities_SelectedIndexChanged(object sender, EventArgs e)
{
TabControl tc = (TabControl)sender;
if (tc != null)
{
currentList = tc.SelectedIndex;
switch (currentList)
{
case 0:
if (this.treeViewItems.SelectedNode == null)
{
currentCats = "Items";
}
else
{
currentCats = this.treeViewItems.SelectedNode.FullPath;
}
break;
case 1:
if (this.treeViewCreatures.SelectedNode == null)
{
currentCats = "Creatures";
}
else
{
currentCats = this.treeViewCreatures.SelectedNode.FullPath;
}
break;
case 2:
if (this.treeViewCommands.SelectedNode == null)
{
currentCats = "Commands";
}
else
{
currentCats = this.treeViewCommands.SelectedNode.FullPath;
}
break;
}
textBoxSearch.SelectAll();
textBoxSearch.Select();
}
}