Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Multiple Choice Questions
Q491: What method is used to persist data when a WPF application is about to close?
- A: OnClosed
- B: OnInitializing
- C: OnClosing
- D: OnExit
View Answer
A
Q492: How do you handle a scenario where you need to ensure only one instance of a WPF application runs?
- A: By using a Mutex to check if another instance is already running
- B: By using the Dispatcher to prevent multiple instances
- C: By checking the process count in the Main method
- D: By setting the ShutdownMode to OnExplicitShutdown
View Answer
A
Q493: How do you add a splash screen to a WPF application?
- A: By adding a new item with the build action set to SplashScreen in the project properties
- B: By setting the SplashScreen property in App.xaml
- C: By using SplashScreen class in the application code
- D: By defining SplashScreen in the Application class
View Answer
A
Q494: Which property of PrintDialog is used to display the print dialog to the user?
- A: ShowDialog
- B: Print
- C: PrintVisual
- D: PrintDocument
View Answer
A
Q495: What method can be used to rename a file in a WPF application?
- A: File.Move
- B: File.Copy
- C: File.Delete
- D: File.Rename
View Answer
A
Q496: How can you handle file storage and retrieval using isolated storage in a WPF application?
- A: By using IsolatedStorageFile and IsolatedStorageFileStream
- B: By using FileStream and File
- C: By using ApplicationSettings class
- D: By using Registry class
View Answer
A
Q497: What is a modal dialog in WPF?
- A: A dialog that blocks user interaction with other windows until it is closed
- B: A dialog that can be used without affecting other windows
- C: A dialog that shows only when the application starts
- D: A dialog that appears in a non-blocking manner
View Answer
A
Q498: What method is called when a WPF window is shown modally?
- A: ShowDialog
- B: Show
- C: Activate
- D: Focus
View Answer
A
Q499: What property of a Window determines if it should appear in the taskbar?
- A: ShowInTaskbar
- B: Topmost
- C: WindowStyle
- D: AllowsTransparency
View Answer
A
Q500: How do you handle application exit scenarios in WPF?
- A: By overriding OnExit method in the Application class
- B: By setting the ShutdownMode property in App.xaml
- C: By calling Application.Exit() method
- D: By handling the Exit event in the main window
View Answer
A