Question:

Visual Basic.NET 2005 question?

by  |  earlier

0 LIKES UnLike

I want to make a button visible after I close a form in an MDI...does anyone know how I would do that. so far I have:

If aChildTwoForm.Close Then

childOneToolStripButton.Enabled = True

Else

childOneToolStripButton.Enabled = False

End If

but I'm getting an error that says, "Expression does not produce a value."

 Tags:

   Report

2 ANSWERS


  1. childOneToolStripButton.Visible=True


  2. "Close" is a procedure that does not return a value, like a command, therefore you cannot test if it is True or not.

    Depending on how you close your form you should check to see if it is "Nothing" and if it is "Disposed".

    Change this:

    If aChildTwoForm.Close Then

    To this:

    If aChildTwoForm Is Nothing OrElse aChildTwoForm.IsDisposed = True Then

    This will check to see if aChildTwoForm has not been created or if it has been closed.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.