Wuahhhh udah 2015 aja neh. Lama ga posting sekarang ane sempetin. Dipostingan awal tahun ini ane post tentang GUI C# Data Nilai Mahasiswa. Okesip gapake lama langsung ke TKP !!
textBox1 = textNIM
textBox2 = textNama
textBox3 = textNilaiAbsen
textBox4 = textNilaiTUgas
textBox5 = textNilaiUTS
textBox6 = textNilaiUAS
textBox7 = textNilaiAkhir
textBox8 = textGrade
listBox1 = listData
button1 = buttonInput
button2 = buttonProses
button3 = buttonBersih
button4 = buttonTutup
Original Design and Code Listing by Q-Tunk
Modified and Finished by thebigfakesmile
Supported by Rudiansah
Software : Microsoft Visual Studio 2012 Ultimate
Operating System : Microsoft Windows 7 32bit Ultimate
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 nilai_mahasiswa
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textNIM.Enabled = false;
textNama.Enabled = false;
textNilaiAbsen.Enabled = false;
textNilaiTugas.Enabled = false;
textNilaiUTS.Enabled = false;
textNilaiUAS.Enabled = false;
textNilaiAkhir.Enabled = false;
textGrade.Enabled = false;
buttonProses.Enabled = false;
buttonBersih.Enabled = false;
}
private void buttonInput_Click(object sender, EventArgs e)
{
textNIM.Enabled = true;
textNama.Enabled = true;
textNilaiAbsen.Enabled = true;
textNilaiTugas.Enabled = true;
textNilaiUTS.Enabled = true;
textNilaiUAS.Enabled = true;
textNilaiAkhir.Enabled = true;
textGrade.Enabled = true;
buttonInput.Enabled = false;
buttonProses.Enabled = true;
buttonBersih.Enabled = true;
buttonTutup.Enabled = false;
textNIM.Focus();
}
private void buttonProses_Click(object sender, EventArgs e)
{
double nak,nab,ntu,nut,nua;
string NAB, NTU, NUT, NUA;
NAB = textNilaiAbsen.Text;
NTU = textNilaiTugas.Text;
NUT = textNilaiUTS.Text;
NUA = textNilaiUAS.Text;
double.TryParse(NAB, out nab);
double.TryParse(NTU, out ntu);
double.TryParse(NUT, out nut);
double.TryParse(NUA, out nua);
nak = nab * 0.1 + ntu * 0.2 + nut * 0.3 + nua * 0.4;
textNilaiAkhir.Text = nak.ToString();
if (nak >= 84)
{
textGrade.Text = "A";
}
else if (nak >= 75 && nak < 84)
{
textGrade.Text = "B";
}
else if (nak >= 65 && nak < 75)
{
textGrade.Text = "C";
}
else if (nak >= 59 && nak < 64)
{
textGrade.Text = "D";
}
else if (nak < 59)
{
textGrade.Text = "E";
}
listData.Items.Add("NIM : " + textNIM.Text);
listData.Items.Add("Nama : " + textNama.Text);
listData.Items.Add("Nilai Akhir : " + textNilaiAkhir.Text);
listData.Items.Add("Grade : " + textGrade.Text);
}
private void buttonBersih_Click(object sender, EventArgs e)
{
textNIM.Text = "";
textNama.Text = "";
textNilaiAbsen.Text = "";
textNilaiTugas.Text = "";
textNilaiUTS.Text = "";
textNilaiUAS.Text = "";
textNilaiAkhir.Text = "";
textGrade.Text = "";
listData.Items.Clear();
}
private void buttonTutup_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Hasil runningya :
tampilan awal
button input ditekan
input data
button proses ditekan
button bersih ditekan
1 comments:
Makasih atas artikeelnya ........sangat membantu bang
Moga makin maju blognya
Post a Comment