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
testname123
0
Newbie Poster
Recommended Answers
Jump to PostAdd 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 …
Jump to PostDo you have a "Button1" on your form or did you name it something else?
Please post your code.
All 9 Replies
brylle
-2
Junior Poster in Training
brylle
-2
Junior Poster in Training
TnTinMN
418
Practically a Master Poster
testname123
0
Newbie Poster
testname123
0
Newbie Poster
brylle
-2
Junior Poster in Training
TnTinMN
418
Practically a Master Poster
Denden17
-1
Newbie Poster
testname123
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.