Welcome to MSDN Blogs Sign in | Join | Help

December 2004 - Posts

Raymond has an interesting post on the history of boolean across different APIs. Because each different kind of boolean has a different size/interpretation for true/false, when writing a p/invoke definition it's important to use the MarshalAs attribute Read More...
Continuing on from last time ... Now that we've got Painting, Mouse handling up to speed, it's time to build a test application. After adding a Square to your control, add these few lines in OnLoad (or after initialize component) PropertyGrid pg = new Read More...
Specifying interesting datatypes in the DefaultValue attribute Ok so last time we got off easy with a boolean property – what about something more complex – for example a Color? How can that be specified? The DefaultValueAttribute has another overload Read More...
Debunking a common misconception There is a lot of confusion around the DefaultValue attribute - it feels like it really should setup the initial value of the property. Unfortunately, this is not the case. It’s used to determine whether the property should Read More...
Andrew - yet another windows forms groupie - has just joined the world of the blogging. Can't wait to see what he's got to say. Read More...
Continuing on building our custom control ... Handling Mouse Movement Lets add some pizzazz to the square – it seems too stale. When we enter the square, let’s draw a dark rectangle around the outside, and when we leave let’s erase that border. In order Read More...
Continuing on from last time .... A grey square on a grey form is not very interesting…. Lets add some paint. I’ve talked a bit about painting before in Painting Best Practices , but we’re going to do it for real this time. We’re going to paint red, yellow, Read More...
Creating the Square control Creating a custom control in windows forms is very simple – there are a few gotchas along the way – so I thought I’d make a sample control called “Square” to walk through it. The square will obviously have sizing restrictions, Read More...
One of the harder things to decide when you're starting out building a custom control is what to derive from. There are a couple different layers to the control hierarchy, and it's not always clear what to derive from. Base class What it adds When to Read More...
 
Page view tracker