views:

17

answers:

1

I am developing an app for Windows Mobile 6 and there is a CameraCaptureDialog class that enables me to call a camera app from my own application. The class has an Owner property that most examples on the internet set to "this".

cam.Owner = this;

What exactly does this do? I've seen a similar scenario with Windows Forms components/controls by setting the Parent control. In that case I guess it's used only for layout algorithms, but other than that, is there any useful purpose?

I don't see how setting an owner of the CameraCaptureDialog can (and actually does) make any difference.

Any insight would be appreciated.

A: 

The dialog is modal, and it needs to know who it's owner is so that if the owner is shown, the modal dialog lies above it. If you set it to "this" then it's modal over your Form. If you go to anotehr app it will hide, but if you bring your app back, the "this" Form will get displayed and the modal dialog will show over it.

ctacke
It makes perfect sense, if only documentation was that clear about it.
kornelijepetak
Well, it seems that the MSDN documentation contains a remark that explains this, but only at Form.Owner. The documentation for CameraCaptureDialog.Owner does not contain that info.
kornelijepetak