From 7f8879a19bab7f31b9d3d869309a4163ecaa2245 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sun, 30 Jul 2017 18:22:55 -0500 Subject: [PATCH] When students or class selected in tree, jump to the apropriate tab --- EduNetworkBuilder/PersonProfileForm.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 31e1c13..b4a3ab9 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -153,7 +153,7 @@ namespace EduNetworkBuilder { //We have a class tree Node = new TreeNode(NB.Translate("PPF_Class")); - Node.Tag = "Class"; + Node.Tag = "Class"; //Do not translate this TreeNode Top = Node; tvClasswork.Nodes.Add(Node); foreach(SchoolworkClass SWC in CurrentUser.Projects) @@ -164,7 +164,7 @@ namespace EduNetworkBuilder } //we have a students tree Node = new TreeNode(NB.Translate("PPF_Students")); - Node.Tag = "Students"; + Node.Tag = "Students"; //Do not translate this tvClasswork.Nodes.Add(Node); } } @@ -238,6 +238,14 @@ namespace EduNetworkBuilder ChangeTreeDataTab(TreeDataTab.homeworktab); UpdateFormFromSchoolwork(SWC); } + if(Node.Tag is string) + { + string Selected = (string)Node.Tag; + if (Selected == "Class") //Do not translate this + ChangeTreeDataTab(TreeDataTab.classtab); + if (Selected == "Students") //Do not translate this + ChangeTreeDataTab(TreeDataTab.studenttab); + } } void SaveSchoolworkDataFromForm(object sender, EventArgs e)