Implement Printing and Reporting Functionality in a Windows Forms Application

These questions are based on 70-526VB: TS: Microsoft .NET Framework 2.0 – Windows-Based Client Development (VB.NET)
Microsoft
Self Test Software Practice Test


Objective: Implement Printing and Reporting Functionality in a Windows Forms application.
Sub-objective: Construct print documents.


Single answer, multiple-choice


You are an application developer in a company. You create an application using Visual Basic .NET. The application enables end users to print legal forms. You need to ensure that each time a form is printed, the end user gets a message displayed on the screen giving information regarding the completion of the print job. You have a PrintDocument component named PrintDocument1 placed on the Windows form named Print.vb.


Which code should you insert into your application to show the message box on the completion of the document printing job?



  1. Private Sub PrintDocument1_EndPrint(ByVal sender As Object, _
     ByVal e As System.Drawing.Printing.PrintEventArgs) Handles _
     PrintDocument1.EndPrint
     MessageBox.Show(“Finished printing”)
    End Sub

  2. Private Sub PrintDocument1_BeginPrint(ByVal sender As Object, _
     ByVal e As System.Drawing.Printing.PrintEventArgs) Handles _
     PrintDocument1.BeginPrint
     MessageBox.Show(“Finished printing”)
    End Sub

  3. Private Sub PrintDocument1_QueryPageSettings(ByVal sender As _
     Object, ByVal e As System.Drawing.Printing.QueryPageSettingsEventArgs) _
     Handles PrintDocument1.QueryPageSettings
     MessageBox.Show(“Finished printing”)
    End Sub

  4. Private Sub PrintDocument1_PrintPage(ByVal sender As Object, _
     ByVal e As System.Drawing.Printing.PrintEventArgs) Handles _
     PrintDocument1.PrintPage
     MessageBox.Show(“Finished printing”)
    End Sub

Answer:
A. Private Sub PrintDocument1_EndPrint(ByVal sender As Object, _
 ByVal e As System.Drawing.Printing.PrintEventArgs) Handles _
 PrintDocument1.EndPrint
 MessageBox.Show(“Finished printing”)
End Sub


Tutorial:
You should use the following code:


Private Sub PrintDocument1_EndPrint(ByVal sender As Object, _
 ByVal e As System.Drawing.Printing.PrintEventArgs) Handles _
 PrintDocument1.EndPrint
 MessageBox.Show(“Finished printing”)
End Sub


This code uses the EndPrint event of the PrintDocument1 component. This event occurs when the last…


cmadmin

ABOUT THE AUTHOR

Posted in Uncategorized|

Comment:

Powered by WebDesk