private void Initializer(int alignX, int alignY, Prescription p) { lblDisease.Text = p.disease.name + ": "; lblDisease.Location = new Point(alignX, alignY); lblDisease.AutoSize = true; CtlList.Add(lblDisease); int preWidth = lblDisease.Location.X + lblDisease.Width + 5; foreach (Pill drug in p.getPills()) { Label lblDrug = new Label(); lblDrug.Text = drug.name; lblDrug.Location = new Point(preWidth, alignY); lblDrug.AutoSize = true; CtlList.Add(lblDrug); Label lblAmount = new Label(); lblAmount.Text = drug.amount.ToString() + ", "; lblAmount.Location = new Point(lblDrug.Location.X + lblDrug.Width + 5, alignY); lblAmount.AutoSize = true; CtlList.Add(lblAmount); preWidth = lblAmount.Location.X + lblAmount.Width + 5; } lblNotice.Text = p.disease.notice; lblNotice.Location = new Point(alignX, lblDisease.Location.Y + lblDisease.Height + 5); lblNotice.AutoSize = true; CtlList.Add(lblNotice); lblDoctor.Text = "by " + p.doctor.name; lblDoctor.Location = new Point(alignX, lblNotice.Location.Y + lblNotice.Height + 5); lblDoctor.AutoSize = true; CtlList.Add(lblDoctor); minAlignX = alignX; minAlignY = alignY; maxAlignX = getMaxAlignX(); maxAlignY = getMaxAlignY(); }