VB.NET - Getting Started with Custom Drawing
· ☕ 2 min read
Here I am going to show some basics of custom drawing in VB.NET. This is not production-class code, but rather a head start for those assessing whether or not it's feasible to custom draw anything (result vs effort). In this sample project, I will highlight all even items of a ListBox with LightGray color.

VB.NET - When not to use Relaxed Delegate Conversion
· ☕ 2 min read
Relaxed delegate conversion enables you to assign subs and functions to delegates or handlers even when their signatures are not identical. In practice, it means that the following code [...] Can be written like this ... If you don't need to use event arguments, such as in the above scenario, your code becomes much more readable by omitting argument clause. For developers coming from C# background - yes, everything will work here, even with `Option Strict On`. Everything, but one thing...

Hard Disk Sentinel - Fix real time disk monitoring
· ☕ 1 min read
Even though this issue has an official FAQ on this page, I decided to include these short instructions on my blog. Symptoms When you click on Disk Performance tab on any disk page, Hard Disk Sentinel says the following: Real time performance monitoring is not supported on this disk Here is how it looks: Solution Works for me most of the time (Windows 7 x64): Start cmd as Administrator.

VB.NET - The right way to read command line args
· ☕ 4 min read
While it may appear to be a simple question, there is really more to it. Please read this article carefully, even if you believe you know how to handle this situation. And especially if you have been writing command line utilities for 10+ years and never encountered any issues using standard .NET functionality. Approaches you may be thinking about at the moment, which are often suggested at forums, unfortunately, do not work:

VB.NET - Zip and Unzip String using GZipStream
· ☕ 2 min read
I tested this on HTML pages and it appears to be not the most efficient. In one of the examples, ~140K down to 44K. In comparison, Total Commander can zip down to 27K at the average compression level. But even with minimal compression the file remains at 32K.

Migration issue of MainMenu to MenuStrip
· ☕ 1 min read
Suppose you were lucky to find this article and already resolved all your compile time errors. I found an issue that may require redesign of your application, even though everything else appears to be working fine. I’ll put it straight: MenuStrip/ToolStripMenuItem pair is not 100% backwards compatible with MainMenu/MenuItem. One particular thing is how keyboard shortcuts work. In MainMenu concept, triggering a shortcut by pressing a hotkey combination causes .NET framework to open the corresponding menu under the hood, process Popup event and only then click the MenuItem.

Dual HexaCore Xeon E5649 performance in HP DL380 G7
· ☕ 1 min read
First benchmarked using latest Passmark. Then did some tests with latest Aida64. What's interesting here is that both processor and memory speed keeps fluctuating. I have not found a good explanation for this behavior.

Edit XML using Powershell
· ☕ 1 min read
Because there is no easy/built-in way to edit XML using Powershell, I wrote a script that can change parts of XML documents. I used it for bulk edit of connections in Remote Desktop Manager, to change some values in RDP session over dozens of servers. You can modify it for your needs - in simple cases you would only need to change `ArrayOfConnection` to your document's root.

.NET Winforms - App loses focus when a window is closed
· ☕ 1 min read
I have a main form which is an MDI parent and a modal form, which is a progress dialog. When loading is completed, an MDI child is opened. If it cannot be completed, an error message shows up with user prompt. Problem is if user takes action, and the modal form is closed, the focus is switched to the application, which was active before my application was started. In my case it was Visual Studio 2010.

Mushkin SSD in an HP ProLiant DL380 G7 server
· ☕ 1 min read
Hardware: HP ProLiant DL380 G7 Mushkin Enhanced Chronos SSD - 2.5” 240GB SATA III MLC (MKNSSDCR240GB) (RAID1) 2 x Seagate Savvio 10K.5 hard drive - 300 GB 2.5” 6Gb/s SAS 10000 rpm 64 MB Buffer (ST9300605SS) Benchmarked with CrystalDiskMark 3.0.1 x64 on Windows 2008 R2 Std + SP1.