Windows Forms 2.0 Programming (Microsoft .NET Development Series)
One of the big features provided by MFC is the ability to automatically generate basic application frameworks out of the box, including both SDI and MDI applications. However, Windows Forms 2.0 has evolved well beyond Windows Forms 1.x to provide more of the fundamental elements you need to match the default MFC-generated output from a functional point of view. Additionally, several components covered in this book make it that much easier. To compare Windows Forms with MFC, I set out to create a Windows Forms equivalent of a vanilla MFC wizard-generated MDI text editor application, using what was available in .NET, Windows Forms, and this book. The result is shown in Figure B.9. Figure B.9. A Windows Forms Equivalent of an MFC-Generated MDI Application
To create this application, I drew on the following pieces provided by Windows Forms, .NET, and this book:
To pull these pieces together, I had to provide additional configurations and custom code:
Overall, I wrote just over 200 lines of code and 2 lines of post-build event script, to make it all work. Although MFC wins on the no-code front, if you start with the samples provided with this book, you should be off and running when starting your SDI or MDI document-based Windows Forms applications. Also, when I was finished with the Windows Forms version of my MFC-like application, I gained access to several orders of magnitude more functionality in the .NET Framework Class Libraries than was ever provided in MFC. |
Категории