Create Desktop Gadgets Using C# Window Application

Step 1

First Create New Project in Vs.Net and put 3 Label and 4 Button Give name and one timer Control For time Display.

1.jpg

Step 2


Set form Bolder Fix and Tool window For look and Give Background Color Transparency.

Step 3

Now Add Event All Control Like this to do and Set Timer Enable and Set Code in Timer Tick Event.

private void timer1_Tick(object sender, EventArgs e)

        {

            this.label1 .Text = DateTime.Now.ToString("T");

            this.label2.Text = DateTime.Now.ToString("D");

            this.label3.Text = DateTime.Now.ToString("dd/MM/yyyy"); 

        }

        private void label2_Click(object sender, EventArgs e)

        {

 

        }

        private void label1_Click(object sender, EventArgs e)

        {

        

        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)

        {

            this.WindowState = FormWindowState.Minimized;

        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)

        {

            Application.Exit();

        }

        private void button1_Click(object sender, EventArgs e)

        {

            try

            {

                System.Diagnostics.Process.Start("winword");   

            }

            catch (Exception Ex)

            {

            }

        }

        private void button2_Click(object sender, EventArgs e)

        {

            try

            {

                System.Diagnostics.Process.Start("excel");

            }

            catch (Exception Ex)

            {

            }

        }

        private void button3_Click(object sender, EventArgs e)

        {

            try

            {

                System.Diagnostics.Process.Start("notepad");

            }

            catch (Exception Ex)

            {

            }

        }

        private void button4_Click(object sender, EventArgs e)

        {

            try

            {

                System.Diagnostics.Process.Start("calc");

            }

            catch (Exception Ex)

            {

            }

        }

        private void button5_Click(object sender, EventArgs e)

        {

            try

            {

                System.Diagnostics.Process.Start("Taskmgr");

            }

            catch (Exception Ex)

            {

          }

        }

Ebook Download
View all
Learn
View all