.Net Interview Question:- Ways of adding your window application icon to the task bar?

This is not one of the .NET typical interview question but as a developer you would be interested in knowing that how to add your windows application icon in to the task bar.

Let’s demonstrate a simple example to see how exactly you can add your windows application icon in the task bar.

In order to achieve the above subject just follow the following steps.

Step1: – create a windows application for that Go To > File >
> Project > Windows > Select Windows Forms Application.

Step2: – Now from the toolbox just add the “NotifyIcon” control to the main form.

Step3: – Go to the properties of the NotifyIcon control and set the properties like below diagram.

In the above diagram you can see that I have set the following properties.

BalloonTipIcon = Warning.

BalloonTipText = Click to enlarge.

BalloonTipTitle = Message.

Note: – please select an icon with .ico extension with maximum size of
48 * 48.

Step4: – Add a Button on the form and add the below code snippet in to Form1.cs.

private void button1_Click(object sender, EventArgs e)
this.Visible = false;

Once you have completed with all the above steps now just run your
application and will see that the selected application icon is now being added to the task bar to the right bottom of your screen like below diagram.

In above diagram you can clearly see that now the application icon is being added to the task bar.

Now, when you click on the Button1 you will see a message pops up like below diagram as we have declared to the properties of the NotifyIcon control.

Also view our video of C# interview questions on Garbage Collector as follows: –

Visit us for more tutorials on interview questions and answers for .NET


Get more Most asked Dotnet interview questions from author’s blog


About c# and .NET Interview questions

This blog is for developers who want to crack .NET and C# interviews. It has all tips and tricks needed to crack .NET interviews , C# interview , SQL Server interview , Java interview , WCF Interview , Silverlight interview , WPF interview , LINQ interview , Entity framework Interview. Do not forget to watch our Learn step by step video series. Learn MVC in 16 hours:- https://www.youtube.com/watch?v=Lp7nSImO5vk Learn AngularJS Step by Step:- https://www.youtube.com/watch?v=0kmdjqgO9IY Learn Design Pattern in 8 hours:- https://www.youtube.com/watch?v=YDobmucohqk Learn C# and .NET in 60 days:- https://www.youtube.com/watch?v=yh2SrzCkNQA Learn MSBI in 32 hours:- https://www.youtube.com/watch?v=mGPJx3ocFgg Learn SharePoint Step by Step in 8 hours:- https://youtu.be/C2fW76SwJNU
This entry was posted in Uncategorized and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s