From 2e535f10159ee17cba415a7560d9a264d2060fea Mon Sep 17 00:00:00 2001 From: Tim Young Date: Tue, 1 Aug 2017 20:35:41 -0500 Subject: [PATCH] Change to correct tab when student is selected, and when "students" (overview) is selected --- EduNetworkBuilder/PersonProfileForm.Designer.cs | 13 +++++++++++++ EduNetworkBuilder/PersonProfileForm.cs | 9 +++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/EduNetworkBuilder/PersonProfileForm.Designer.cs b/EduNetworkBuilder/PersonProfileForm.Designer.cs index efaf0b1..dcdd545 100644 --- a/EduNetworkBuilder/PersonProfileForm.Designer.cs +++ b/EduNetworkBuilder/PersonProfileForm.Designer.cs @@ -55,6 +55,7 @@ this.TabStudent = new System.Windows.Forms.TabPage(); this.tvClasswork = new System.Windows.Forms.TreeView(); this.btnExit = new System.Windows.Forms.Button(); + this.TabStudents = new System.Windows.Forms.TabPage(); this.tcTabControl.SuspendLayout(); this.TabProfile.SuspendLayout(); this.TabClasswork.SuspendLayout(); @@ -152,6 +153,7 @@ this.tcTreeData.Controls.Add(this.tabClass); this.tcTreeData.Controls.Add(this.TabHomework); this.tcTreeData.Controls.Add(this.TabStudent); + this.tcTreeData.Controls.Add(this.TabStudents); this.tcTreeData.Location = new System.Drawing.Point(145, 9); this.tcTreeData.Name = "tcTreeData"; this.tcTreeData.SelectedIndex = 0; @@ -333,6 +335,16 @@ this.btnExit.UseVisualStyleBackColor = true; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // + // TabStudents + // + this.TabStudents.Location = new System.Drawing.Point(4, 25); + this.TabStudents.Name = "TabStudents"; + this.TabStudents.Padding = new System.Windows.Forms.Padding(3); + this.TabStudents.Size = new System.Drawing.Size(256, 206); + this.TabStudents.TabIndex = 3; + this.TabStudents.Text = "Student"; + this.TabStudents.UseVisualStyleBackColor = true; + // // PersonProfileForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -384,5 +396,6 @@ private System.Windows.Forms.Button btnImportStudents; private System.Windows.Forms.Button btnHWDelete; private System.Windows.Forms.Button btnLaunch; + private System.Windows.Forms.TabPage TabStudents; } } \ No newline at end of file diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index cea793d..d4b1e10 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -17,7 +17,7 @@ namespace EduNetworkBuilder public partial class PersonProfileForm : Form { enum TopTab { profiletab=0, classworktab=1} - enum TreeDataTab { classtab=0, homeworktab=1, studenttab=2 } + enum TreeDataTab { classtab=0, homeworktab=1, studenttab=2 , studentstab =3} PersonClass CurrentUser = null; string FileName = ""; PersonClass ViewedUser = null; @@ -315,13 +315,18 @@ namespace EduNetworkBuilder ChangeTreeDataTab(TreeDataTab.homeworktab); UpdateFormFromSchoolwork(SWC); } + if(Node.Tag is PersonClass) + { + //It is an individual student + ChangeTreeDataTab(TreeDataTab.studenttab); + } 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); + ChangeTreeDataTab(TreeDataTab.studentstab); } }