how to disable a button with another button in another form that hasn't been opened yet in visual basic 2008?

Recommended Answers

All 5 Replies

How do you propose to click a button in a form that has not yet been opened? And why would you want to?

Button_Click
    Form99.Button3.Enable = False

Is that what you want?

You can declare a private boolean variable and a public property like so:

Private buttonEnabled As Boolean = True

Public Property EnableButton As Boolean
    Get
        Return Me.buttonEnabled
    End Get
    Set(value As Boolean)
        Me.buttonEnabled = value
    End Set
End Property

Then in the form's load event handler place the following code:

buttonBeingManipulated.Enabled = buttonEnabled

To change the value create a new instance of the value on the form you are sending the command from:

    Dim f99 as New Form99

    f99.EnableButton = False
    'The button will be disabled'

well simply use this.

frmOne.button1.enable = false

Regards

THANKS, was creating a 'who wants to be a millionaire game AMEN

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.