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.
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?VB Code:
Public Structure xyz Public _default as boolean Public none as Boolean Public Percentage as system.web.ui.webcontrols.unit End Structure Public Enum xyz _default = 0 none = 1 _1percent = 2 _2percent = 3 ... _100percent = 102 End Class
Thanks!




Reply With Quote