You are on page 1of 8

Form 1

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 cSharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.CenterToScreen();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Escape))
{
Close();
}
if (keyData == (Keys.Return))
{
this.Hide();
Form2 form2 = new Form2();
form2.Show();
}
if (keyData == (Keys.Return))
{
this.Hide();
Form2 form2 = new Form2();
form2.Show();
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void BunifuThinButton21_Click(object sender, EventArgs e)
{
if(bunifuMaterialTextbox1.Text.Equals("") ||
bunifuMaterialTextbox2.Text.Equals("")||
bunifuMaterialTextbox3.Text.Equals("") ||
bunifuMaterialTextbox4.Text.Equals("")||
bunifuMaterialTextbox5.Text.Equals(""))
{
MessageBox.Show("Please Fill All the FIELDS");
}
else
{
Form2 objMainWindow = new Form2();
this.Hide();
objMainWindow.Show();
}
}
}
}

Form 2
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 cSharp
{
public partial class Form2 : Form
{
Double count = 0;
public Form2()
{
InitializeComponent();
this.CenterToScreen();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.F1))
{
Form1 otherForm = new Form1();
this.Hide();
otherForm.Show();
return true;
}
if (keyData == (Keys.Escape))
{
Close();
}
if (keyData == (Keys.Return))
{
this.Hide();
Form3 form3 = new Form3();
form3.Show();
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void BunifuThinButton21_Click(object sender, EventArgs e)
{
string user, pass;
user = "ADMIN";
pass = "ADMIN";
if ((bunifuMaterialTextbox1.Text == user) && (bunifuMaterialTextbox2.Text ==
pass))
{
MessageBox.Show("Welcome User");
Form3 otherForm = new Form3();
this.Hide();
otherForm.Show();
}
else
{
count = count + 1;
double maxcount = 3;
double remain;
remain = maxcount - count;
MessageBox.Show("Wrong user name or password" + "\t" + remain + "" +
"tries left");
bunifuMaterialTextbox2.Text = " ";
bunifuMaterialTextbox1.Text = " ";
bunifuMaterialTextbox1.Focus();

if (count == maxcount)
{
MessageBox.Show("Max try exceeded.");
Application.Exit();
}
}
}
}
}

Form 3
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 cSharp
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
this.CenterToScreen();
}
private void Array()
{

}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{

if (keyData == (Keys.Escape))
{
Close();
}
if (keyData == (Keys.Return))
{
this.Hide();
Form4 form4 = new Form4();
form4.Show();
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void Form3_Load(object sender, EventArgs e)
{
ListView listView1 = new ListView();
listView1.Bounds = new Rectangle(new Point(10, 10), new Size(600, 400));

listView1.View = View.Details;
listView1.LabelEdit = true;
listView1.AllowColumnReorder = true;
listView1.CheckBoxes = false;
listView1.FullRowSelect = true;
listView1.GridLines = true;
listView1.Sorting = SortOrder.Ascending;
ListViewItem GAD = new ListViewItem("GADGETS", 0);
GAD.Checked = true;
GAD.SubItems.Add("LAPTOP");
GAD.SubItems.Add("COMPUTER");
GAD.SubItems.Add("CELLPHONE");
GAD.SubItems.Add("IPOD");
GAD.SubItems.Add("MACBOOK");
ListViewItem SOU = new ListViewItem("SOUND", 1);
SOU.SubItems.Add("HEADPHONE");
SOU.SubItems.Add("SPEAKER");
SOU.SubItems.Add("EARBUDS");
SOU.SubItems.Add("HEADSET");
SOU.SubItems.Add("EARPHONE");
ListViewItem ACC = new ListViewItem("ACCESORIES", 0);
ACC.Checked = true;
ACC.SubItems.Add("MOUSE");
ACC.SubItems.Add("KEYBOARD");
ACC.SubItems.Add("MOUSEPAD");
ACC.SubItems.Add("COOLPAD");
ACC.SubItems.Add("JOYSTCK");
listView1.Columns.Add("DESCRIPTION", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 1", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left);
listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Center);
listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center);
listView1.Columns.Add("Column 5", -2, HorizontalAlignment.Center);
listView1.Items.AddRange(new ListViewItem[] { GAD, SOU, ACC });
this.Controls.Add(listView1);
}
}
}
Form 4
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 cSharp
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
this.CenterToScreen();

}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Control | Keys.F1))
{
Form3 otherForm = new Form3();
this.Hide();
otherForm.Show();
return true;
}
if (keyData == (Keys.Escape))
{
Close();
}
if (keyData == (Keys.Return))
{
this.Hide();
Form1 form1 = new Form1();
form1.Show();
}
return base.ProcessCmdKey(ref msg, keyData);
}

}
}

You might also like