none
MODAL - A READONLY PROPERTY RRS feed

  • Question

  • I want a form to be appearring as a modal one but upon click of a button toggle to non-modal for interaction with the active worksheet but again be modal when focus returned to it. Have found the property to be read only thus not allowing Form1.Modal = False or Form1.Modal = True.

    What could be the best way.


    Best Regards, Faraz A Qureshi

    • Edited by FARAZ A QURESHI Saturday, August 10, 2013 9:46 PM Correct & Complete Question
    Saturday, August 10, 2013 9:43 PM

Answers

  • Hi Faraz.

    We can not change form.modal as you said.

    I’d like to provide you a workaround for your reference:

    First, you could show a modal form, then close the modal form in a click event.
    The click event in the modal form:
    privatevoidbutton1_Click(objectsender, EventArgse)
            {
                this.Close();
    }
    After handling something in the active worksheet show the modal form again.
    Show modal form what you defined:
    TestModalmyForm = newTestModal();
    myForm.Text = "My Form";
    myForm.SetBounds(300, 300, 500, 500);
    myForm.ShowDialog();

    George Hua
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 14, 2013 3:19 PM
    Moderator