buka VS 2012
FIle new pada windows form application
masukkan script berikut :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace praktikumASP4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
progressBar1.Value = 0;
if (a.Text == "")
{
x1.SetError(a, "Masukkan Nama ");
}
else
{
x1.SetError(a, "");
}
if (b.Text == "")
{
x2.SetError (b, "Masukkan NIM ");
}
else
{
x2.SetError(b, "");
}
if (c.Text == "")
{
x3.SetError(c, "Masukkan Kelas ");
}
else
{
x3.SetError(c, "");
}
if (d.Text == "")
{
x4.SetError(d, "Masukkan SMP asal ");
}
else
{
x4.SetError(d, "");
}
for (int i = 0; i < progressBar1.Maximum; i++)
{
progressBar1.Value = progressBar1.Value + 1;
}
MessageBox.Show("\nNama\t : "+ a.Text + "\nNIM\t : "
+ b.Text + "\nKelas\t :" + c.Text + "\nSMP asal\t : " + d.Text);
}
private void x(string p)
{
throw new NotImplementedException();
}
maka hasilnya akan seperti gambar dibawah:
Semoga Berhasil :)
Tidak ada komentar:
Posting Komentar