Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulate a button on another form

Status
Not open for further replies.

CSpannos

IS-IT--Management
Mar 21, 2001
32
US
Hello,

I am trying to change the properties of a button on form1 from form2. The button on form1 is a toolbar button. When it is pressed, I have it set to "ButtonToolbarNew.Enabled = False", to disable it. I want to be able to re-enable it when a different button on another form, form2, is pressed.

Thanks again!
Kosta
 
Code:
Private Sub btnClickMe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
        Dim form2 As New Form2()

        form2.Show()
        form2.Button1.Enabled = False

        form2.Text = " This is Form 2"
        Me.Hide()
    End Sub
Hope this helps
 
Hello,

First off, thanks for the reply. I tried this, but the problem is that a new Form2 appears with Button1 enabled. The old one is still behind the new one with Button1 still disabled. Also, Form1 is the MdiParent of Form2, so I really cannot be opening and closing copies of it.

Is there something else I am missing?

Thanks,
Kosta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top