SlideShare uma empresa Scribd logo
1 de 35
GUI Applications Development Using .NET Framework
Objectives


                In this session, you will learn to:
                   Work with menus and multiple-document interface applications
                   Implement the ToolStrip Control in multiple-document interface
                   applications
                   Identify the functionality of print components




     Ver. 1.0                        Session 5                           Slide 1 of 35
GUI Applications Development Using .NET Framework
Working with Menus


               VC# enables you to create menus and multiple-document
               interface (MDI) applications.
               In the Windows environment, you can use menus to
               enhance the user interface of an application.
               In VC#, you can create two types of menus:
                  The menus that appear on the menu bar
                  Context menus, which appear when the right mouse button is
                  clicked
                                      Context menu items can also
                                      You can add menu either at VC#
                                      To added to a items items to a time:
                                      be add menu form at design
                                                               run time:
                                      design timeeither rundesign time or at
                                                    or at at time.
                                      applicationthe MenuStrip control from the run
                                         1. Add
                                      time. Toolbox.at design time.
                                             Toolbox
                                      To add context menu for a
                                      control or a code toyou need to
                                         2. Write form, programmaticallyusing
                                             Append individual menu items add
                                      add the ContextMenuStrip
                                             ToolStripMenuItem
                                             the Menu Designer.objects to the
                                      control from the object. to
                                             MenuStrip Toolbox
                                      the form.
    Ver. 1.0                        Session 5                              Slide 2 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications


                • In VC#, an MDI application consists of two parts, an MDI
                  parent form and the MDI child form.
                • An MDI parent form is the form that contains all the MDI
                  child forms.
                • An MDI parent form can have multiple MDI child forms, but
                  it cannot be a MDI child form to another MDI parent form
                  simultaneously.
                • An MDI parent form can be created either at design time or
                  at run time by setting the IsMdiContainer property of the
                  form to true.




     Ver. 1.0                         Session 5                       Slide 3 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                Windows application allows a user to open more than one
                file at a time.
                Whenever a user opens multiple files, he/she may need to
                arrange all the files on the screen in order to work
                efficiently.
                To arrange the opened child forms in the MDI parent form,
                you need to write the following code:
                   this.LayoutMdi(MdiLayout.TileVertical);   // This code
                                                             will arrange all
                                                             the opened
                                                             child windows
                                                             in a vertically
                                                             tiled position.


     Ver. 1.0                       Session 5                          Slide 4 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                  Windows application allows a user to open more than one
                  file at a time.
                  Whenever a user opens multiple files, he/she may need to
                  arrange all the files on the screen in order to work
                  efficiently.
                  To arrange the opened child forms in the MDI parent form,
                  you need to write the following code:
                     this.LayoutMdi(MdiLayout.TileVertical);
                // Refers to the
                MDIParent form.




     Ver. 1.0                        Session 5                       Slide 5 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                Windows application allows a user to open more than one
                file at a time.
                Whenever a user opens multiple files, he/she may need to
                arrange all the files on the screen in order to work
                efficiently.
                To arrange the opened child forms in the MDI parent form,
                you need to write the following code:
                   this.LayoutMdi(MdiLayout.TileVertical);
                         // Is a method,
                         which takes
                         MdiLayout values
                         as an argument.




     Ver. 1.0                      Session 5                       Slide 6 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                Windows application allows a user to open more than one
                file at a time.
                Whenever a user opens multiple files, he/she may need to
                arrange all the files on the screen in order to work
                efficiently.
                To arrange the opened child forms in the MDI parent form,
                you need to write the following code:
                   this.LayoutMdi(MdiLayout.TileVertical);
                                     // Is the value
                                     that arranges all
                                     opened child
                                     forms in vertical
                                     direction.


     Ver. 1.0                      Session 5                       Slide 7 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                There are four MdiLayout values, as described in the
                following table.
                  MdiLayout Values   Description

                  ArrangeIcons       All MDI child icons are arranged within the client region of the MDI
                                     parent form.

                  Cascade            All MDI child windows are cascaded within the client region of the MDI
                                     parent form.

                  TileHorizontal     All MDI child windows are tiled horizontally within the client region of
                                     the MDI parent form.

                  TileVertical       All MDI child windows are tiled vertically within the client region of the
                                     MDI parent form.




     Ver. 1.0                             Session 5                                                   Slide 8 of 35
GUI Applications Development Using .NET Framework
Working with MDI Applications (Contd.)


                MDI applications usually have a Window menu that holds
                the name of all the opened child windows.
                During the creation of an MDI application, you can send
                data to an active MDI child form.




     Ver. 1.0                     Session 5                        Slide 9 of 35
