esmail (8) [Avatar] Offline

On page 394 it says we can't resize PhotoEditDlg since
it inherits its size from BaseEditDlg.

I have

public class PhotoEditDlg : MyPhotoAlbum.BaseEditDlg

in my source file, so I am doing the inheritance.

However, when I am in design view I can resize the
form ... so, I'm a bit confused.

What am I missing here?


eebrown (89) [Avatar] Offline
Re: resizing PhotoEditDlg - it works, but why?

The problem is that the Base form, in this case BaseEditDlg, has controls which are private. In chapter 9 (around page 267), we created these buttons and other objects on the base form.

In the inherited form, PhotoEditDlg, the position of these controls cannot be modified. So while technically we can change the size of the form (as you saw), practically it does not work very well since the base controls do not move.

Of course, you could alter the base form to make the buttons protected, or by setting their Anchor properties so they move as the form is resized. In a production environment you cannot always do this since the base form may be some standard form that your project is using. I had this in mind when I set up the base form, which resulted in these restrictions in chapter 12.

Let me know if you have further questions.

esmail (8) [Avatar] Offline
Re: resizing PhotoEditDlg - it works, but why?
Got it, thanks Erik, the wording threw me off.

Incredible how much there is to learn. I look forward
to when your next book comes out. I hope there will
be an announcment here.


eebrown (89) [Avatar] Offline
Re: resizing PhotoEditDlg - it works, but why?
Yes, it is a bit daunting. I'm still uncovering pieces, and Whidbey just makes it harder smilie.

I'm sure we'll announce a book update here. The .NET 2005 release is probably a year away, so it will be a while. You can also sign up for emails of Manning press releases from the main page.