PeterFrb
asked on
VB.Net: Changing control properties from outside the form
I sometimes need to set a form's control properties from elsewhere in the code, and I'm getting strange errors whenever I try. In my situation, I've created a checkbox that I want to change, but while running from withing another form. Here's a sample of that code:
With this code in place, the form won't open.
InvalidOperationException.png
Dim UseCheck As System.Windows.Forms.CheckBox = MyForm.MyCheckbox
With UseCheck
.Checked = False
.Enabled = True
End With
With this code in place, the form won't open.
InvalidOperationException.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER