public FormStudent(string reg_num, FormLogin login) { InitializeComponent(); this.login = login; //Courses List: A list that displays professor's courses CoursesList.Bounds = new Rectangle(new Point(450, 50), new Size(275, 400)); CoursesList.View = View.Details; CoursesList.FullRowSelect = true; CoursesList.GridLines = true; CoursesList.Sorting = SortOrder.Ascending; CoursesList.Columns.Add("Courses", -2, HorizontalAlignment.Center); CoursesList.Columns.Add("ID", -2, HorizontalAlignment.Center); currentUser = Database.GetUser("student", reg_num); user = (Student)currentUser; Dictionary <string, string> Courses = Database.getAllCourses(); foreach (KeyValuePair <string, string> course in Courses) { var row = new String[] { course.Value , course.Key }; var listViewItem = new ListViewItem(row); CoursesList.Items.Add(listViewItem); } SelectedCourseLabel.Location = new Point(475, 20); SelectCourseBtn.Location = new Point(551, 458); //============================================================================== //======================================================================== ProjectsList.Bounds = new Rectangle(new Point(150, 12), new Size(275, 500)); ProjectsList.View = View.Details; ProjectsList.FullRowSelect = true; ProjectsList.GridLines = true; ProjectsList.Sorting = SortOrder.Ascending; ProjectsList.Columns.Add("Project ID", -2, HorizontalAlignment.Left); ProjectsList.Columns.Add("Project", -2, HorizontalAlignment.Left); ProjectsList.Columns.Add("Sent", -2, HorizontalAlignment.Left); ProjectsList.Columns.Add("Grade", -2, HorizontalAlignment.Left); //============================================================== ProjectsList.Hide(); UploadGroupBox.Hide(); CoursesList.Show(); SelectCourseBtn.Show(); SelectCourseMnBtn.BackColor = Color.FromArgb(66, 131, 178); UploadGroupBox.Location = new Point(450, 12); UploadBtn.Enabled = false; ProjectsMnBtn.Enabled = false; BrowseBtn.Enabled = false; UploadGroupBox.Paint += Paint; }
private void SelectCourseMnBtn_Click(object sender, EventArgs e) { YouAreHere(SelectCourseMnBtn); CoursesList.Show(); SelectCourseBtn.Show(); SelectedCourseLabel.Show(); ProjectsList.Hide(); UploadGroupBox.Hide(); BrowseBtn.Enabled = false; }