May 30
When you attempt to add an assembly reference to a Visual Studio project, the Add Reference dialog appears with a list of registered global assemblies in the .NET tab:

Add Your Assembly to Visual Studio
Unfortunately, adding your assembly to the Global Assembly Cache (GAC) does NOT make it automatically appear in the Visual Studio list of installed assemblies; you must add your assembly manually as follows:
Read the rest of this entry »
May 29
Sometimes you need to know which version of an assembly was loaded by your .NET application. The following code snippet makes it easy:
Read the rest of this entry »
May 22
Playing the default Windows sounds from C# used to require InteropServices and system calls. Fortunately, .NET 2.0 includes a new System.Media namespace with three classes that simplify playing system sounds and audio files:
Read the rest of this entry »
May 20
One of the things I miss about C++ is the #define keyword that allows you to create an abbreviated alias for a long type name. Fortunately, C# provides a way to alias a long namespace or class name while retaining full type-checking.
To alias a namespace or class name, use the using directive to define the alias as shown in the sample code below. Then you can use the alias anywhere you would normally use the class name or namespace. The scope of a using directive is limited to the file in which it appears.
Read the rest of this entry »
May 16
Developers for the Microsoft .NET platform are blessed to have three high-quality .NET magazines available to them: CoDe Component Developer Magazine, MSDN Magazine, and Visual Studio Magazine.
Why would a tech savvy software developer want to read a paper magazine when so much information is available online? Well, some of us “old timers” still appreciate the fresh smell and slick feel of a high-gloss monthly. Also, magazine articles are often produced by professional writers who explain subjects in greater clarity and detail than one may find on the Web. And there are times when a developer may not be connected, such as when riding the train, sitting in a meeting, or eating lunch.
Read the rest of this entry »
May 08
If you use images in a .NET application, chances are you will find it more convenient to embed those images as resources in your project, rather than leaving them as separate files and trying to locate and load the images from disk when the application runs.
Read the rest of this entry »
May 02
The DoDragDrop method on a control is synchronous. This means that when you call DoDragDrop to start a drag operation, the program will not return and execute the rest of your handler code until the user 1) drops the data she is dragging, or 2) cancels the drag operation. This is one of those little facts that you need to file away in your brain, as it could have a profound effect on your drag & drop logic.
Read the rest of this entry »
Apr 24
Microsoft has released a beta version of the next major release of Visual Studio and the .NET framework.
Visual Studio “Orcas” will enable developers to write programs that can run on Windows Vista, Longhorn Server, Office 2007 and the Web. The .NET Framework v3.5 will provide better support for Web 2.0 and AJAX applications. Microsoft has been planning to release Orcas this year, but a corporate VP recently told ZDNet that it may not happen until 2008.
Read the rest of this entry »
Apr 24
Typically when you press the Enter key while typing in a TextBox control, you will hear the computer beep.
To prevent this beep, handle the Enter key in the KeyPress event, and set the Handled property to true. For example:
Read the rest of this entry »
Apr 24
The default WordPress blog title “Hello, World” seems appropriate for the debut article of a software development blog, so I’ve decided to keep it.
I never thought I would write a blog. Adding to the 175,000 new blogs on the Web each day didn’t seem like a worthwhile endeavor. What could I possibly say that hasn’t already been said? But then I realized that at least once a day I learn a new tip or trick that could possibly benefit someone else. Many times I’ve found the answer to a tough problem from some generous soul on the Web, so I wish to repay the favor. Plus I suppose I have a story to tell that software developers and entrepreneurs may find educational, if not entertaining.
Read the rest of this entry »