diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 93c7bbf..c3d973c 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -85,6 +85,7 @@ namespace EduNetworkBuilder CurrentUser.UserSettings.AutoStartPuzzles = false; CurrentUser.UserSettings.ChosenLanguage = oldsettings.ChosenLanguage; CurrentUser.UserSettings.LanguageHasBeenChosen = true; + } else if (CurrentUser == null) { @@ -108,6 +109,8 @@ namespace EduNetworkBuilder tbHWSubmitted.LostFocus += SaveSchoolworkDataFromForm; dtpHWDue.LostFocus += SaveSchoolworkDataFromForm; + tcTabControl.SelectedIndexChanged += UpdateFormFromSchoolwork; + //Make sure we update any profile settings they change tbFullName.LostFocus += SaveUserInfoFromForm; } @@ -289,6 +292,10 @@ namespace EduNetworkBuilder ViewedSchoolwork.Name = tbHWName.Text; ViewedSchoolwork.DueDate = dtpHWDue.Value; } + private void UpdateFormFromSchoolwork(object sender, EventArgs e) + { + UpdateFormFromSchoolwork(); + } private void UpdateFormFromSchoolwork(SchoolworkClass What) { @@ -322,8 +329,8 @@ namespace EduNetworkBuilder } else { - tbHWSubmitted.Visible = false; - lblHWDue.Visible = false; + tbHWSubmitted.Visible = false; + lblHWSubmitted.Visible = false; } if (ViewedSchoolwork.DueDate < dtpHWDue.MinDate) ViewedSchoolwork.DueDate = dtpHWDue.MinDate; dtpHWDue.Value = ViewedSchoolwork.DueDate;