Progress Bar Open Login Button Click in C# Window Application

Progress Bar Open Login Button Click


Progress Bar Open WhenEver Click Button Load  The Progress Bar Particular Interval After go To Next Form Using C# Window Application.

                           DEMO 




           
                             C# CODING


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

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "A" && textBox2.Text == "A")
            {
                progressBar1.Visible = true;

                timer1.Enabled = true;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.PerformStep();

            if (Convert.ToInt32(progressBar1.Value) == 100)
            {
               timer1.Enabled = false;

               Home h = new Home();
               h.Show();
            }
        }
        private void Login_Load(object sender, EventArgs e)
        {
            Login frm = new Login();
            frm.FormBorderStyle = FormBorderStyle.FixedDialog;
            frm.StartPosition = FormStartPosition.CenterScreen;
            progressBar1.Visible = false;

        }         
                                
    }
}


First Add The New Form - Select Labels & Textbox & Progress Bar & timer From ToolBox





Next - Set - Progress Bar Property






Next - Set  To Timer Control Enable & Open the Progress Bar






Next -  Run[F5] - Login Form Open





Next - Login Button Click  - Progress Bar Loading












0 comments:

Post a Comment