May 2009 Blog Posts

WinForms bug: NodeMouseDoubleClick event in TreeView will sometimes have the wrong node in EventArgs

Here's a strange bug I've encountered today in a WinForms application. Usually, double clicking on a collapsed tree node (which obviously has child nodes) will expand it. Most of the time when we need something to happen when a child node is double clicked, but not the parent, we write something similar to: 1: void NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) 2: { 3: if (e.Node.Nodes.Count == 0) 4: ...

Smart Paste Add-In for Visual Studio 2008

Say you need to paste a chunk of XML (or WKT) into Visual Studio as a string literal (for your unit tests, or what not). How would you do it? In C# string literals can be represented in two ways: C# supports two forms of string literals: regular string literals and verbatim string literals. A regular string literal consists of zero or more characters enclosed in double quotes, as in "hello", and may include both simple escape sequences (such as \t for the tab character) and hexadecimal and Unicode escape sequences. ...

Awesome tip: make View Code default double click action on a WinForm control

Here is something I wish I'd known years ago - you can make the "View Source" action default when you double click on a WinForm control. Here's how: Right click any Form/UserControl file, and choose Open With… Select CSharp Editor, then press Set as Default ???? Profit! That's it! Now you won't break the keyboard when you accidentally double click on your MainForm.cs file.

(I'm crying) Amazon Kindle DX - the 10" PDF reader

Amazon just went ahead and announced the new Kindle DX - a bigger Kindle with native PDF support. The major difference is of course the size: the new Kindle DX has a 1200x824 resolution, and it is priced at $489. It is scheduled to ship at Summer 2009. Here are some additional details: Size: 10.43 x 7.23 x 0.383 (Kindle 2: 83 x 5.33 x 0.363 ) Display: 16 shades of gray eInk 9.73 1200x824 pixels (Kindle 2: 63 800x600) Weight: 18.9oz (Kindle 2: 10.2oz) ...

«May»
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456