Check this post for sample to do that.

EDIT: Forget it, I see it from CodeProject and therefore assumed source code is attached.