You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window for the application. You need to ensure that the following requirements are met:
An array of strings is displayed by using a ListBox control in a two-column format.
The data in the ListBox control flows from left to right and from top to bottom.
Which ListBox control would you use?
You create a form by using Windows Presentation Foundation and Microsoft .NET Framework 3.5. The form contains a status bar.
You plan to add a ProgressBar control to the status bar. You need to ensure that the ProgressBar control displays the progress of a task for which you cannot predict the completion time.
Which code segment should you use?
You are converting a Windows Forms application to a Windows Presentation Foundation (WPF) application.
You use Microsoft .NET Framework 3.5 to create the WPF application.
The WPF application will reuse 30 forms of the Windows Forms application. The WPF application contains the following class definition.
public class OwnerWindow : System.Windows.Forms.IWin32Window
{
private IntPtr handle_Renamed;
public IntPtr Handle
{
get { return handle_Renamed ; }
set { handle_Renamed = value ; }
}
}
You write the following code segment in the WPF application.
(Line numbers are included for reference only.)
01 public System.Windows.Forms.DialogResult LaunchWindowsFormsDialog
(System.Windows.Forms.Form dialog, Window wpfParent)
02 {
03 System.Windows.Interop.WindowInteropHelper helper = new
System.Windows.Interop.WindowInteropHelper(wpfParent) ;
04 OwnerWindow owner = new OwnerWindow() ;
05
06 }
You need to ensure that the application can launch the reusable forms as modal dialogs.
Which code segment should you insert at line 05?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window in the application. You plan to select a layout control to host the elements that you add to the window.
You need to select a control that meets the following requirements with its default properties:
1. The elements stretch horizontally to occupy the available width of the window.
2. The elements do not stretch vertically.
Which control should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You need to perform the following tasks:
Add a control to a window by using the following XAML code fragment.
Ensure that the background color of the control is yellow.
Ensure that the foreground color is red
What should you do?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a Button control to a Canvas control. You need to ensure that exactly 10 device-independent pixels are present between the right side of the Button control and the right side of the Canvas control.
Which XAML code fragment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a dialog window composed of a TextBox control and a Button control by using the following XAML
code fragment.
You need to ensure that each time the user presses the ENTER key, the click event of the OK button is raised.
Which two actions should you perform? (Each correct answer presents part of the solution.)
You are creating a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 3.5.
You plan to implement a search functionality for a text editor. You write the following code segment for the WPF screen.
You need to ensure that on clicking the Find button, the value of the tbxTextToFind text box is selected in the rtbText control.
Which code segment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a Button control and a StatusBar control to a window.
You need to ensure that the two controls meet the following requirements:
The StatusBar control sticks to the lower edge of the window.
The Button control has the minimum required size to display its content.
Which XAML code fragment should you use?
You have created a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application, named EnterpriseApplication.exe, runs over the network.
You add the WindowSize parameter and the WindowPosition parameter to the Settings.settings file by using the designer at the User Scope Level.
The dimensions and position of the window are read from the user configuration file.
The application must retain the original window size and position for users executing the application.
You need to ensure that the following requirements are met:
The window dimensions for each user are saved in the user configuration file.
User settings persist when a user exits the application.
Which configuration setting should you use?