How to open a new window in windows form application?

Vb .net windows form: making window inactive?

  • i have a window and a dialog box from that window. how do i make the original window inactive once the dialog box has been opened and active again once the dialog box closes?!

  • Answer:

    If you call another dialog from a Form (frmMain) I usually do the following: Me.Enabled = False frmMain.Show() Just make sure when you exit out of frmMain you set the calling forms Enabled to True again. Or frmMain.ShowDialog(Me) This will keep the dialog in focus until you close it. Sometimes returns errors when you exit the dialog.

entoy at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

I'm pretty sure that the dialogue box does that on its own. But maybe thats only in visual basic.

earlsquareling

Call the ShowDialog method on the form and not Show. I beleive it may take a parent form be sure to send that in if it requires it (sorry no syntax in front of me) similiar to MyDialogForm.ShowDialog(Me)

MC Nat

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.