Can someone please tell me how to control a windows form from another form? I have one form (form2) which has a button. When this button is clicked, I need my other form (Form1) to hide a button. I know all the code except for how to make form2 access form1. It seems so simple, yet I cannot do it. Any help would be appreciated. Thanks
Jump to Post
Add a constructor to the form (call it Form2) that needs to hide the button on the first form (call it Form1). Like this:
Public Class Form2 Private ButtonToHide As Button Public Sub New(ByVal ButtonToHide As Button) Me.InitializeComponent() Me.ButtonToHide = ButtonToHide End Sub Private Sub Button1_Click(ByVal sender …
All 9 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.