September 2007 - Posts
This article leverages the power of .NET TypeConverters to solve several vexing enumeration problems.
This article describes the developement of the UserControl DevicePanel for displaying DirectX-content. You can use the Control to drag it on a Form in VS 2005 designer and render your DirectX-scenes in it. Bind the events mentioned in the article to have a starting-point for your rendering routines. The control is not a wrapper around the DirextX-library, it is only a helper for getting you started. The assembly and a small tutorial based upon the first tutorial of the Microsoft DirectX SDK (9c) can be downloaded from the Member Tools-section.
Most applications written today accept command line arguments of some form. Sometimes we only need to parse the command line for file names that should be opened upon starting the applications, and at other times we need to process a large amount of various options controlling the way our application will execute. Most of us have written some code to process the command line arguments passed to an application at some point during our careers. This is tedious work, and it is easy to make mistakes that lead to errors when further executing our application because we forgot to validate some combination of options or values.
Several libraries exist that provide methods to perform the parsing of the command line and allow us to retrieve the specified options in a (sometimes not so) simple way. In UN*X environments, that usually utilize command line arguments quite heavily, the getopt[2] library. As I discovered recently there is actually a port of this available for C# as well, called "GNU Getopt .NET"[5]. Several projects are also available from Code Project. However, either the libraries available were not full featured enough for my preference, or I simply did not like the syntax they provided for using them, so I decided to roll my own command line parser. This article describes this library I made in a tutorial format which highlights most of its features.
Determining function names dynamically can simplify your debugging and trace logic as well as ensure that your trace messages match the actual code that generated them. All you have to do is wrap all your calls to Trace() with your own custom function. This utility function then can reference the stack frame to find the name of the function that called it.
This tutorial is about alphablending, a very nice effect of opacity. I combined it with 2 light sources, that can be separately enabled by the user. The tutorial is based upon the Meshes-tutorial, so I will only comment the changes I made to use alphablending for the cube.
The Grouper is a special groupbox control that is rounded and fully customizable. The control can paint borders, drop shadows, gradient and solid backgrounds, custom text, and custom icons. The purpose of this control was to design a better looking groupbox winform control. I used the Keep it Simple Stupid philosophy to design a tightly knitted re-useable control that I hope you all enjoy. This control is still in beta version, but it seems to be stable.
This article describes how to build a WebService with .NET and use Generics in this WebService to transfer a list of complex datatypes. A WebService can be used in a WinForms-client and in a Web-client as well. In our example a list of Person-objects is bound to a GridView in an ASP.NET-project and to a DataGridView in a WinForms-project. The goal of this article is to demonstrate, how you can use a WebService with two different type of views: WinForm and WebForm.
Recently a friend of mine who has just started a company pointed me at this site which does lots of fancy image editing. Although he doesn't know XAML or Silverlight he reckoned some of the stuff they were doing was excellent, and asked me to look into doing something similar in WPF. While this article represents only a small portion of what that website can do (namely image cropping) I feel that it outlines some useful techniques and study notes for those of you that may end up trying to do image editing applications in WPF/Silverlight. Although I cannot categorically state that 100% of this article will work with Silverlight as it has really been written in WPF, I am waiting to play with the managed version of Silverlight v1.1. JavaScript leaves me cold (nasty stuff). So after I've had a play with that I should be able to write WPF articles that I know will work with Silverlight. Till then, I'm afraid if you want a Silverlight version, you'll just have to try a code port for yourself.
In this short tutorial I will show how to work with a component of the .NET-Framework 2.0 I like very much: The FileSystemWatcher. This component watches for changes in the FileSystem and fires events on: Rename, Change, Creation and Deletion of entries in the filesystem (Files and Folders).
Although a lot of database work in many web applications involves single table queries and changes, in many cases you make multiple changes to a database. In these cases, you should consider using transactions. A transaction defines a unit of work to be performed, and for the transaction to complete, each part of it has to complete successfully. If everything works, the transaction is committed to the database. If not, all the changes are rolled back. You also have the option to nest transactions, in case you have a very complicated unit of work that is broken into "sub-units" of work.
This article shows the functionality - or a part of it - of Spy's Find Window. The user has the possibility to drag the mouse over a region on the screen and the found window is highlighted by a blue border that is drawn around the found region.
Recently, I ran across an issue where I needed to control the background color of the selected items in a Windows Forms ListBox control. Imagine my surprise when I discovered that not only was such a capability not present in the properties, but that the authors of the control seemed to go out of their way to make it difficult to do so. It may be that they had valid reasons for doing it this way, but I fail to see them. That being said, this is the solution I found. It is simple and straightforward, but took a little time to track it down.
Purpose: To make it easy to have panels which can be docked to the left, right, top, and bottom. It should be easy to add this control to the program and easy to understand how it works, so everybody who wants can adapt its features to his needs. The article is addressed to people who have already read and worked with a starter book about C# such as MS Visual C# 2005 Step by Step so maybe 'C# experts' will find it too overdone in explaining different parts.
I built the Superlist control whilst developing an RSS reader called FeedGhost. Although there are plenty of commercial grouped list controls available I wanted to have total control over the code and of course its usability. Superlist supports drag drop column customisation, grouping as well as handling thousands of entries smoothly. It's also highly customisable if you want to change its look and feel. In this article I'll explain how to use and extend the control in a demo project. If you download the source, you can find demo project under the Tests/SuperListTest directory.
In the past, making a form into a custom shape could be a daunting task. However, the .NET Framework provides easy and straightforward methods to perfect the look of your form.
Next page »