.Net Interview Question:- Show practically how to add 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 > New > Project > Windows > Select Windows Forms Application.
Step2: - Now from the toolbox just add the “NotifyIcon” control to the main
BalloonTipIcon = Warning.
BalloonTipText = Click to enlarge.
BalloonTipTitle = Message.
Note: - please select an icon with .ico extension with maximum size of
48 * 48.
private void button1_Click(object sender, EventArgs e)
Step4: - Add a Button on the form and add the below code snippet in to
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: -