Disable Button On Existing Form From another Form

microcephalic

Newcomer
Joined
Nov 6, 2004
Messages
16
Here's my problem:

I have 2 forms, form1 and form2. I launch form2 from a button within form1. I then want to be able to disable a control (command button in my case) on form1 by clicking a button on form2. So, how do I talk to the existing form1 from form2 without creating a new instance?
 
Figured it out:

on command button in form1:

Dim f As New form2
f.Owner = Me
f.ShowDialog()

on command button in form2:

Dim f As New form2
f.Owner = Me
f.button1.enabled = false
 
Back
Top