How to avoid a listview flickering?

Giovanni Montrone wrote in his Code Project article that the best way to avoid listview flicking is forcing it to use DoubleBuffer. He provides a new listview control that inherits from the classic one and adds a new method called SetExStyles() which allows setting the extended styles of the listview.
But I found a comment from Gabriel Szabo explaining how to have the same result without sub classing any control, but using Reflection :

PropertyInfo aProp = typeof(ListView).GetProperty("DoubleBuffered",
BindingFlags.NonPublic | BindingFlags.Instance);
aProp.SetValue(lvwControl, true, null);

(when lvwControl is the name of your listview control)

Many thanks Gabriel !!

Get the local DNS server list and keep it up-to-date

Few days ago I was writting an application querying DNS for MX record. Trying to optimize it, I realize I could use the DNS specified for the local computer instead of using a hard-coded one. Then I wonder how to get this DNS server list and, most important, how to keep it up-to-date. Because changing of wi-fi hotspot makes my IP settings (IP Address, Subnet Mask, and… DNS servers) change.
Read more Get the local DNS server list and keep it up-to-date

How to debug your Windows Service ?

Debugging a windows service might be a little bit hard. Because each change in your code implies to uninstall/reinstall the service. A way to avoid this issue is to launch the service from the command line. Then you will be able to add breakpoints in your source, even in the OnStart method…
Read more How to debug your Windows Service ?