I've got a program installed here which has a form which people can fill out. One of it's drop down boxes allows you to select a value from either "default", "none" or you can enter a value from 0 to 100 in it (for a percentage).

I want to expose ths field from a class I'm writing, so when a class instance is created, this value can be set & a method called to fill this entry in the form.

What is the best / most professional way of exposing something like this which can allow multiple data types? I don't really want to expose this as a string if I can help it to minimize the chance of a wrong figure being specified.

VB Code:
  1. Public Structure xyz
  2.     Public _default as boolean
  3.     Public none     as Boolean
  4.     Public Percentage as system.web.ui.webcontrols.unit
  5. End Structure
  6.  
  7. Public Enum xyz
  8.     _default     = 0
  9.     none         = 1
  10.     _1percent    = 2
  11.     _2percent    = 3
  12.     ...
  13.     _100percent  = 102
  14. End Class
These are about the only ways I can think of, neither of which look any good! Can anyone recommend how I could do this please?

Thanks!