GUI Applications Development Using .NET Framework
Just a minute


                In an MDI application, you need to ensure that when the
                Product menu option is clicked, the Product form is
                displayed as a child form. Complete the following code that
                will display the Product form:
                   public class ProductsFrm: Form
                   {
                        private void Product_Click(object
                        sender, EventArgs e)
                        {
                        Productfrm stdFrmObj = new
                        studentFrm();
                   }



     Ver. 1.0                      Session 5                        Slide 10 of 35
GUI Applications Development Using .NET Framework
Just a minute (Contd.)


                Answer:
                   public class ProductsFrm : Form
                   {
                   private void Product_Click(object sender,
                  EventArgs e)
                   {
                   Productfrm productFrmObj = new
                  studentFrm();
                   productFrmObj.MdiParent=this;
                   productFrmObj.Show
                   }



     Ver. 1.0                 Session 5                Slide 11 of 35
GUI Applications Development Using .NET Framework
Just a minute


                You have added a ContextMenuStrip control to a form. This
                control has the default name contextMenuStrip1. You have
                added three ToolStripMenuItems named Product,
                Customer, and Sales to contextMenuStrip1. How would you
                ensure that the ToolStripMenuItems added to
                ContextMenu1 would be displayed when a user right-clicks
                the Windows form?




                Answer:
                   By Setting the ContextMenuStrip property of the form to
                   contextMenuStrip1.

     Ver. 1.0                       Session 5                            Slide 12 of 35
GUI Applications Development Using .NET Framework
Demo: Designing an MDI Application with Menu


                Problem Statement:
                   Create a data-entry application. The application should enable
                   the user to enter the data in the Student Details forms. The
                   Student Details form should have a menu item named Print,
                   which should get merged with the main MDI parent form menu.
                   The following figure shows how you can organize the main
                   menu on the MDI parent:
                              Data Entry Forms               Exit
                                           Student Details
                                           Faculty Details

                   When the user clicks the Student Details form, the Student Details
                   form should be displayed. When the user clicks on the Faculty
                   Details, a message ‘Faculty Details Menu Item Clicked’ should get
                   displayed. The user should be able to close the application by
                   clicking the Exit menu item.

     Ver. 1.0                         Session 5                          Slide 13 of 35
GUI Applications Development Using .NET Framework
Demo: Designing an MDI Application with Menu (Contd.)


                Solution:
                   To create an MDI application with menu support, you need to
                   perform the following tasks:
                     1.   Create a new VC# application.
                     2.   Convert the form to the MDI parent form.
                     3.   Design the menu on the MDI parent form.
                     4.   Design the Student Details entry form.
                     5.   Create the Print menu on the Student Details entry form.
                     6.   Add code to MDI parent form and Student Details Entry form.
                     7.   Execute the application and verify the output.




     Ver. 1.0                           Session 5                               Slide 14 of 35
GUI Applications Development Using .NET Framework
Demo: Using ContextMenuStrip Control


                Problem Statement:
                   Modify the activity, Designing an MDI Application with Menu, to
                   include a context menu in the MDI parent form. The context
                   menu should enable the user to open a Student Details data
                   entry from, display the message on clicking the Faculty Details
                   menu item, and terminate the application on clicking the Exit
                   menu item.




     Ver. 1.0                        Session 5                           Slide 15 of 35
GUI Applications Development Using .NET Framework
Demo: Using ContextMenuStrip Control (Contd.)


                Solution:
                   To add the context menu to the MDI application created in the
                   previous activity, you need to perform the following tasks:
                     1. Add the context menu to the MDI parent form.
                     2. Add code for the context menu.
                     3. Execute the application and verify the output.




     Ver. 1.0                          Session 5                         Slide 16 of 35
GUI Applications Development Using .NET Framework
Working with ToolStrip Control


                Toolbar provides easy and quick access to the most
                frequently used options.
                A toolbar contains buttons that provide quick access to the
                most frequently used options in an application.
                In VC#, you include the toolbar facility by adding a ToolStrip
                control to the Windows Form.
                      You can add buttons to a toolbar either at design
                      time or at run time.
                      To add buttons during design time, you do the
                      following:
                        1. Add a ToolStrip control to the Windows Form.
                        2. From the Properties window of the ToolStrip
                           control, you need to access the Items
                           property.
                      To add items at run time, you need to add a ToolStrip
                      control to the Windows Form, and then write code to
                      add items to the ToolStrip control.
     Ver. 1.0                        Session 5                            Slide 17 of 35
GUI Applications Development Using .NET Framework
Just a minute


                Fill in the blank:
                You can add images to the ToolStrip button control by
                setting the _____________________ property of the
                ToolStrip button control.




                Answer:
                   ImageIndex


     Ver. 1.0                      Session 5                       Slide 18 of 35
GUI Applications Development Using .NET Framework
Demo: Using ToolStrip Control


                Problem Statement:
                   Modify the activity, Using ContextMenuStrip Control, to include
                   a ToolStrip control in the MDI parent form. Design the ToolStrip
                   control to enable the users to:
                       Display the Student Details data entry form on the click of the
                       Student Details toolbar button.
                       Display the message on the click of the Faculty Details toolbar
                       button.
                       Terminate the application on the click of Exit button of the toolbar.




     Ver. 1.0                         Session 5                                   Slide 19 of 35
GUI Applications Development Using .NET Framework
Demo: Using ToolStrip Control (Contd.)


                Solution:
                   To add and configure the ToolStrip control to the MDI
                   application, you need to perform the following tasks:
                     1. Add the ToolStrip control to the MDI parent form.
                     2. Connect the ToolStrip button event handlers to the MenuItem
                        event handlers.
                     3. Execute the application and verify the output.




     Ver. 1.0                         Session 5                               Slide 20 of 35
GUI Applications Development Using .NET Framework
Introducing Print Components


                There are three dialog boxes in VC# that can be used to
                help in printing of text or graphics. These are:
                   PrintDialog control
                   PageSetupDialog control
                   PrintPreviewDialog control




     Ver. 1.0                       Session 5                      Slide 21 of 35
GUI Applications Development Using .NET Framework
Printing Text and Graphics


                In VC#, you can use the default Print dialog box to print any
                text or graphics.
                There are two ways of using the Print dialog box:
                   By adding PrintDialog control and the PrintDocument control to
                   the form.
                   By creating an instance of PrintDialog and
                   PrintDocument classes.
                Let us understand how does the Print dialog box works.




     Ver. 1.0                       Session 5                            Slide 22 of 35
GUI Applications Development Using .NET Framework
Just a minute


                Which property is used to trap the button that a user clicks
                in the Print dialog box?
                 1.   DialogResult Property
                 2.   Document Property
                 3.   Filter Property
                 4.   Tag Property




                Answer:
                 1. DialogResult Property


     Ver. 1.0                         Session 5                       Slide 23 of 35
GUI Applications Development Using .NET Framework
PageSetupDialog Class


                In VC#, you can use the default Windows Page Setup
                dialog box to set the page details for printing.
                There are two ways of using the Page Setup dialog box:
                   By adding PageSetupDialog control and the PrintDocument
                   control to the form.
                   By creating an instance of PageSetupDialog and
                   PageSettings classes.
                Let us understand how does the Page Setup dialog box
                works.




     Ver. 1.0                      Session 5                         Slide 24 of 35
GUI Applications Development Using .NET Framework
Just a minute


                Name the method which is used to show the dialog box?




                Answer:
                – ShowDialog() method


     Ver. 1.0                     Session 5                      Slide 25 of 35
GUI Applications Development Using .NET Framework
PrintPreview Dialog and PrintPreview Control


                The PrintPreviewDialog control displays how a document
                will look when printed.
                It provides the user with the facility to print, zoom, set page
                layout options, and to move between pages.
                If required PrintPreviewControl control can be used to
                create your custom print preview interface.
                Let us understand how does the PrintPreview dialog box
                works.




     Ver. 1.0                        Session 5                          Slide 26 of 35
GUI Applications Development Using .NET Framework
Enabling Security for Printing in Windows Forms


                • The .NET Framework uses the PrintingPermission
                  class to control access to printing capabilities and the
                  associated PrintingPermissionLevel value to indicate the
                  level of access.
                • The four printing permission levels are:
                   –   AllPrinting          Provides full access to all
                   –   DefaultPrinting      installed printers.
                   –   SafePrinting
                   –   NoPrinting




     Ver. 1.0                            Session 5                        Slide 27 of 35
GUI Applications Development Using .NET Framework
Enabling Security for Printing in Windows Forms (Contd.)


                • The .NET Framework uses the PrintingPermission
                  class to control access to printing capabilities and the
                  associated PrintingPermissionLevel value to indicate the
                  level of access.
                • The four printing permission levels are:
                   –   AllPrinting
                   –   DefaultPrinting      Enables programmatic
                   –   SafePrintng          printing to the default printer
                   –   NoPrintng            and safer printing through a
                                            restrictive printing dialog
                                            box. DefaultPrinting is a
                                            subset of AllPrinting.




     Ver. 1.0                            Session 5                            Slide 28 of 35
GUI Applications Development Using .NET Framework
Enabling Security for Printing in Windows Forms (Contd.)


                • The .NET Framework uses the PrintingPermission
                  class to control access to printing capabilities and the
                  associated PrintingPermissionLevel value to indicate the
                  level of access.
                • The four printing permission levels are:
                   –   AllPrinting
                   –   DefaultPrinting
                   –   SafePrintng          Provides printing only from a
                   –   NoPrintng            more-restricted dialog box.
                                            SafePrinting is a subset of
                                            DefaultPrinting.




     Ver. 1.0                            Session 5                          Slide 29 of 35
GUI Applications Development Using .NET Framework
Enabling Security for Printing in Windows Forms (Contd.)


                • The .NET Framework uses the PrintingPermission
                  class to control access to printing capabilities and the
                  associated PrintingPermissionLevel value to indicate the
                  level of access.
                • The four printing permission levels are:
                   –   AllPrinting
                   –   DefaultPrinting
                   –   SafePrintng
                   –   NoPrintng            Prevents access to printers.
                                            NoPrinting is a subset of
                                            SafePrinting.




     Ver. 1.0                            Session 5                         Slide 30 of 35
GUI Applications Development Using .NET Framework
Just a minute


                Identify the property of the PrintPreviewControl, which is
                used to get or set the page settings.
                 1.   Document
                 2.   DefaultPageSettings
                 3.   StartPage
                 4.   Zoom




                Answer:
                 2. DefaultPageSettings


     Ver. 1.0                         Session 5                       Slide 31 of 35
GUI Applications Development Using .NET Framework
Demo: Creating a Customized PrintPreview Dialog Control


                Problem Statement:
                   Sigma Pvt. Ltd. requires a custom version of the
                   PrintPreviewDialog control that contains additional options. The
                   company wants to design a form that contains a
                   PrintPreviewControl control and an OpenFileDialog control.
                   The form should enable a user to choose the file to be printed
                   from the OpenFileDialog and use the properties of the
                   customized PrintPreviewControl control to print the file.
                   Provide a solution to the problem.




     Ver. 1.0                        Session 5                            Slide 32 of 35
GUI Applications Development Using .NET Framework
Demo: Creating a Customized PrintPreview Dialog Control (Contd.)


                Solution:
                   To meet the preceding requirement, you need to perform the
                   following tasks:
                     1.   Create a new VC# application.
                     2.   Design the Printing Application form.
                     3.   Add code to perform the desired task.
                     4.   Execute the program and verify the output.




     Ver. 1.0                           Session 5                      Slide 33 of 35
GUI Applications Development Using .NET Framework
Summary


               In this session, you learned that:
                – MDI applications enable you to work with more than one form
                  within the same application.
                – Menus are used to enhance the user interface of an
                  application.
                – Context menus enable users to access the most frequently
                  used options.
                – Toolbar is used to provide easy and quick access to the
                  frequently used menu items options by using the ToolStrip
                  control.
                – ToolStrip button items can be configured to hold an image by
                  using the ImageList control.
                – The default Print dialog box can be invoked either by adding a
                  PrintDialog control and a PrintDocument control to the form or
                  by creating an instance of the PrintDialog and
                  PrintDocument classes.
    Ver. 1.0                        Session 5                           Slide 34 of 35
GUI Applications Development Using .NET Framework
Summary (Contd.)


               – The ShowDialog() method is used to display the Print dialog
                 box on the screen.
               – The DialogResult property is used to trap the button that a user
                 clicks in the Print dialog box
               – To invoke the default Windows Page Setup dialog box, either a
                 PageSetupDialog control is added to the form or an instance of
                 the PrintSetupDialog class is created.
               – The PrintPreviewDialog control displays how a document will
                 look when printed.
               – The PrintPreviewControl can be used to create a custom print
                 preview interface.




    Ver. 1.0                       Session 5                            Slide 35 of 35

Mais conteúdo relacionado

Destaque

android sqlite
android sqliteandroid sqlite
android sqliteDeepa Rani
 
SQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemSQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemTanner Jessel
 
How to create rss feed
How to create rss feedHow to create rss feed
How to create rss feedTanuja Talekar
 
how to setup Google analytics tracking code for website
how to setup  Google analytics tracking code for websitehow to setup  Google analytics tracking code for website
how to setup Google analytics tracking code for websiteOM Maurya
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial Jm Ramos
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# IntroductionSiraj Memon
 

Destaque (10)

android sqlite
android sqliteandroid sqlite
android sqlite
 
SQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemSQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management System
 
SQLite - Overview
SQLite - OverviewSQLite - Overview
SQLite - Overview
 
How to create rss feed
How to create rss feedHow to create rss feed
How to create rss feed
 
how to setup Google analytics tracking code for website
how to setup  Google analytics tracking code for websitehow to setup  Google analytics tracking code for website
how to setup Google analytics tracking code for website
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 

Semelhante a 04 gui 05

vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdfLimEchYrr
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptxLimEchYrr
 
Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framworkDipen Parmar
 
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxEllenGracePorras
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programmingsanaiftikhar23
 
Java Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayLiz Sims
 
VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptBhuvanaR13
 
Class viii ch-7 visual basic 2008
Class  viii ch-7 visual basic 2008Class  viii ch-7 visual basic 2008
Class viii ch-7 visual basic 2008jessandy
 
Programming basics
Programming basicsProgramming basics
Programming basicsSenri DLN
 
Vb net xp_09
Vb net xp_09Vb net xp_09
Vb net xp_09Niit Care
 

Semelhante a 04 gui 05 (20)

Vb lecture
Vb lectureVb lecture
Vb lecture
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
vb.pptx
vb.pptxvb.pptx
vb.pptx
 
vb-160518151614.pdf
vb-160518151614.pdfvb-160518151614.pdf
vb-160518151614.pdf
 
vb-160518151614.pptx
vb-160518151614.pptxvb-160518151614.pptx
vb-160518151614.pptx
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
 
Visual basic
Visual basicVisual basic
Visual basic
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framwork
 
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptx
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programming
 
Java Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage Essay
 
10 gui 14
10 gui 1410 gui 14
10 gui 14
 
VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.ppt
 
Class viii ch-7 visual basic 2008
Class  viii ch-7 visual basic 2008Class  viii ch-7 visual basic 2008
Class viii ch-7 visual basic 2008
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
Vb net xp_09
Vb net xp_09Vb net xp_09
Vb net xp_09
 
Sharbani bhattacharya Visual Basic
Sharbani bhattacharya Visual BasicSharbani bhattacharya Visual Basic
Sharbani bhattacharya Visual Basic
 
07 gui 10
07 gui 1007 gui 10
07 gui 10
 

Mais de Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Último

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

04 gui 05

  • 1. GUI Applications Development Using .NET Framework Objectives In this session, you will learn to: Work with menus and multiple-document interface applications Implement the ToolStrip Control in multiple-document interface applications Identify the functionality of print components Ver. 1.0 Session 5 Slide 1 of 35
  • 2. GUI Applications Development Using .NET Framework Working with Menus VC# enables you to create menus and multiple-document interface (MDI) applications. In the Windows environment, you can use menus to enhance the user interface of an application. In VC#, you can create two types of menus: The menus that appear on the menu bar Context menus, which appear when the right mouse button is clicked Context menu items can also You can add menu either at VC# To added to a items items to a time: be add menu form at design run time: design timeeither rundesign time or at or at at time. applicationthe MenuStrip control from the run 1. Add time. Toolbox.at design time. Toolbox To add context menu for a control or a code toyou need to 2. Write form, programmaticallyusing Append individual menu items add add the ContextMenuStrip ToolStripMenuItem the Menu Designer.objects to the control from the object. to MenuStrip Toolbox the form. Ver. 1.0 Session 5 Slide 2 of 35
  • 3. GUI Applications Development Using .NET Framework Working with MDI Applications • In VC#, an MDI application consists of two parts, an MDI parent form and the MDI child form. • An MDI parent form is the form that contains all the MDI child forms. • An MDI parent form can have multiple MDI child forms, but it cannot be a MDI child form to another MDI parent form simultaneously. • An MDI parent form can be created either at design time or at run time by setting the IsMdiContainer property of the form to true. Ver. 1.0 Session 5 Slide 3 of 35
  • 4. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) Windows application allows a user to open more than one file at a time. Whenever a user opens multiple files, he/she may need to arrange all the files on the screen in order to work efficiently. To arrange the opened child forms in the MDI parent form, you need to write the following code: this.LayoutMdi(MdiLayout.TileVertical); // This code will arrange all the opened child windows in a vertically tiled position. Ver. 1.0 Session 5 Slide 4 of 35
  • 5. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) Windows application allows a user to open more than one file at a time. Whenever a user opens multiple files, he/she may need to arrange all the files on the screen in order to work efficiently. To arrange the opened child forms in the MDI parent form, you need to write the following code: this.LayoutMdi(MdiLayout.TileVertical); // Refers to the MDIParent form. Ver. 1.0 Session 5 Slide 5 of 35
  • 6. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) Windows application allows a user to open more than one file at a time. Whenever a user opens multiple files, he/she may need to arrange all the files on the screen in order to work efficiently. To arrange the opened child forms in the MDI parent form, you need to write the following code: this.LayoutMdi(MdiLayout.TileVertical); // Is a method, which takes MdiLayout values as an argument. Ver. 1.0 Session 5 Slide 6 of 35
  • 7. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) Windows application allows a user to open more than one file at a time. Whenever a user opens multiple files, he/she may need to arrange all the files on the screen in order to work efficiently. To arrange the opened child forms in the MDI parent form, you need to write the following code: this.LayoutMdi(MdiLayout.TileVertical); // Is the value that arranges all opened child forms in vertical direction. Ver. 1.0 Session 5 Slide 7 of 35
  • 8. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) There are four MdiLayout values, as described in the following table. MdiLayout Values Description ArrangeIcons All MDI child icons are arranged within the client region of the MDI parent form. Cascade All MDI child windows are cascaded within the client region of the MDI parent form. TileHorizontal All MDI child windows are tiled horizontally within the client region of the MDI parent form. TileVertical All MDI child windows are tiled vertically within the client region of the MDI parent form. Ver. 1.0 Session 5 Slide 8 of 35
  • 9. GUI Applications Development Using .NET Framework Working with MDI Applications (Contd.) MDI applications usually have a Window menu that holds the name of all the opened child windows. During the creation of an MDI application, you can send data to an active MDI child form. Ver. 1.0 Session 5 Slide 9 of 35
  • 10. GUI Applications Development Using .NET Framework Just a minute In an MDI application, you need to ensure that when the Product menu option is clicked, the Product form is displayed as a child form. Complete the following code that will display the Product form: public class ProductsFrm: Form { private void Product_Click(object sender, EventArgs e) { Productfrm stdFrmObj = new studentFrm(); } Ver. 1.0 Session 5 Slide 10 of 35
  • 11. GUI Applications Development Using .NET Framework Just a minute (Contd.) Answer: public class ProductsFrm : Form { private void Product_Click(object sender, EventArgs e) { Productfrm productFrmObj = new studentFrm(); productFrmObj.MdiParent=this; productFrmObj.Show } Ver. 1.0 Session 5 Slide 11 of 35
  • 12. GUI Applications Development Using .NET Framework Just a minute You have added a ContextMenuStrip control to a form. This control has the default name contextMenuStrip1. You have added three ToolStripMenuItems named Product, Customer, and Sales to contextMenuStrip1. How would you ensure that the ToolStripMenuItems added to ContextMenu1 would be displayed when a user right-clicks the Windows form? Answer: By Setting the ContextMenuStrip property of the form to contextMenuStrip1. Ver. 1.0 Session 5 Slide 12 of 35
  • 13. GUI Applications Development Using .NET Framework Demo: Designing an MDI Application with Menu Problem Statement: Create a data-entry application. The application should enable the user to enter the data in the Student Details forms. The Student Details form should have a menu item named Print, which should get merged with the main MDI parent form menu. The following figure shows how you can organize the main menu on the MDI parent: Data Entry Forms Exit Student Details Faculty Details When the user clicks the Student Details form, the Student Details form should be displayed. When the user clicks on the Faculty Details, a message ‘Faculty Details Menu Item Clicked’ should get displayed. The user should be able to close the application by clicking the Exit menu item. Ver. 1.0 Session 5 Slide 13 of 35
  • 14. GUI Applications Development Using .NET Framework Demo: Designing an MDI Application with Menu (Contd.) Solution: To create an MDI application with menu support, you need to perform the following tasks: 1. Create a new VC# application. 2. Convert the form to the MDI parent form. 3. Design the menu on the MDI parent form. 4. Design the Student Details entry form. 5. Create the Print menu on the Student Details entry form. 6. Add code to MDI parent form and Student Details Entry form. 7. Execute the application and verify the output. Ver. 1.0 Session 5 Slide 14 of 35
  • 15. GUI Applications Development Using .NET Framework Demo: Using ContextMenuStrip Control Problem Statement: Modify the activity, Designing an MDI Application with Menu, to include a context menu in the MDI parent form. The context menu should enable the user to open a Student Details data entry from, display the message on clicking the Faculty Details menu item, and terminate the application on clicking the Exit menu item. Ver. 1.0 Session 5 Slide 15 of 35
  • 16. GUI Applications Development Using .NET Framework Demo: Using ContextMenuStrip Control (Contd.) Solution: To add the context menu to the MDI application created in the previous activity, you need to perform the following tasks: 1. Add the context menu to the MDI parent form. 2. Add code for the context menu. 3. Execute the application and verify the output. Ver. 1.0 Session 5 Slide 16 of 35
  • 17. GUI Applications Development Using .NET Framework Working with ToolStrip Control Toolbar provides easy and quick access to the most frequently used options. A toolbar contains buttons that provide quick access to the most frequently used options in an application. In VC#, you include the toolbar facility by adding a ToolStrip control to the Windows Form. You can add buttons to a toolbar either at design time or at run time. To add buttons during design time, you do the following: 1. Add a ToolStrip control to the Windows Form. 2. From the Properties window of the ToolStrip control, you need to access the Items property. To add items at run time, you need to add a ToolStrip control to the Windows Form, and then write code to add items to the ToolStrip control. Ver. 1.0 Session 5 Slide 17 of 35
  • 18. GUI Applications Development Using .NET Framework Just a minute Fill in the blank: You can add images to the ToolStrip button control by setting the _____________________ property of the ToolStrip button control. Answer: ImageIndex Ver. 1.0 Session 5 Slide 18 of 35
  • 19. GUI Applications Development Using .NET Framework Demo: Using ToolStrip Control Problem Statement: Modify the activity, Using ContextMenuStrip Control, to include a ToolStrip control in the MDI parent form. Design the ToolStrip control to enable the users to: Display the Student Details data entry form on the click of the Student Details toolbar button. Display the message on the click of the Faculty Details toolbar button. Terminate the application on the click of Exit button of the toolbar. Ver. 1.0 Session 5 Slide 19 of 35
  • 20. GUI Applications Development Using .NET Framework Demo: Using ToolStrip Control (Contd.) Solution: To add and configure the ToolStrip control to the MDI application, you need to perform the following tasks: 1. Add the ToolStrip control to the MDI parent form. 2. Connect the ToolStrip button event handlers to the MenuItem event handlers. 3. Execute the application and verify the output. Ver. 1.0 Session 5 Slide 20 of 35
  • 21. GUI Applications Development Using .NET Framework Introducing Print Components There are three dialog boxes in VC# that can be used to help in printing of text or graphics. These are: PrintDialog control PageSetupDialog control PrintPreviewDialog control Ver. 1.0 Session 5 Slide 21 of 35
  • 22. GUI Applications Development Using .NET Framework Printing Text and Graphics In VC#, you can use the default Print dialog box to print any text or graphics. There are two ways of using the Print dialog box: By adding PrintDialog control and the PrintDocument control to the form. By creating an instance of PrintDialog and PrintDocument classes. Let us understand how does the Print dialog box works. Ver. 1.0 Session 5 Slide 22 of 35
  • 23. GUI Applications Development Using .NET Framework Just a minute Which property is used to trap the button that a user clicks in the Print dialog box? 1. DialogResult Property 2. Document Property 3. Filter Property 4. Tag Property Answer: 1. DialogResult Property Ver. 1.0 Session 5 Slide 23 of 35
  • 24. GUI Applications Development Using .NET Framework PageSetupDialog Class In VC#, you can use the default Windows Page Setup dialog box to set the page details for printing. There are two ways of using the Page Setup dialog box: By adding PageSetupDialog control and the PrintDocument control to the form. By creating an instance of PageSetupDialog and PageSettings classes. Let us understand how does the Page Setup dialog box works. Ver. 1.0 Session 5 Slide 24 of 35
  • 25. GUI Applications Development Using .NET Framework Just a minute Name the method which is used to show the dialog box? Answer: – ShowDialog() method Ver. 1.0 Session 5 Slide 25 of 35
  • 26. GUI Applications Development Using .NET Framework PrintPreview Dialog and PrintPreview Control The PrintPreviewDialog control displays how a document will look when printed. It provides the user with the facility to print, zoom, set page layout options, and to move between pages. If required PrintPreviewControl control can be used to create your custom print preview interface. Let us understand how does the PrintPreview dialog box works. Ver. 1.0 Session 5 Slide 26 of 35
  • 27. GUI Applications Development Using .NET Framework Enabling Security for Printing in Windows Forms • The .NET Framework uses the PrintingPermission class to control access to printing capabilities and the associated PrintingPermissionLevel value to indicate the level of access. • The four printing permission levels are: – AllPrinting Provides full access to all – DefaultPrinting installed printers. – SafePrinting – NoPrinting Ver. 1.0 Session 5 Slide 27 of 35
  • 28. GUI Applications Development Using .NET Framework Enabling Security for Printing in Windows Forms (Contd.) • The .NET Framework uses the PrintingPermission class to control access to printing capabilities and the associated PrintingPermissionLevel value to indicate the level of access. • The four printing permission levels are: – AllPrinting – DefaultPrinting Enables programmatic – SafePrintng printing to the default printer – NoPrintng and safer printing through a restrictive printing dialog box. DefaultPrinting is a subset of AllPrinting. Ver. 1.0 Session 5 Slide 28 of 35
  • 29. GUI Applications Development Using .NET Framework Enabling Security for Printing in Windows Forms (Contd.) • The .NET Framework uses the PrintingPermission class to control access to printing capabilities and the associated PrintingPermissionLevel value to indicate the level of access. • The four printing permission levels are: – AllPrinting – DefaultPrinting – SafePrintng Provides printing only from a – NoPrintng more-restricted dialog box. SafePrinting is a subset of DefaultPrinting. Ver. 1.0 Session 5 Slide 29 of 35
  • 30. GUI Applications Development Using .NET Framework Enabling Security for Printing in Windows Forms (Contd.) • The .NET Framework uses the PrintingPermission class to control access to printing capabilities and the associated PrintingPermissionLevel value to indicate the level of access. • The four printing permission levels are: – AllPrinting – DefaultPrinting – SafePrintng – NoPrintng Prevents access to printers. NoPrinting is a subset of SafePrinting. Ver. 1.0 Session 5 Slide 30 of 35
  • 31. GUI Applications Development Using .NET Framework Just a minute Identify the property of the PrintPreviewControl, which is used to get or set the page settings. 1. Document 2. DefaultPageSettings 3. StartPage 4. Zoom Answer: 2. DefaultPageSettings Ver. 1.0 Session 5 Slide 31 of 35
  • 32. GUI Applications Development Using .NET Framework Demo: Creating a Customized PrintPreview Dialog Control Problem Statement: Sigma Pvt. Ltd. requires a custom version of the PrintPreviewDialog control that contains additional options. The company wants to design a form that contains a PrintPreviewControl control and an OpenFileDialog control. The form should enable a user to choose the file to be printed from the OpenFileDialog and use the properties of the customized PrintPreviewControl control to print the file. Provide a solution to the problem. Ver. 1.0 Session 5 Slide 32 of 35
  • 33. GUI Applications Development Using .NET Framework Demo: Creating a Customized PrintPreview Dialog Control (Contd.) Solution: To meet the preceding requirement, you need to perform the following tasks: 1. Create a new VC# application. 2. Design the Printing Application form. 3. Add code to perform the desired task. 4. Execute the program and verify the output. Ver. 1.0 Session 5 Slide 33 of 35
  • 34. GUI Applications Development Using .NET Framework Summary In this session, you learned that: – MDI applications enable you to work with more than one form within the same application. – Menus are used to enhance the user interface of an application. – Context menus enable users to access the most frequently used options. – Toolbar is used to provide easy and quick access to the frequently used menu items options by using the ToolStrip control. – ToolStrip button items can be configured to hold an image by using the ImageList control. – The default Print dialog box can be invoked either by adding a PrintDialog control and a PrintDocument control to the form or by creating an instance of the PrintDialog and PrintDocument classes. Ver. 1.0 Session 5 Slide 34 of 35
  • 35. GUI Applications Development Using .NET Framework Summary (Contd.) – The ShowDialog() method is used to display the Print dialog box on the screen. – The DialogResult property is used to trap the button that a user clicks in the Print dialog box – To invoke the default Windows Page Setup dialog box, either a PageSetupDialog control is added to the form or an instance of the PrintSetupDialog class is created. – The PrintPreviewDialog control displays how a document will look when printed. – The PrintPreviewControl can be used to create a custom print preview interface. Ver. 1.0 Session 5 Slide 35 of 35

Notas do Editor

  1. Start the session by sharing the session objectives with the students.
  2. Before starting the session, discuss with the students, the importance and advantages of using menus in GUI applications. Collate the answers given by the students and discuss the following points with the students: Menus enable the users to quickly perform an action The users need not to remember the commands To discuss the type of menus, the faculty can actually demonstrate both the types by opening a word application and showing the two types of menus to the students.
  3. Using the same word application, the faculty must demonstrate the concept of MDI form to the students for better understanding.
  4. Using this slide and slide 5,6, and 7, explain to the students that the child forms can be arranged within the parent MDI form in several different ways. The LayoutMdi method is used to arrange the child forms. This method takes different parameters to arrange the child forms.
  5. Using this slide, explain the values of the MdiLayout method for arranging child forms in several ways.
  6. Reiterate the concepts taught earlier by asking the given question.
  7. Reiterate the concepts taught earlier by asking the given question.
  8. Reiterate the concepts taught earlier by asking the given question.
  9. Conduct the activity stated in the slide in a collaborative mode in the class.
  10. Conduct the activity stated in the slide in a collaborative mode in the class.
  11. Using this slide, you can discuss the concept of toolbars available in the GUI applications. An effective way of explaining this would be to demonstrate with the help of small example of toolbar.
  12. Reiterate the concepts taught earlier by asking the given question.
  13. Conduct the activity stated in the slide in a collaborative mode in the class.
  14. Discuss with the students that VC# also provides 3 dialog boxes that can be used for printing of text or graphics. This helps to make applications even more user-friendly. Before discussing the functionality of these dialog boxes, it will be a good practice to demonstrate these dialog boxes using MS-Word application.
  15. The faculty must give a demo of the PrintDialog control. In addition, the faculty must insist that the students should read “ Changing Printer Attached to a User’s Computer” at home.
  16. Reiterate the concepts taught earlier by asking the given question.
  17. The faculty must give a demo of the PageSetupDialog control or PageSetupDialog class.
  18. Reiterate the concepts taught earlier by asking the given question.
  19. The faculty must give a demo of the PrintPreviewDialog control. In additon, discuss all the properties of PrintPreview Control given in the SG
  20. Using slides 23,24,25, and 26 discuss the printing permissions that can be assigned while using the print related dialog boxes.
  21. Reiterate the concepts taught earlier by asking the given question.
  22. Conduct the activity stated in the slide in a collaborative mode in the class.
  23. You can summarize the session by using the summary given in the slides. In addition, you can also ask students summarize what they have learnt in this session.