locked
Custom Control and Designer support RRS feed

  • Question

  • User56700650 posted

    I've been building some custom controls for a while now but still can't figure something out.
    A lot of my controls won't show anything in the designer.

    I always get null reference exceptions.
    However, in the property window and when I run my app I don't have any issues.

    Any ideas as to how I can debug my control in the designer?

    Saturday, July 19, 2008 2:28 PM

Answers

  • User-16411453 posted

     Render and run time are 2 different modes of operation.. You can detect design mode, and load a separate set of code just for Design Mode, so you can set your properties. What you decide to paint to the screen in Design mode is clearly up to you.

    In design mode, I have to call the render method manually

    control.Render(writer) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 22, 2008 7:42 PM

All replies

  • User1880761892 posted

     Are you overriding the render sub? 

    Tuesday, July 22, 2008 2:38 PM
  • User-16411453 posted

     Render and run time are 2 different modes of operation.. You can detect design mode, and load a separate set of code just for Design Mode, so you can set your properties. What you decide to paint to the screen in Design mode is clearly up to you.

    In design mode, I have to call the render method manually

    control.Render(writer) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 22, 2008 7:42 PM