单项选择题
You are creating a Windows Forms application by using the .Net Framework 3.5.You create an instance of a Backgroundworker component named backgroundWorker1 to process operations that take a long time.You discover that when the application attempts to report the progress,you receive a System.InvalidOperationException exception when executing the backgroundWorker1.ReportProgress method.You need to configure the BackgroundWorker component appropriately to prevent the application from generating exceptions.What should yo do?()
A.Set the Result property of the DoWorkEventArgs instance to True before you attempt to report the progress.
B.Set the CancellationPending property of backgroundWorker1 to True before you attempt to report the background process
C.Set the WorkerReportsProgress property of backgroundWorker1 to True before you attempt to report the background process.
D.Report the progress of the background process in the backgroundWorker1_ProgressChanged event.
相关考题
-
单项选择题
YouarecreatingaWindowsFormsApplicationbyusingthe.NETFramework3.5.Youplantodesignanewcontrolthatwillbeusedonmultipleformsintheapp.Youneedtoensurethatthecontrolmeetsthefollowingrequirement(1)ItretrievesdatafromaMSSQLServer2008databaseinstance.(2)ItusesWPFclassestodisplaydata.(3)Itusesuser-customizableactionswhenthecontrolisfirstpaintedontheform.Whatshouldyoudo?()
A.Create a new custom class for the control that is derived from the Control class.
B.Create a new custom class for the control that is derived from the UserControl class.
C.Create a new custom class for the control that is derived from the ContentControl class.
D.Create a new custom class for the control that is derived from the ContentPresenter class. -
多项选择题
YouaredevelopingaWindowsFormsApplicationbyusingthe.NETFramework3.5.YouplantocreateacustomizedPrintPreviewdialogboxintheapplication.Youneedtoensurethatuserscanpreviewtheirdocumentsbeforeprinting.Whichtwoactionsshouldyouperform?()
A.Add a PrintPreviewDialog control to the form.
B.Add a PrintPreviewControl control to the form.
C.Create and initialize a PrintDocument object on the form and then implement the PrintPage event handler.
D.Create and initialize a PrintDocument object on the form and then implement the BeginPrint event handler.
E.Set the Document property of the PrintPreviewDialog control to the PrintDocument instance that must be printed. -
单项选择题
YouarecreatingaWindowsFormsapplicationbyusingthe.NetFramework3.5.Youplantodisplaydetailedhelpinstructionsforeachcontrolintheform.Youcreateahelpfile.YouconfigureaHelpProvidercomponentontheform.YouneedtodisplaythehelpfileforthecontrolthatisfocusedwhentheF1keyispressed.WhichmethodoftheHelpProviderclassshouldyoucallforeachcontrol?()
A.SetShowHelp
B.SetHelpString
C.SetHelpKeyword
D.SetHelpNavigator
