Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Multiple Choice Questions
Q521: Which XAML property should be used to display images from local resources in a WPF application?
- A: Source
- B: ImageSource
- C: PackUri
- D: ResourceUri
View Answer
A
Q522: How do you embed a binary resource in a WPF application?
- A: Add the file to the project and set its Build Action to Resource
- B: Add the file to the project and set its Build Action to Content
- C: Use the EmbeddedResource build action in the file properties
- D: Place the file in the Resources folder and load it using ResourceLoader
View Answer
A
Q523: What does the ApplicationDeployment.CurrentDeployment.DownloadFileGroupAsync method do in a WPF XBAP?
- A: It initiates the download of a file group and allows monitoring the download progress
- B: It synchronously downloads a single file from a URL
- C: It downloads a single file from the local file system
- D: It clears the application cache
View Answer
A
Q524: What is the purpose of the BrowserInteropHelper.Source property in XBAP?
- A: To retrieve the complete URL of the currently hosted page
- B: To set the URL for navigation in the application
- C: To get the local file path of a resource
- D: To retrieve browser cookies
View Answer
A
Q525: Which of the following is a valid way to handle file open dialogs in a XBAP application?
- A: By using the OpenFileDialog class and its ShowDialog method
- B: By using the SaveFileDialog class and its ShowDialog method
- C: By using the FilePicker class and its Open method
- D: By directly accessing file paths without dialogs
View Answer
A
Q526: What XAML attribute should be used to display an image stored in a loose file?
- A: Source="pack://siteoforigin:,,,/image.gif"
- B: Source="pack://application:,,,/image.gif"
- C: Source="/images/image.gif"
- D: Source="images/image.gif"
View Answer
A
Q527: How do you set up a full-trust XBAP application in the project file?
- A: By changing
Internet toCustom - B: By setting
Custom in the Application settings - C: By adding a new Custom target zone in the project properties
- D: By configuring the ClickOnce manifest with custom permissions
View Answer
A
Q528: What should be used to handle progress notifications during file downloads in XBAP?
- A: System.Deployment.Application.ApplicationDeployment.DownloadFileGroupCompleted event
- B: System.Deployment.Application.ApplicationDeployment.DownloadProgressChanged event
- C: System.Windows.Controls.ProgressBar
- D: System.Windows.Threading.Dispatcher
View Answer
A
Q529: How should you manage resources like images and fonts in a WPF application?
- A: Add them as Resource or Content and refer to them using pack://application:,,, URIs
- B: Add them as EmbeddedResource and access them directly using file paths
- C: Use ResourceManager class to load resources at runtime
- D: Load resources using Assembly.GetManifestResourceStream
View Answer
A
Q530: What is the purpose of the AllowPartiallyTrustedCallers attribute in WPF applications?
- A: It allows partially trusted code to call the assembly marked with this attribute
- B: It ensures that the assembly can only be called by fully trusted code
- C: It restricts the assembly to be used only in a local context
- D: It grants unrestricted access to all resources in the assembly
View Answer
A