views:

188

answers:

2

How can I disable the parent form when I call a child form?

This code doesn't disable the parent form like I thought it would:

frmChild.ShowDialog()
A: 

By disable, do you mean just prevent the user from clicking anything in the parent form? If so, then .ShowDialog is the way to do it - it makes the called form Modal, so that it controls the application's focus until it's closed.

If you're looking to fade the parent window out or do something else to make it obvious that it can't be clicked in, that's more complicated.

Can you elaborate with some detail about what's happening that's not what you expect?

rwmnau
The parent form was still enabled and users could still use the controls.
Landmine
+1  A: 

You can use

frmChild.ShowDialog(Me)

Me - is a parent form

volody
Thank you Volody
Landmine