Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.Trim() == string.Empty)
     {
         MessageBox.Show("Tolong masukkan namamu lebih dulu ya :)");
     }
     else
     {
         try
         {
             if (!Form1.Instance.PnlContainer.Controls.ContainsKey("UCRule"))
             {
                 UCRule rule = new UCRule();
                 rule.Dock = DockStyle.Fill;
                 Form1.Instance.PnlContainer.Controls.Add(rule);
             }
             Form1.Instance.PnlContainer.Controls["UCRule"].BringToFront();
             Jawaban = textBox1.Text;
             UCHasil hsl = new UCHasil();
             hsl.textBox1.Text = textBox1.Text;
         }
         catch (Exception)
         {
             if (!Form1.Instance.PnlContainer.Controls.ContainsKey("UCRule"))
             {
                 UCRule rule = new UCRule();
                 rule.Dock = DockStyle.Fill;
                 Form1.Instance.PnlContainer.Controls.Add(rule);
             }
             Form1.Instance.PnlContainer.Controls["UCRule"].BringToFront();
             Jawaban = textBox1.Text;
         }
     }
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int Hasil = UCQuest1.jawaban + UCQuest2.jawaban + UCQuest3.jawaban + UCQuest4.jawaban + UCQuest5.jawaban + UCQuest6.jawaban + UCQuest7.jawaban + UCQuest8.jawaban + trackBar1.Value;

            if (Hasil >= 0 && Hasil <= 4)
            {
                JenisDepresi = "No depression";
                Point        = 1;
            }
            else if (Hasil >= 5 && Hasil <= 9)
            {
                JenisDepresi = "Mild depression";
                Point        = 2;
            }
            else if (Hasil >= 10 && Hasil <= 14)
            {
                JenisDepresi = "Moderate depression";
                Point        = 3;
            }
            else if (Hasil >= 15 && Hasil <= 19)
            {
                JenisDepresi = "Moderately severe depression";
                Point        = 4;
            }
            else if (Hasil >= 20 && Hasil <= 27)
            {
                JenisDepresi = "Severe depression";
                Point        = 5;
            }

            if (!Form1.Instance.PnlContainer.Controls.ContainsKey("UCHasil"))
            {
                UCHasil hasil = new UCHasil();
                hasil.Dock = DockStyle.Fill;
                Form1.Instance.PnlContainer.Controls.Add(hasil);
            }
            Form1.Instance.PnlContainer.Controls["UCHasil"].BringToFront();
        }
Example #3
0
 public UCNama()
 {
     InitializeComponent();
     hasil1 = new UCHasil(this);
     grafik = new UCGrafik(this);
 }
Example #4
0
 public UCQuest9()
 {
     InitializeComponent();
     hasil  = new UCHasil(this);
     grafik = new UCGrafik(this);
 }