Listing: Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
Listing: Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
Listing: Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Tugas
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void buttonX1_Click(object sender, EventArgs e)
{
string a;
if (radioButton1.Checked == true)
{
a = "Laki - Laki";
}
else
{
a = "Perempuan";
}
if (textBoxX3.Text != textBoxX2.Text)
{
MessageBox.Show("Password dan Re-Password tidak sama");
textBoxX3.Focus();
return;
}
Form2 tampil = new Form2("Nama : " + textBoxX1.Text + System.Environment.NewLine
+ "Password : "
+ textBoxX2.Text + System.Environment.NewLine + "Re-Password : " + textBoxX3.Text
+ System.Environment.NewLine
+ "Tanggal Lahir : " + comboBoxEx1.SelectedItem + "-" + comboBoxEx2.SelectedItem
+ " - " + comboBoxEx3.SelectedItem
+ System.Environment.NewLine + "Jenis Kelamin : " + a +
System.Environment.NewLine + "Telepon : "
+ textBoxX4.Text + System.Environment.NewLine + "Hint Password : " +
textBoxX5.Text+System.Environment.NewLine
+"Tipe Karakter : "+listBox1.SelectedItem);
tampil.Show();
this.Hide();
}
private void buttonX3_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void buttonX2_Click(object sender, EventArgs e)
{
textBoxX1.Text = "";
textBoxX2.Text = "";
textBoxX3.Text = "";
comboBoxEx1.SelectedItem = "";
comboBoxEx2.SelectedItem = "";
comboBoxEx3.SelectedItem = "";
textBoxX4.Text = "";
textBoxX5.Text = "";
}
}
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Tugas
{
public partial class Form2 : Form
{
string datapassing;
public Form2(string data)
{
InitializeComponent();
this.datapassing = data;
}
private void Form2_Load(object sender, EventArgs e)
{
textBox1.Text = datapassing;
Form1 tampil = new Form1();
}
private void buttonX1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void buttonX2_Click(object sender, EventArgs e)
{
Form1 tampil = new Form1();
tampil.Show();
this.Hide();
}
Hasil Output