//This is so that arrow keys are detected
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case Keys.Down:
                if (ChosenUnit < totalNoUnits - 1)
                {
                    ChosenUnit++;
                }
                break;

            case Keys.Up:
                if (ChosenUnit > 0)
                {
                    ChosenUnit--;
                }
                break;

            case Keys.PageDown:
                ChosenUnit = Math.Min(ChosenUnit + 16, totalNoUnits - 1);
                break;

            case Keys.PageUp:
                ChosenUnit = Math.Max(ChosenUnit - 16, 0);
                break;
            }

            //Update relations between chosen value & bar value
            if (ChosenUnit > BarValue + 15)
            {
                BarValue = ChosenUnit - 15;
            }
            else if (ChosenUnit < BarValue)
            {
                BarValue = ChosenUnit;
            }
            VerticalBar.Value = BarValue; //also update the bar value of control

            ChoicePanel.Refresh();        //refresh the panel

            return(base.ProcessCmdKey(ref msg, keyData));
        }
 //Once slider value changes --> redraw list
 private void VerticalBarValueChanged(object sender, EventArgs e)
 {
     BarValue = VerticalBar.Value;
     ChoicePanel.Refresh();
 }
 private void VeteranButton_Click(object sender, EventArgs e)
 {
     IsVeteran = !IsVeteran;
     ChoicePanel.Refresh();
 }
 private void ChoicePanel_MouseDown(object sender, MouseEventArgs e)
 {
     ChosenUnit = BarValue + e.Location.Y / 23;
     ChoicePanel.Refresh();  //refresh the panel
 }