c# - Common factor with radio button/textbox/combobox/datetimepicker -
I have many controls, each control with a different number of controls. I control the "value" of each control name And want to serial the XML with the control "state".
This will be textbox for a textbox. Text, there will be radioactivity for a radio explosion. Check, for a datetime picture, this will be a date-time picture. The original Is there any general factor or "state" in a different way to get these different words in no ordinary way?
It is not so, and for good reason - all those data values are different types, And defined by the child class (hence they are not defined by a common interface).
For the argument, suppose that is one way to get that value (say, as a function: object getValue (control control) ). If you want to use the return value of this function, you have to use a case statement to get the type and use it correctly! Just a case statement
Comments
Post a Comment