So I have a main form and 5 other forms. When I press a button on the main form, I want it to open Form2 and disable a certain button in form2 so that it cannot be used. I produced this code but the button is still active and there is no effect. Please help.
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
My.Forms.Form2.SaveVISACaseButton.Enabled = False
My.Forms.Form2.SaveVISACaseButton.Visible = False
Dim form2 As New Form2
My.Forms.Form2.SaveVISACaseButton.Enabled = False
My.Forms.Form2.SaveVISACaseButton.Visible = False
form2.Show()
Me.Hide()
End Sub