Login User Control) Create a UserControl called LoginPasswordUserControl that contains a Label
(loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user inputs a login name, a
Label (passwordLabel) that displays the string "Password:" and, finally, a TextBox (passwordTextBox)
where a user inputs a password (set property PasswordChar to "*" in the TextBox’s Properties window).
LoginPasswordUserControl must provide public read-only properties Login and Password that allow an
app to retrieve the user input from loginTextBox and passwordTextBox. The UserControl must be
exported to an app that displays the values input by the user in LoginPasswordUserControl.
(loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user inputs a login name, a
Label (passwordLabel) that displays the string "Password:" and, finally, a TextBox (passwordTextBox)
where a user inputs a password (set property PasswordChar to "*" in the TextBox’s Properties window).
LoginPasswordUserControl must provide public read-only properties Login and Password that allow an
app to retrieve the user input from loginTextBox and passwordTextBox. The UserControl must be
exported to an app that displays the values input by the user in LoginPasswordUserControl.
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 _1st
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
int b;
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text == "admin" && textBox2.Text == "123")
{
label1.Text=DateTime.Now.ToString( "hh:mm:ss" );
b= Convert.ToInt32(label1.Text);
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
label2.Text = DateTime.Now.ToString("hh:mm:ss");
int a;
a = Convert.ToInt32(label2.Text);
int c;
c = a - b;
// label3.Text =Convert.ToSingle(c);
}
}
}
Post A Comment:
0 comments: