December 27, 2005
DesignMode not working
In the development of a control, I was having a problem when checking to see if the control was running at design time, or run time. You're supposed to be able to check the DesignMode property of the Control base class to know, but this wasn't always working.
Instead, I gen'd up the following class to do the DesignMode check:
Public Class VSHost Public Shared Function DesignMode() As Boolean If AppDomain.CurrentDomain.DomainManager IsNot Nothing Then Return AppDomain.CurrentDomain.DomainManager.ToString. _ Contains("Microsoft.VisualStudio.CommonIDE") Else Return False End If End Function End Class
Great library of stock business images
This is great.
December 23, 2005
Column not showing up in Table Adapter
I'm really loving the new Table Adapters in Visual Studio 2005. They've eliminated any need I have for coding up a data access layer, or using things like the Data Access Application Block, for a number of stand-alone apps that I'm working on. But I did get bit by a simple issue the other day. I had a database, and it contained a column named "Step". When I generated a Table Adapter for this, the Step column was not showing up in the resulting typed data table. This made sense, because Step is a reserved word in VB.NET (one would assume that you'd have the same problem in C# with a column named "using", for example.) I was about to file a ladybug, when I decided to go back and dig a little deeper. Some little voice in the back of my mind was trying to remind me of something, but what?
It turns out that in these cases, the column name in the data table will be prefixed with an _. So accessing the column becomes MyTable._Step. Time to up the dosage of Ginko Biloba, I guess. I'd run into this same issue years ago, and completely forgot about this behavior on Typed Datasets.
December 21, 2005
It doesn't get much better than this
Free online classes from Microsoft. There are 6 classes on VB.NET, and 9 on ASP.NET. If you know shops that are trying to figure out how to get from VB6 to .NET, want to learn more about VB 2005, or want to get up to speed on ASP.NET 2.0, then let them know about this.
You have to register by Jan 5th to get in for free. But, you can take the course within 90 days of registration.
December 16, 2005
For no apparent reason, three things that I've been working on for a while came to fruition this week.
Easily Write Custom Gesture Recognizers for Your Tablet PC Applications - The one where I show how you can build custom recognizers using (of all things) some pretty simple regular expressions.
Windows Presentation Foundation Interoperability - Mike Henderlight and Parimal Deshpande give some great information about how WPF will interoperate with Windows Forms. Bottom line - don't expect a migration wizard.
What's in Visual Basic 2005 for the Visual Basic 6.0 Developer - Even if you're not a VB6 developer, it's worth a look just for the videos embedded in the article (think of them as tutorialettes).
December 15, 2005
Article on using Regular Expressions to recognize custom Tablet PC gestures
My article on using Regular Expressions to recognize custom Tablet PC gestures is up on MSDN. This proved to be a relativly simple way to detect custom gestures. Check it out.
Multi-Threaded Programming Made Simple with Transactional Memory?
Microsoft appears to be thinking a lot about how to make it easier to write multi-threaded applications. This is driven largely by the fact that the free lunch is over, and to utilize the hardware that your users have, you're going to need to use threads effectively. The problem is that writing solid multi-threaded code today is near impossible.
One thought path in Microsoft involves making everything a transaction. After all, nothing handles concurrent operations quite like a database, and it does so in a way that you never really have to think about threads and synchronization logic. What if a variable in memory worked like an item in a database? What if the framework handled the synchronization logic for you, automatically?
Paul Vick and Erik Meijer hinted at this at the end of this interview, and Joe Duffy has written more in MSDN Mag. It also looks like Tim Harris is spending time at Microsoft Research working on this, and has been thinking about this for quite some time.
December 13, 2005
Killer interview on Windows Presentation Foundation (Avalon) and Windows Forms Interop
December 09, 2005
Disappearing over the horizon
VB6 continues to receed over the horizon, as Microsoft announces that it will no longer be available from MSDN Subscriber downloads. Assuming you still need it, get yours now, because when it's gone, it's gone.
VB6 always reminds me of Voyager, shot out of Microsoft with escape velocity, it continues on a trajectory out of the software development solar system.
December 08, 2005
Controlling the appearance of disabled controls
You can set a lot of appearance attributes for Windows Forms controls, but control is essentially lost when you set the enabled property of the control to false. Essentially, the control has some default disabled look, and without custom code, you're pretty much stuck with that. This article, by Eric Moreau, shows how to control how controls appear, when they are disabled.