Page 47 - E-Modul Pemrograman Dasar Kelas X RPL
P. 47
{
InitializeComponent();
}
private void btnitung_Click(object sender,
EventArgs e)
{
double panjang, lebar, tinggi, volume;
panjang double.Parse(txtPanjang.Text);
lebar double.Parse(txtLebar.Text);
tinggi double.Parse(txtTinggi.Text);
volume = panjang lebar tinggi;
txtVolume.Text = Convert.ToString(volume);
}
private void btnKeluar_Click(object sender,
EventArgs e)
{
this.Close();
}
}
}
f) Form volume tabung (frmTabung)
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;
37