21.7. Summary

GUI programming typically encompasses writing applications with GUI front ends, such as two- and three-dimensional drawing applications, imaging, and printing utilities.

The classes of the System.Windows.Form namespace are used for writing applications with a GUI front end consisting of .NET GUI controls. Here are the main points you should remember:

  • The .NET GUI component library closely resembles the Visual Basic world of forms and events. GUI controls are assembled on a form and are connected using events triggered by user actions or by the system. Whereas Java Swing uses the classic model view controller paradigm to separate GUI components from non-GUI components, .NET forms do not provide any logical separation between GUI and non-GUI classes. This might tempt a beginner C# GUI programmer to mix the two types of components, thereby limiting the extensibility and modularity of the GUI application.

  • The Visual Studio .NET environment comes with a Form Designer that makes it trivial to cook up control-rich screens. This is useful for configuring tedious design-time GUI settings. The JDK lacks a built-in GUI designer, and that makes it tedious to rapidly put Swing apps together.

  • The default layout mechanism for the .NET Forms library is absolute positioning of the controls on the form. This means that the controls inside a container do not resize nicely along with the container. To overcome this, .NET introduces the concept of anchoring and docking. In Java AWT and Swing, the positioning of controls inside the container is relative to the container and is done using a suite of layout managers. Therefore, the controls resize automatically with the container without any extra steps.

The .NET GDI+ library allows for complex two-dimensional drawing operations.

  • Much like java.awt.Graphics and java.awt.Graphics2D, the System.Drawing.Graphics object is used for doing all the drawing operations.

  • GDI+ has built-in support for imaging and printing, much like Java's imaging and printing packages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.214.32