Category: C#

C# Program – Multiline string literal in C#

If you are looking at an easy way to create a multiline string literal in C#, then you use the verbatim string literal as shown in the below code snippet. C# Program – Multiline string literal in C# Using the verbatim stting ensures that it allows multiple lunes and also you donot need to have any escape special characters (except for double quotes).

C# Program – How to Calculate Age based on DateTime ?

In C#, you can calculate the age based on the datetime property by subtracting the number of years from today with the birthday year. We should also consider the Leap Year as needed. How to Calculate age based on DateTime of Birthday in C# ? Here’s a simple code snippet demonstrating how to do it. Output

How to Check Status of Current Thread in C# ?

This blog post will provide a simple tip on how you can find the status of the current thread in C# program. How to Check Status of Current Thread in C# ? The isAlive property can be used to check the current thread status in C#. First , get the instance of the current thread using the Thread.CurrentThread and then get the IsAlive property. Ensure…

How to disable editing of items in a combo box in c#?

When working in Win forms using C# and especially when you use the combo box , you would have noticed that by default the user can edit the values inside during the runtime. How to disable editing of items in a combo box in c# (win forms) ? Assuming that the combobox name is combobox1 , here the code to get this behavior.

Liked this content?. Please spread the word :)