Answer to Question #27572 in Action Script | Flash | Flex | ColdFusion for dhivya

Question #27572
write a c# program to create a login form and student details
1
Expert's answer
2013-04-10T09:59:39-0400
FLogin.Designer.cs
---------------------------------
namespace LoginStudent
{
partial class FLogin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.BLogin = new System.Windows.Forms.Button();
this.BCancel = new System.Windows.Forms.Button();
this.LUser = new System.Windows.Forms.Label();
this.LPassword = new System.Windows.Forms.Label();
this.TBPassword = new System.Windows.Forms.TextBox();
this.TBUser = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// BLogin
//
this.BLogin.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.BLogin.Location = new System.Drawing.Point(35, 62);
this.BLogin.Name = "BLogin";
this.BLogin.Size = new System.Drawing.Size(75, 28);
this.BLogin.TabIndex = 0;
this.BLogin.Text = "Login";
this.BLogin.UseVisualStyleBackColor = true;
this.BLogin.Click += new System.EventHandler(this.BLogin_Click);
//
// BCancel
//
this.BCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.BCancel.Location = new System.Drawing.Point(116, 62);
this.BCancel.Name = "BCancel";
this.BCancel.Size = new System.Drawing.Size(75, 28);
this.BCancel.TabIndex = 1;
this.BCancel.Text = "Cancel";
this.BCancel.UseVisualStyleBackColor = true;
this.BCancel.Click += new System.EventHandler(this.BCancel_Click);
//
// LUser
//
this.LUser.AutoSize = true;
this.LUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LUser.Location = new System.Drawing.Point(9, 9);
this.LUser.Name = "LUser";
this.LUser.Size = new System.Drawing.Size(81, 17);
this.LUser.TabIndex = 2;
this.LUser.Text = "User name:";
//
// LPassword
//
this.LPassword.AutoSize = true;
this.LPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LPassword.Location = new System.Drawing.Point(9, 34);
this.LPassword.Name = "LPassword";
this.LPassword.Size = new System.Drawing.Size(73, 17);
this.LPassword.TabIndex = 3;
this.LPassword.Text = "Password:";
//
// TBPassword
//
this.TBPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBPassword.Location = new System.Drawing.Point(96, 32);
this.TBPassword.Name = "TBPassword";
this.TBPassword.PasswordChar = '*';
this.TBPassword.Size = new System.Drawing.Size(124, 22);
this.TBPassword.TabIndex = 1;
//
// TBUser
//
this.TBUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBUser.Location = new System.Drawing.Point(96, 10);
this.TBUser.Name = "TBUser";
this.TBUser.Size = new System.Drawing.Size(124, 22);
this.TBUser.TabIndex = 0;
//
// FLogin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(231, 97);
this.Controls.Add(this.TBUser);
this.Controls.Add(this.TBPassword);
this.Controls.Add(this.LPassword);
this.Controls.Add(this.LUser);
this.Controls.Add(this.BCancel);
this.Controls.Add(this.BLogin);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(237, 126);
this.MinimumSize = new System.Drawing.Size(237, 126);
this.Name = "FLogin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Login Form";
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.Button BLogin;
private System.Windows.Forms.Button BCancel;
private System.Windows.Forms.Label LUser;
private System.Windows.Forms.Label LPassword;
private System.Windows.Forms.TextBox TBPassword;
private System.Windows.Forms.TextBox TBUser;
}
}

FLogin.cs
---------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LoginStudent
{
public partial class FLogin : Form
{
FDetails details = new FDetails();

public FLogin()
{
InitializeComponent();
}

private void BLogin_Click(object sender, EventArgs e)
{
Hide();
details.Show();
}

private void BCancel_Click(object sender, EventArgs e)
{
Close();
}
}
}

FDetails.Designer.cs
---------------------------------
namespace LoginStudent
{
partial class FDetails
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.TBName = new System.Windows.Forms.TextBox();
this.TBSurname = new System.Windows.Forms.TextBox();
this.LSurname = new System.Windows.Forms.Label();
this.LName = new System.Windows.Forms.Label();
this.TBMiddle = new System.Windows.Forms.TextBox();
this.LMiddle = new System.Windows.Forms.Label();
this.PBox = new System.Windows.Forms.PictureBox();
this.LGender = new System.Windows.Forms.Label();
this.RBMale = new System.Windows.Forms.RadioButton();
this.RBFemale = new System.Windows.Forms.RadioButton();
this.RBUnknown = new System.Windows.Forms.RadioButton();
this.LBirthdate = new System.Windows.Forms.Label();
this.DTBirthdate = new System.Windows.Forms.DateTimePicker();
this.TBAddress = new System.Windows.Forms.TextBox();
this.LAddress = new System.Windows.Forms.Label();
this.TBPhone = new System.Windows.Forms.TextBox();
this.LPhone = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.PBox)).BeginInit();
this.SuspendLayout();
//
// TBName
//
this.TBName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBName.Location = new System.Drawing.Point(107, 12);
this.TBName.Name = "TBName";
this.TBName.Size = new System.Drawing.Size(207, 22);
this.TBName.TabIndex = 10;
//
// TBSurname
//
this.TBSurname.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBSurname.Location = new System.Drawing.Point(107, 34);
this.TBSurname.Name = "TBSurname";
this.TBSurname.PasswordChar = '*';
this.TBSurname.Size = new System.Drawing.Size(207, 22);
this.TBSurname.TabIndex = 9;
//
// LSurname
//
this.LSurname.AutoSize = true;
this.LSurname.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LSurname.Location = new System.Drawing.Point(9, 34);
this.LSurname.Name = "LSurname";
this.LSurname.Size = new System.Drawing.Size(69, 17);
this.LSurname.TabIndex = 8;
this.LSurname.Text = "Surname:";
//
// LName
//
this.LName.AutoSize = true;
this.LName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LName.Location = new System.Drawing.Point(9, 9);
this.LName.Name = "LName";
this.LName.Size = new System.Drawing.Size(49, 17);
this.LName.TabIndex = 7;
this.LName.Text = "Name:";
//
// TBMiddle
//
this.TBMiddle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBMiddle.Location = new System.Drawing.Point(107, 56);
this.TBMiddle.Name = "TBMiddle";
this.TBMiddle.PasswordChar = '*';
this.TBMiddle.Size = new System.Drawing.Size(207, 22);
this.TBMiddle.TabIndex = 12;
//
// LMiddle
//
this.LMiddle.AutoSize = true;
this.LMiddle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LMiddle.Location = new System.Drawing.Point(9, 57);
this.LMiddle.Name = "LMiddle";
this.LMiddle.Size = new System.Drawing.Size(92, 17);
this.LMiddle.TabIndex = 11;
this.LMiddle.Text = "Middle name:";
//
// PBox
//
this.PBox.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.PBox.Location = new System.Drawing.Point(326, 12);
this.PBox.Name = "PBox";
this.PBox.Size = new System.Drawing.Size(122, 137);
this.PBox.TabIndex = 13;
this.PBox.TabStop = false;
//
// LGender
//
this.LGender.AutoSize = true;
this.LGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LGender.Location = new System.Drawing.Point(9, 98);
this.LGender.Name = "LGender";
this.LGender.Size = new System.Drawing.Size(60, 17);
this.LGender.TabIndex = 14;
this.LGender.Text = "Gender:";
//
// RBMale
//
this.RBMale.AutoSize = true;
this.RBMale.Location = new System.Drawing.Point(110, 98);
this.RBMale.Name = "RBMale";
this.RBMale.Size = new System.Drawing.Size(53, 19);
this.RBMale.TabIndex = 15;
this.RBMale.Text = "male";
this.RBMale.UseVisualStyleBackColor = true;
//
// RBFemale
//
this.RBFemale.AutoSize = true;
this.RBFemale.Location = new System.Drawing.Point(171, 98);
this.RBFemale.Name = "RBFemale";
this.RBFemale.Size = new System.Drawing.Size(63, 19);
this.RBFemale.TabIndex = 16;
this.RBFemale.Text = "female";
this.RBFemale.UseVisualStyleBackColor = true;
//
// RBUnknown
//
this.RBUnknown.AutoSize = true;
this.RBUnknown.Checked = true;
this.RBUnknown.Location = new System.Drawing.Point(241, 98);
this.RBUnknown.Name = "RBUnknown";
this.RBUnknown.Size = new System.Drawing.Size(75, 19);
this.RBUnknown.TabIndex = 17;
this.RBUnknown.TabStop = true;
this.RBUnknown.Text = "unknown";
this.RBUnknown.UseVisualStyleBackColor = true;
//
// LBirthdate
//
this.LBirthdate.AutoSize = true;
this.LBirthdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LBirthdate.Location = new System.Drawing.Point(9, 129);
this.LBirthdate.Name = "LBirthdate";
this.LBirthdate.Size = new System.Drawing.Size(73, 17);
this.LBirthdate.TabIndex = 18;
this.LBirthdate.Text = "Birth date:";
//
// DTBirthdate
//
this.DTBirthdate.Location = new System.Drawing.Point(107, 129);
this.DTBirthdate.Name = "DTBirthdate";
this.DTBirthdate.Size = new System.Drawing.Size(207, 20);
this.DTBirthdate.TabIndex = 20;
//
// TBAddress
//
this.TBAddress.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBAddress.Location = new System.Drawing.Point(107, 199);
this.TBAddress.Name = "TBAddress";
this.TBAddress.PasswordChar = '*';
this.TBAddress.Size = new System.Drawing.Size(207, 22);
this.TBAddress.TabIndex = 24;
//
// LAddress
//
this.LAddress.AutoSize = true;
this.LAddress.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LAddress.Location = new System.Drawing.Point(9, 200);
this.LAddress.Name = "LAddress";
this.LAddress.Size = new System.Drawing.Size(64, 17);
this.LAddress.TabIndex = 23;
this.LAddress.Text = "Address:";
//
// TBPhone
//
this.TBPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.176471F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.TBPhone.Location = new System.Drawing.Point(107, 177);
this.TBPhone.Name = "TBPhone";
this.TBPhone.PasswordChar = '*';
this.TBPhone.Size = new System.Drawing.Size(207, 22);
this.TBPhone.TabIndex = 22;
//
// LPhone
//
this.LPhone.AutoSize = true;
this.LPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.882353F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.LPhone.Location = new System.Drawing.Point(9, 177);
this.LPhone.Name = "LPhone";
this.LPhone.Size = new System.Drawing.Size(53, 17);
this.LPhone.TabIndex = 21;
this.LPhone.Text = "Phone:";
//
// FDetails
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(460, 230);
this.Controls.Add(this.TBAddress);
this.Controls.Add(this.LAddress);
this.Controls.Add(this.TBPhone);
this.Controls.Add(this.LPhone);
this.Controls.Add(this.DTBirthdate);
this.Controls.Add(this.LBirthdate);
this.Controls.Add(this.RBUnknown);
this.Controls.Add(this.RBFemale);
this.Controls.Add(this.RBMale);
this.Controls.Add(this.LGender);
this.Controls.Add(this.PBox);
this.Controls.Add(this.TBMiddle);
this.Controls.Add(this.LMiddle);
this.Controls.Add(this.TBName);
this.Controls.Add(this.TBSurname);
this.Controls.Add(this.LSurname);
this.Controls.Add(this.LName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "FDetails";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Student Details";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FDetails_FormClosed);
((System.ComponentModel.ISupportInitialize)(this.PBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.TextBox TBName;
private System.Windows.Forms.TextBox TBSurname;
private System.Windows.Forms.Label LSurname;
private System.Windows.Forms.Label LName;
private System.Windows.Forms.TextBox TBMiddle;
private System.Windows.Forms.Label LMiddle;
private System.Windows.Forms.PictureBox PBox;
private System.Windows.Forms.Label LGender;
private System.Windows.Forms.RadioButton RBMale;
private System.Windows.Forms.RadioButton RBFemale;
private System.Windows.Forms.RadioButton RBUnknown;
private System.Windows.Forms.Label LBirthdate;
private System.Windows.Forms.DateTimePicker DTBirthdate;
private System.Windows.Forms.TextBox TBAddress;
private System.Windows.Forms.Label LAddress;
private System.Windows.Forms.TextBox TBPhone;
private System.Windows.Forms.Label LPhone;
}
}

FDetails.cs
---------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LoginStudent
{
public partial class FDetails : Form
{
public FDetails()
{
InitializeComponent();
}

private void FDetails_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS