In many cases you may need to show special characters, white spaces in your ComboBox when it is binded to enum. (Please see here my ‘binding to enums‘ post) Basically enums cannot have white spaces neither special characters like ‘ö’ …
Category: Useful codes
In the past few weeks I was asked to create a simple login form by several developers. In this short useful code you’ll see a login form with logoff and remember me function on the main form. Some of the …
It could be very useful if your application (doesn’t matter if it’s a Winforms or web application) create a log file and write every important moment in it. The best package I found is Log4Net. It can be easily used …
I was asked to create a simple webform that contains one DropDownList, filled up data from SQL and by selecting any of them show the associated image. First of all, I’ve created the database on the SQL server (using Windows …
It may happen that your Winforms application must run only in one instance, so you should inform the user about it if he/she would like to start it again. This useful code could be built as a DLL file and …
Basically there are two ways to know where are we on a graph or a map: cartesian coordinates polar coordinates Cartesian coordinates tell us that “how far along” and “how far up” we are: Polar coordinates tell us that “how …
After creating the extension method of DataTableToExcel, let’s create that DataTable from a CSV file. If you open a csv file in Excel, you’ll get all the information in 1 column. Now we create a usable xlsx file from out …
With extension methods you can easily add new methods to existing types without creating new derived type or modifing the original type. Anytime you write a new method that has an input parameter with the keyword: this, is going to …
If you’re developing an application that uses network communications, it could be very useful, if you can validate every IPv4 address that users may enter on a form. Here’s a small code with winform application to validate both IP address, …
A simple code that reads the IP addresses from the computer that runs our application and returns the one that’s not the loopback address. If a computer has several network cards, return from the method with the one you want by …