Pratikum ASP 4 selesai nih.
- Tulis Script :
Ini Script nya :
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 FormVal
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void progressBar1_Click(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
bar1.Value = 0;
if (a.Text == "")
{
x.SetError(a, "Masukkan Nama");
}
else
{
x.SetError(a, "");
}
if (b.Text == "")
{
x1.SetError(b, "Masukan NIS");
}
else
{
x1.SetError(b, "");
}
if (c.Text == "")
{
x2.SetError(c, "Masukan Kelas");
}
else
{
x2.SetError(c, "");
}
if (d.Text == "")
{
x3.SetError(d, "Masukan SMP Asal");
}
else
{
x3.SetError(d, "");
}
for (int i = 0; i < bar1.Maximum; i++)
{
bar1.Value = bar1.Value + 1;
}
if (a.Text == "" || b.Text == "" || c.Text == "" || d.Text == "")
{
MessageBox.Show("DATA KURANG, HARAP DIISI LAGI !!");
}
else
{
MessageBox.Show("\nNama\t : " + a.Text + "\nNIM\t : "
+ b.Text + "\nKelas\t : " + c.Text + "\nShift\t : " + d.Text);
}
}
}
}
Tidak ada komentar:
Posting Komentar