Jumat, 18 Januari 2013

Membuat Form Login

1. Penulisan program


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 LAB_INVENTARIS
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (usrName.Text == "admin" && psWord.Text == "admin")
            {
                Form frm6 = new Form6();
                frm6.Show();
                this.Show();
            }
            else
            {
                MessageBox.Show("Username dan Password tidak Valid...!!!", "Username & Password Salah...!!!");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            usrName.Text = "";
            psWord.Text = "";
        }
        static string a, b, c;
        private void timer1_Tick(object sender, EventArgs e)
        {
            // Tulisan Berjalan Ke Kiri
            a = label4.Text;
            b = a.Substring(0, 1);
            c = a.Substring(1, a.Length - 1);
            label4.Text = c + b;
        }
    }
}



Tidak ada komentar:

Posting Komentar