- Beranda
- Komunitas
- Tech
- Programmer Forum
yang ngerti windows form manual blh minta tolong??


TS
rochirochi
yang ngerti windows form manual blh minta tolong??
Spoiler for :
using System;
using System.Collections.Generic;
using System.Collections;
using System.Data.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace Data_pegawai
{
class Welcome : Form
{
Label wlcm, nm, pass;
TextBox name, passwrd;
ErrorProvider error, error2;
Button sbmt;
PictureBox qiza;
public Welcome()
{
this.Size = new Size(300, 250);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.White;
this.ControlBox = false;
passwrd = new TextBox();
passwrd.Validating += new CancelEventHandler(passwrd_Validating);
passwrd.Location = new Point(115, 125);
passwrd.Size = new Size(140, 100);
this.Controls.Add(passwrd);
name = new TextBox();
name.Validating += new CancelEventHandler(name_Validating);
name.Location = new Point(115, 100);
name.Size = new Size(140, 100);
this.Controls.Add(name);
pass = new Label();
pass.ForeColor = Color.Black;
pass.Text = "Password ";
pass.Location = new Point(50, 130);
this.Controls.Add(pass);
qiza = new PictureBox();
qiza.Width = 50;
qiza.Height = 50;
qiza.SizeMode = PictureBoxSizeMode.StretchImage;
Bitmap MyImage = new Bitmap("D:\\QIZA DOKUMEN\\ayu webqiza\\logo.jpg");
qiza.ClientSize = new Size(100, 25);
qiza.Image = (Image)MyImage;
qiza.Location = new Point(0, 0);
this.Controls.Add(qiza);
sbmt = new Button();
sbmt.Text = "Submit";
sbmt.BackColor = Color.Orange;
sbmt.Click += new EventHandler(sbmt_Click);
sbmt.Location = new Point(205, 150);
sbmt.Size = new Size(50, 17);
this.Controls.Add(sbmt);
nm = new Label();
nm.ForeColor = Color.Black;
nm.Text = "Enter Name ";
nm.Location = new Point(50, 105);
this.Controls.Add(nm);
wlcm = new Label();
wlcm.ForeColor = Color.Black;
wlcm.Text = "Welcome , ";
wlcm.Font = new Font("HarlowSolidItalic", 20);
wlcm.Location = new Point(45, 60);
wlcm.AutoSize = true;
this.Controls.Add(wlcm);
error = new ErrorProvider();
error2 = new ErrorProvider();
}
void passwrd_Validating(object sender, CancelEventArgs e)
{
passwrd.PasswordChar = '*';
error.SetError(passwrd, "");
if (passwrd.Text.Length <= 3)
error.SetError(passwrd, "Please letter combine password");
else
{
error.SetError(passwrd, "");
}
}
void name_Validating(object sender, CancelEventArgs e)
{
error.SetError(name, "");
if (name.Text.Length <= 3)
error.SetError(name, "Please letter combine name");
else
{
error.SetError(name, "");
}
}
private void sbmt_Click(object sender, EventArgs e)
{
if (name.Text.Length <= 3 || passwrd.Text.Length <= 3)
{
MessageBox.Show("Please enter valid data");
}
else
{
this.Hide();
data pgawai = new data();
pgawai.ShowDialog();
}
}
public static void Main(string[] test)
{
Application.Run(new Welcome());
}
}
class data : Form
{
public Label nama, tgl, gender;
public CheckBox dtapgwai;
public Button add, remove;
public Panel pnlAts;
ArrayList arrNama, arrTgl, arrGender;
public data()
{
this.Size = new Size(400, 400);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.Aqua;
this.Text = "Data Pegawai";
this.ControlBox = false;
pnlAts = new Panel();
pnlAts.BackColor = Color.White;
pnlAts.Size = new Size(375, 325);
pnlAts.Location = new Point(5, 5);
gender = new Label();
gender.BorderStyle = BorderStyle.FixedSingle;
gender.Size = new Size(50, 20);
gender.Location = new Point(320, 5);
gender.Text = "Gender";
pnlAts.Controls.Add(gender);
tgl = new Label();
tgl.BorderStyle = BorderStyle.FixedSingle;
tgl.Size = new Size(195, 20);
tgl.Location = new Point(125, 5);
tgl.Text = "Tanggal Lahir";
pnlAts.Controls.Add(tgl);
nama = new Label();
nama.BorderStyle = BorderStyle.FixedSingle;
nama.Size = new Size(95, 20);
nama.Location = new Point(30, 5);
nama.Text = "Nama";
pnlAts.Controls.Add(nama);
dtapgwai = new CheckBox();
dtapgwai.Location = new Point(10, 5);
pnlAts.Controls.Add(dtapgwai);
remove = new Button();
remove.BackColor = Color.Orange;
remove.Text = "Remove";
remove.Location = new Point(310, 335);
remove.Size = new Size(60, 20);
remove.Click += new EventHandler(remove_Click);
this.Controls.Add(remove);
add = new Button();
add.BackColor = Color.Orange;
add.Text = "Add";
add.Location = new Point(240, 335);
add.Size = new Size(60, 20);
add.Click += new EventHandler(add_Click);
this.Controls.Add(add);
this.Controls.Add(pnlAts);
}
void remove_Click(object sender, EventArgs e)
{
this.Hide();
}
void add_Click(object sender, EventArgs e)
{
this.Hide();
Add Data = new Add();
Data.ShowDialog();
arrGender = new ArrayList();
arrGender.Add("" + Data.jnsklmn.Text);
arrTgl = new ArrayList();
arrTgl.Add("" + Data.Tgl.Text);
arrNama = new ArrayList();
arrNama.Add("" + Data.nm.Text);
this.Show();
}
}
class Add : Form
{
public TextBox nm;
public ComboBox jnsklmn;
public DateTimePicker Tgl;
Label nma, tggl, gender;
Button add2, cancel;
public Add()
{
this.Size = new Size(300, 200);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.White;
this.ControlBox = false;
nm = new TextBox();
nm.Location = new Point(80, 20);
nm.Size = new Size(175, 100);
this.Controls.Add(nm);
nma = new Label();
nma.Text = "Nama :";
nma.Location = new Point(20, 20);
this.Controls.Add(nma);
jnsklmn = new ComboBox();
jnsklmn.Items.Add("Male");
jnsklmn.Items.Add("Female");
jnsklmn.Location = new Point(80, 50);
jnsklmn.Size = new Size(100, 100);
this.Controls.Add(jnsklmn);
gender = new Label();
gender.Text = "Gender :";
gender.Location = new Point(20, 50);
this.Controls.Add(gender);
Tgl = new DateTimePicker();
Tgl.Location = new Point(80, 80);
this.Controls.Add(Tgl);
tggl = new Label();
tggl.Text = "TTL :";
tggl.Location = new Point(20, 80);
this.Controls.Add(tggl);
add2 = new Button();
add2.Text = "Add";
add2.Location = new Point(100, 125);
add2.Click += new EventHandler(add2_Click);
this.Controls.Add(add2);
cancel = new Button();
cancel.Text = "Cancel";
cancel.Location = new Point(200, 125);
cancel.Click += new EventHandler(cancel_Click);
this.Controls.Add(cancel);
}
void cancel_Click(object sender, EventArgs e)
{
this.Hide();
}
void add2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
using System.Collections.Generic;
using System.Collections;
using System.Data.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace Data_pegawai
{
class Welcome : Form
{
Label wlcm, nm, pass;
TextBox name, passwrd;
ErrorProvider error, error2;
Button sbmt;
PictureBox qiza;
public Welcome()
{
this.Size = new Size(300, 250);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.White;
this.ControlBox = false;
passwrd = new TextBox();
passwrd.Validating += new CancelEventHandler(passwrd_Validating);
passwrd.Location = new Point(115, 125);
passwrd.Size = new Size(140, 100);
this.Controls.Add(passwrd);
name = new TextBox();
name.Validating += new CancelEventHandler(name_Validating);
name.Location = new Point(115, 100);
name.Size = new Size(140, 100);
this.Controls.Add(name);
pass = new Label();
pass.ForeColor = Color.Black;
pass.Text = "Password ";
pass.Location = new Point(50, 130);
this.Controls.Add(pass);
qiza = new PictureBox();
qiza.Width = 50;
qiza.Height = 50;
qiza.SizeMode = PictureBoxSizeMode.StretchImage;
Bitmap MyImage = new Bitmap("D:\\QIZA DOKUMEN\\ayu webqiza\\logo.jpg");
qiza.ClientSize = new Size(100, 25);
qiza.Image = (Image)MyImage;
qiza.Location = new Point(0, 0);
this.Controls.Add(qiza);
sbmt = new Button();
sbmt.Text = "Submit";
sbmt.BackColor = Color.Orange;
sbmt.Click += new EventHandler(sbmt_Click);
sbmt.Location = new Point(205, 150);
sbmt.Size = new Size(50, 17);
this.Controls.Add(sbmt);
nm = new Label();
nm.ForeColor = Color.Black;
nm.Text = "Enter Name ";
nm.Location = new Point(50, 105);
this.Controls.Add(nm);
wlcm = new Label();
wlcm.ForeColor = Color.Black;
wlcm.Text = "Welcome , ";
wlcm.Font = new Font("HarlowSolidItalic", 20);
wlcm.Location = new Point(45, 60);
wlcm.AutoSize = true;
this.Controls.Add(wlcm);
error = new ErrorProvider();
error2 = new ErrorProvider();
}
void passwrd_Validating(object sender, CancelEventArgs e)
{
passwrd.PasswordChar = '*';
error.SetError(passwrd, "");
if (passwrd.Text.Length <= 3)
error.SetError(passwrd, "Please letter combine password");
else
{
error.SetError(passwrd, "");
}
}
void name_Validating(object sender, CancelEventArgs e)
{
error.SetError(name, "");
if (name.Text.Length <= 3)
error.SetError(name, "Please letter combine name");
else
{
error.SetError(name, "");
}
}
private void sbmt_Click(object sender, EventArgs e)
{
if (name.Text.Length <= 3 || passwrd.Text.Length <= 3)
{
MessageBox.Show("Please enter valid data");
}
else
{
this.Hide();
data pgawai = new data();
pgawai.ShowDialog();
}
}
public static void Main(string[] test)
{
Application.Run(new Welcome());
}
}
class data : Form
{
public Label nama, tgl, gender;
public CheckBox dtapgwai;
public Button add, remove;
public Panel pnlAts;
ArrayList arrNama, arrTgl, arrGender;
public data()
{
this.Size = new Size(400, 400);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.Aqua;
this.Text = "Data Pegawai";
this.ControlBox = false;
pnlAts = new Panel();
pnlAts.BackColor = Color.White;
pnlAts.Size = new Size(375, 325);
pnlAts.Location = new Point(5, 5);
gender = new Label();
gender.BorderStyle = BorderStyle.FixedSingle;
gender.Size = new Size(50, 20);
gender.Location = new Point(320, 5);
gender.Text = "Gender";
pnlAts.Controls.Add(gender);
tgl = new Label();
tgl.BorderStyle = BorderStyle.FixedSingle;
tgl.Size = new Size(195, 20);
tgl.Location = new Point(125, 5);
tgl.Text = "Tanggal Lahir";
pnlAts.Controls.Add(tgl);
nama = new Label();
nama.BorderStyle = BorderStyle.FixedSingle;
nama.Size = new Size(95, 20);
nama.Location = new Point(30, 5);
nama.Text = "Nama";
pnlAts.Controls.Add(nama);
dtapgwai = new CheckBox();
dtapgwai.Location = new Point(10, 5);
pnlAts.Controls.Add(dtapgwai);
remove = new Button();
remove.BackColor = Color.Orange;
remove.Text = "Remove";
remove.Location = new Point(310, 335);
remove.Size = new Size(60, 20);
remove.Click += new EventHandler(remove_Click);
this.Controls.Add(remove);
add = new Button();
add.BackColor = Color.Orange;
add.Text = "Add";
add.Location = new Point(240, 335);
add.Size = new Size(60, 20);
add.Click += new EventHandler(add_Click);
this.Controls.Add(add);
this.Controls.Add(pnlAts);
}
void remove_Click(object sender, EventArgs e)
{
this.Hide();
}
void add_Click(object sender, EventArgs e)
{
this.Hide();
Add Data = new Add();
Data.ShowDialog();
arrGender = new ArrayList();
arrGender.Add("" + Data.jnsklmn.Text);
arrTgl = new ArrayList();
arrTgl.Add("" + Data.Tgl.Text);
arrNama = new ArrayList();
arrNama.Add("" + Data.nm.Text);
this.Show();
}
}
class Add : Form
{
public TextBox nm;
public ComboBox jnsklmn;
public DateTimePicker Tgl;
Label nma, tggl, gender;
Button add2, cancel;
public Add()
{
this.Size = new Size(300, 200);
this.StartPosition = FormStartPosition.CenterScreen;
this.BackColor = Color.White;
this.ControlBox = false;
nm = new TextBox();
nm.Location = new Point(80, 20);
nm.Size = new Size(175, 100);
this.Controls.Add(nm);
nma = new Label();
nma.Text = "Nama :";
nma.Location = new Point(20, 20);
this.Controls.Add(nma);
jnsklmn = new ComboBox();
jnsklmn.Items.Add("Male");
jnsklmn.Items.Add("Female");
jnsklmn.Location = new Point(80, 50);
jnsklmn.Size = new Size(100, 100);
this.Controls.Add(jnsklmn);
gender = new Label();
gender.Text = "Gender :";
gender.Location = new Point(20, 50);
this.Controls.Add(gender);
Tgl = new DateTimePicker();
Tgl.Location = new Point(80, 80);
this.Controls.Add(Tgl);
tggl = new Label();
tggl.Text = "TTL :";
tggl.Location = new Point(20, 80);
this.Controls.Add(tggl);
add2 = new Button();
add2.Text = "Add";
add2.Location = new Point(100, 125);
add2.Click += new EventHandler(add2_Click);
this.Controls.Add(add2);
cancel = new Button();
cancel.Text = "Cancel";
cancel.Location = new Point(200, 125);
cancel.Click += new EventHandler(cancel_Click);
this.Controls.Add(cancel);
}
void cancel_Click(object sender, EventArgs e)
{
this.Hide();
}
void add2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
cuman pengen ngerti gmn caranya bikin list dari textbox jadi label masuk ke panel auto location ,,dah coba make arraylist ttp aja ga muncul ,,tolong pencerahan nya gan



0
723
Kutip
0
Balasan


Komentar yang asik ya


Komentar yang asik ya
Komunitas Pilihan