1 / 7

CST238 Week 8

CST238 Week 8. Questions / Concerns? Announcements Check-off Take Home lab#7 GUI Bloopers presentations (#5&#6) New topics Printing Richtext box Graphics / Entire Form WinForms User control WinForms using WPF control No take home lab. Wor k on final project

stan
Télécharger la présentation

CST238 Week 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CST238 Week 8 • Questions / Concerns? • Announcements • Check-off Take Home lab#7 • GUI Bloopers presentations (#5&#6) • New topics • Printing • Richtext box • Graphics / Entire Form • WinForms User control • WinForms using WPF control • No take home lab. Work on final project • Coming up in Week 9, Week 10 & Finals week: • Week 9: No class. Take home test available on Sunday 5/25, due on Wednesday 5/28 at midnight. Work on final project. • Week 10: GUI Bloopers presentations (#7 & #8), project work day, no additional labs or topics covered. • Finals Week: project demo in class & pizza party. • No office hours / lab on Saturday (holiday weekend) but available for questions online or by email.

  2. Printing • Using System.Drawing.Printing; • PrintDialog • PrintDocument • PrintPage event • BeginPrint event • Richtextbox demo • Print Form demo

  3. User Controls • Control made up of other controls • Building a user control is very similar to building a form • Enables consolidation of common UI • User control can only be used in the project where it’s defined. • If you want a library of controls that you can reuse, then you need to build a custom control. • One reference: http://www.codeproject.com/Articles/2016/Writing-your-Custom-Control-step-by-step

  4. User Control • Add a user control to the project. • In Tools->Option->Windows Forms Designer: • Set Automatically Populate Toolbox to true. • Look for the user control in the toolbox. • Add it to the form. • Demo

  5. Incorporating WPF Controls • WinForms & WPF interoperability. • You can use WPF controls in WinForms. • You can use WinForm controls in WPF apps. • This is done through ElementHost

  6. WPF • Windows Presentation Foundation • Advantage of WPF • Greater degree of control over layout and appearance with WPF. • UI, data binding and events can be specified in a XML file (XAML) • Same XAML specification can be used for Windows Apps and Web Apps. • Richer UI content support for videos, 3D, animation, etc. • Walk through tutorial: http://msdn.microsoft.com/en-us/library/ms752299.aspx

  7. WPF Control Demo • Create a Windows Forms Project • Add a WPF User Control project in the same solution. • Build the WPF user control using designer & XAML editor • Build the project. • Add a ElementHost to the Windows Form and select the WPF user control just created.

More Related