Notes 1.0 KB

1234567891011121314151617
  1. Random things to look out for when writing or using
  2. code in Managed.Windows.Forms
  3. ===========================================================================
  4. * Don't do anything that causes the <control>.DeviceContext to be recreated
  5. when inside the drawing routine. Chances are the drawing routine was
  6. passed <control>.DeviceContext. If an event, for example a resize, that
  7. causes <control>.DeviceContext to be recreated, is initiated by the
  8. drawing function, the Graphics object passed to it will no longer be valid.
  9. Remember that resizing a control results in recreating <control>.DeviceContext
  10. and this in turn results in destroying the old <control>.DeviceContext.
  11. * If you're implementing a theme and you need to know about certain states
  12. of the control, you have to access the internal variables of the control
  13. to get those states. We should probably expose those vars that are used
  14. by themes as properties. We'll watch which are needed and 'propertyize'
  15. them.