Page 38 - E-Modul Pemrograman Dasar
P. 38

c)  Form luas segi empat (frmsegiempat)


                        using System;
                        using System.Collections.Generic;
                        using System.ComponentModel; using System.Data;
                        using System.Drawing; using System.Linq;
                        using System.Text;
                        using System.Windows.Forms;


                        namespace Luasdanvolume
                        {
                               public partial class frmSegiempat : Form

                               {
                                       public frmSegiempat()
                                       {
                                              InitializeComponent();
                                       }


                                       private void btnHitung_Click(object sender, EventArgs e)
                                       {
                                              double panjang, lebar, luas;

                                              panjang double.Parse(txtPanjang.Text);
                                              lebar double.Parse(txtLebar.Text);
                                              luas = panjang lebar;
                                              txtLuas.Text = Convert.ToString(luas);
                                       }


                                       private void btnKeluar_Click(object sender, EventArgs e)
                                       {
                                              this.Close();

                                       }
                               }
                        }







                                                             29
   33   34   35   36   37   38   39   40   41   42   43