Exemplo n.º 1
0
        private void Init()
        {
            int y = 130;

            pergunta_label.Text += Fato.Nome;
            pergunta_label.Text += " ?";

            if (Fato.Tipo == TipoResposta.Numerico)
            {
                numbox.Location = new Point(148, y);
                numbox.Visible  = true;
                numbox.Minimum  = Convert.ToInt32(Fato.Respostas[0].Descricao);
                numbox.Maximum  = Convert.ToInt32(Fato.Respostas[1].Descricao);
                numbox.ReadOnly = true;
                Controls.Add(numbox);
            }
            else
            {
                foreach (var resposta in Fato.Respostas)
                {
                    var rdbtn = new MaterialSkin.Controls.MaterialRadioButton()
                    {
                        Text     = resposta.Descricao,
                        Location = new Point(148, y),
                        Visible  = true,
                        Name     = resposta.Id.ToString()
                    };
                    radioButtons.Add(rdbtn);
                    this.Controls.Add(rdbtn);
                    y += 25;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Populates the panel containing radio buttons in 'Create' tab.
        /// </summary>
        private void populatePanel(FlowLayoutPanel panel)
        {
            MaterialRadioButton radioBtn;
            string[] cardGroups = Directory.GetDirectories(this.cardDir);

            for (int i = 0; i < cardGroups.Length; i++)
            {
                radioBtn = new MaterialRadioButton();
                radioBtn.AutoSize = true;
                radioBtn.Depth = 0;
                radioBtn.Font = new System.Drawing.Font("Roboto", 10F);
                radioBtn.Location = new System.Drawing.Point(3, 3);
                radioBtn.Margin = new System.Windows.Forms.Padding(0);
                radioBtn.MouseLocation = new System.Drawing.Point(-1, -1);
                radioBtn.MouseState = MaterialSkin.MouseState.HOVER;
                radioBtn.Name = "radioBtnRadiobutton";
                radioBtn.Ripple = true;
                radioBtn.Size = new System.Drawing.Size(163, 30);
                radioBtn.TabIndex = 0;
                radioBtn.TabStop = true;
                cardGroups[i] = cardGroups[i].Replace(this.cardDir, "");
                radioBtn.Text = cardGroups[i];
                radioBtn.UseVisualStyleBackColor = true;
                panel.Controls.Add(radioBtn);
            }
        }