Exemplo n.º 1
0
 private void Oc_CheckedChanged(UCOptionForPresentation sender)
 {
     if (justOneTrueOption)
     {
         if (sender.Checked)
         {
             foreach (UCOptionForPresentation c in flowLayoutPanel1.Controls)
             {
                 if (c != sender)
                 {
                     c.Checked = false;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public MultiOptionsForPresentation(List <Option> options, bool justOneTrueOption, bool answerTime, bool showTrueOption)
        {
            InitializeComponent();
            this.justOneTrueOption = justOneTrueOption;
            if (options == null || options.Count == 0)
            {
                return;
            }
            Options = options.OrderBy(o => o.number).ToList();

            byte i = 1;

            foreach (Option o in options)
            {
                o.number = i++;
                var oc = new UCOptionForPresentation(o, justOneTrueOption, answerTime, showTrueOption);
                oc.CheckedChanged += Oc_CheckedChanged;;

                oc.Width = Width - 30;
                flowLayoutPanel1.Controls.Add(oc);
            }
        }