Regarding your actual issue, for whatever reason the ComboBox type used in MyClass is referencing VisualStyleElement instead of System.Windows.Forms. This can be fixed easily by fully qualifying the name:
Alternatively, if the Visual Studio autocomplete incorrectly imported VisualStyleElement, you can replace it instead:Code:Public cmbChoice as System.Windows.Forms.ComboBox
Regarding what you're actually wanting to do:Code:'Imports VisualStyleElement ' Remove this line Imports System.Windows.Forms ' Add this line Private Class MyClass Public Yo as String Public lbName as Label Public cmbChoice as ComboBox End ClassThere's probably a better way of doing this, such as the built-in data binding feature, but to be honest I'd need a better example of what it is that you're trying to do in order to give you an accurate example. Not that you didn't give us a lot of information, I just don't fully understand the expected end result is all.with multiple controls needing to be assigned to one variable so they can all be altered or read with respect to that item




Reply With Quote
