public void setMonday(int Morn1, int Morn2, int Morn3, int Morn4, int Aft1, int Aft2, int Aft3, int Aft4, int Eve1, int Eve2, int Eve3, int Eve4, DateTime date) { //display the names of these people //start with mornings lblMonMorn1 = new Label(); lblMonMorn1.Enabled = true; lblMonMorn1.Text = CreateRota.StaffList[Morn1].first +" " + CreateRota.StaffList[Morn1].last; lblMonMorn2 = new Label(); lblMonMorn2.Text = CreateRota.StaffList[Morn2].first +" " + CreateRota.StaffList[Morn2].last; lblMonMorn3 = new Label(); lblMonMorn3.Text = CreateRota.StaffList[Morn3].first +" " + CreateRota.StaffList[Morn3].last; lblMonMorn4 = new Label(); lblMonMorn4.Text = CreateRota.StaffList[Morn4].first +" " + CreateRota.StaffList[Morn4].last; //next the afternoon shift lblMonAft1 = new Label(); lblMonAft1.Text = CreateRota.StaffList[Aft1].first +" " + CreateRota.StaffList[Aft1].last; lblMonAft2 = new Label(); lblMonAft2.Text = CreateRota.StaffList[Aft2].first +" " + CreateRota.StaffList[Aft2].last; lblMonAft3 = new Label(); lblMonAft3.Text = CreateRota.StaffList[Aft3].first +" " + CreateRota.StaffList[Aft3].last; lblMonAft4 = new Label(); lblMonAft4.Text = CreateRota.StaffList[Aft4].first +" " + CreateRota.StaffList[Aft4].last; //finally the evening shift lblMonEve1 = new Label(); lblMonEve1.Text = CreateRota.StaffList[Eve1].first +" " + CreateRota.StaffList[Eve1].last; lblMonEve2 = new Label(); lblMonEve2.Text = CreateRota.StaffList[Eve2].first +" " + CreateRota.StaffList[Eve2].last; lblMonEve3 = new Label(); lblMonEve3.Text = CreateRota.StaffList[Eve3].first +" " + CreateRota.StaffList[Eve3].last; lblMonEve4 = new Label(); lblMonEve4.Text = CreateRota.StaffList[Eve4].first +" " + CreateRota.StaffList[Eve4].last; //put the day & date into the top of the column lblMon = new Label(); lblMon.Text = "Monday " + date; }
lblMon actually on the form anywhere
how did you create the shift display ? are they labels or columns on a datagird ?
can you attach the entire project
lblMonMorn2 = new Label(); lblMonMorn2.Text = CreateRota.StaffList[Morn2].first +" " + CreateRota.StaffList[Morn2].last;
//note MonMorn is already declared as a string MonMorn2 = CreateRota.StaffList[Morn2].first +" " + CreateRota.StaffList[Morn2].last;