We had a few new faces at the VB.Net meeting tonight. After a bit of social chatting, Jim Wooley started the meeting with a presentation of the FileSystemWatcher done in VS2005 Beta 2. For the sake of simplicity, we went with a Windows Forms applications. Take a form, drop on a ListBox and a FileSystemWatcher control. A FileSystemWatcher component basically does what it sounds like – it watches the file system for some file and some event. You can filter by file type (ex. *.txt) and you can filter by event (changed, created, deleted, etc.). With this really simple demo, we were able to see that the operating system raising events to our code. Something we did notice is that the OS throws several events where we might only expect one event. For example, open Notepad, type some text, and save it into your monitored directory. You’ll see that you get CREATED, DELETED, CREATED, CHANGED, and CHANGED events. So you’ll want to do error handling to prevent yourself from acting on the wrong one of those events. Extremely simple, but a great demo to show how useful the FileSystemWatcher can be.
The next presenter was Harrell Perlman, showing us Avalon. If you plan on taking a look at Avalon, you need to have XP service pack 2. Longhorn’s betas are not supported yet. You’ll also need a beta copy of VS2005 to work with it. Harrell had a heck of a time getting his Virtual PC installed with the WinFX and Avalon, so he spent a good deal of time making sure that we’d understand the installation procedure. WinFX is an extension of the .Net Framework that is utilized by Avalon (meaning that Avalon runs entirely on managed code). Avalon uses XAML (a flavor of XML) to describe the layout and ties to code behind classes for event wiring. We’re really early in the Avalon lifecycle (still Alpha) but there are already a wealth of articles discussing Avalon concepts. Download the Avalon, WinFX, and (possibly) the LongHorn SDKs, install them in a Virtual PC or Virtual Machine, and go! We took a quick look at a demo or two to see what the XAML markup language looks like. The general reaction of the group was that we didn’t really know where we were going with XAML. To me personally, it looks like the ASP.Net seperation of the presentation layer and the UI Process Layer.
Dan Bredy was presenting an article from Mike Gold (VBHeaven.com), recreating the W2 tax form. The program uses GDI+ to render the content of some textboxes and place them directly onto an image of an actual W2 form. Basically, set the background of a form to an image. Place a bunch of textboxes and checkboxes on the form. Then use the DrawString function to render the text directly onto the image (you basically can’t see the textboxes). This takes place during the print preview portion of the application. This makes use of the System.Draw.Graphics namespace to render the image and to draw the text from the various textboxes onto the image based on the location of the actual control.
— Matt Ranlett
posted with BlogJet