Professional Documents
Culture Documents
Materi Pemrograman Visual Net: Kode Barang Nama Barang Harga Barang
Materi Pemrograman Visual Net: Kode Barang Nama Barang Harga Barang
List barang
LISTING PROGRAM
public partial class MainForm : Form
{
int harga, jmlh, total;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Enabled=false;
textBox2.Enabled=false;
textBox3.Enabled=false;
}
}
void Button1Click(object sender, EventArgs e)
{
if (radioButton1.Checked==true)
{
total = harga *1;
}
else if(radioButton2.Checked==true)
{
total = harga*2;
else if (radioButton3.Checked==true)
{
total = harga * 3;
}
textBox3.Text = Convert.ToString(total);
}
void Button2Click(object sender, EventArgs e)
{
Application.Exit();
}
}