First of all this question not one of those: “if I do not get an answer to my question then my application will not work, and the word will end” situation. It is in the “There has to be a better way” category.
Ok here goes I have some screens/forms that have some ‘repeating’ code in them and I am looking for a better way of laying out the code. Example:
Is there some way to write something like:
I suspect that there is, but I have yet to learn it.
BTW this is the 2008 (3.0) version of vb.Net
Lion Crest Software Services
Anthony L. Testi
President
Ok here goes I have some screens/forms that have some ‘repeating’ code in them and I am looking for a better way of laying out the code. Example:
Code:
Me.Route_Type1.Combobox_Populate()
Me.Route_Type2.Combobox_Populate()
Me.Route_Type3.Combobox_Populate()
Me.Route_Type4.Combobox_Populate()
Me.Route_Type5.Combobox_Populate()
Me.Route_Type6.Combobox_Populate()
Me.Route_Type7.Combobox_Populate()
Me.Route_Type8.Combobox_Populate()
Me.Route_Type9.Combobox_Populate()
Me.Route_Type10.Combobox_Populate()
Me.Route_Type11.Combobox_Populate()
Me.Route_Type12.Combobox_Populate()
…..
Is there some way to write something like:
Code:
For Each rt as Route_Type in Me
Rt. Combobox_Populate
ENDFOR
I suspect that there is, but I have yet to learn it.
BTW this is the 2008 (3.0) version of vb.Net
Lion Crest Software Services
Anthony L. Testi
President