I've been writing a program in VB.Net that uses a form to pass information along to other classes and I have a question regarding my current code structure. I personally don't like the various controls in the form to be exposed for other classes to change at will, so I'd prefer to use read-only properties of those controls for the classes to get their information. The trouble is, the properties have ended up taking a lot of space in the form's class and, I feel, is making it unwieldy and harder to read. Are there any standards/is there any advice regarding this that I could follow?
To help clarify, I'd much rather use, for example,
MsgBox(MyForm.PartNumber)
'Or
MsgBox(MyForm.PartType)
instead of
MsgBox(MyForm.PartNumberTextBox.Text)
'Or
MsgBox(MyForm.PartTypeComboBox.SelectedItem.ToString())
As the former properties look better (IMO) and the latter can risk things like
MyForm.PartNumberTextBox.Value = "Something else"
Any suggestions/responses would be appreciated.