private void MainForm_Load(object sender, EventArgs e) { _calendarEntries = new CalendarEntries(); if (!_calendarEntries.Load(_calendarEntriesFile)) { MessageBox.Show("No appointment file exists or an error occured while trying to load the appointments file", "Creating New File", MessageBoxButtons.OK, MessageBoxIcon.Warning); } // Initialise everything for 9am on today's date _todaysEntries = new List <ICalendarEntry>(); labelDisplayedDate.Text = DateTime.Now.ToLongDateString(); GetEntriesOnSelectedDate(DateTime.Now); vScrollBar.Height = panelDailyView.ClientRectangle.Size.Height; vScrollBar.Maximum = 47 - (panelDailyView.ClientRectangle.Size.Height / PanelRowHeight); // 18 is the bar corresponding to 9am. vScrollBar.Value = 18; _selectedRow = 18; }