This project has moved and is read-only. For the latest updates, please go here.

Inheriting from UpDownBase

Dec 16, 2011 at 5:25 PM
Edited Dec 16, 2011 at 5:26 PM

I tried to inherit from UpDownBase in my code

namespace StringTest {

public class StringUpDown : UpDownBase<string> {


 I did make the UpDownBase constructor public, the code compile but when I run my Test app the control doesn't show. 

I also tried inheriting from NumericUpDown to create an IntUpDown or DoubleUpDown just to test as these are controls that already exist, and I run into the same issue as above. any clues to what I am missing are greatly appreciated.


Dec 16, 2011 at 5:38 PM

You need to create a control template for your control and set the DefaultStyle property in the static constructor of your derived class.

Dec 16, 2011 at 8:49 PM

Thanks Brian, it worked.