Custom control "invalid property value" dialog

  • Thread starter Thread starter Mark Ingram
  • Start date Start date
M

Mark Ingram

Hi, ive written a custom control and i would like to display the
"invalid property value" dialog box for certain properties on my form if
the user enters a value outside the allowed range (in the visual studio
designer).


e.g. If i had a percentage property, i would want the user only to be
able to enter Int32 values between 0&100. How can i do this?
 
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.
 
Stoitcho said:
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.
which exception? ArgumentException?
 
Stoitcho said:
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.

Throwing an Exception and ArgumentException both worked great, thanks!
 
Doesn't matter what kind of exception you throws, whatever make sense in you
case.
 
Back
Top