Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A
dotnetinter

.Net Interview Question:- Show practically how to add your window application icon to the task bar?

.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 > FileNew > 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)
{
notifyIcon1.ShowBalloonTip(1);
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 o important Dotnet interview questions

Regards,


Get more .Net / C# interview questions from author’s blog





Tags: .net and c# interview questions, .net and c# training, .net interview questions and answers, csharp interview questions, information technology questions, programming interview questions
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments