You upgrade a Windows Forms application to Microsoft .NET Framework 4. The application was developed by using a previous version of the .NET Framework. The application uses the Code Access Security (CAS) policy
for file access. When the application is executed, you receive the following exception:
"NotSupportedException: This method uses CAS policy, which has been obsoleted by the .NET Framework."
You need to resolve the error. What should you do?
You use Microsoft .NET Framework 4 to create a Windows Forms client application. You write the following code segment.
sealed class FormSettings : ApplicationSettingsBase {
[UserScopedSetting()]
[DefaultSettingValue("225, 200")]
public Size FormSize
{
get { return (Size)this["FormSize"]; }
set { this["FormSize"] = value; }
}
}
The application contains a form of type Form1 that contains a FormSettings object named frmSettings1.
You need to maintain the user's form size preference each time the user executes the application. Which code segment should you use?
You use Microsoft .NET Framework 4 to create a Windows Forms application.
You write the following code segment. (Line numbers are included for reference only.)
01. sealed class FormSettings : ApplicationSettingsBase
02. {
03.
04. public String Description
05. {
06. get { return (String)this["Description"]; }
07. set { this["Description"] = value;}
08. }
09. }
You need to ensure that the first time each user opens the application, a text field displays the following message: "Please enter your setting." Which code segment should you insert at line 03?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You need to ensure that users can view content in a book-reading format that displays two pages at a time.
Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that allows users to arrange images.
You need to ensure that users can arrange child elements in a panel without affecting the size of the elements. You also need to ensure that child elements are oriented horizontally. Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You need to ensure that the application meets the following requirements:
Displays a menu that is specific to the control selected by the user.
Displays the menu next to the control.
Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays an image.
You need to ensure that users can stretch and scale the image. Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application contains a window that has two labels named First and Second. You need to display the label named First in blue. Which code fragment should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment.
You need to ensure that the style is applied to all labels within the application. What should you do?
Add the style to the section of the main window.✘ Add the style to the section of the main window.✘ Add the style to the section of the App.xaml file.✘ Add the style to the section of the App.xaml file.✔ Add the style to the section of the ResourceDictionary.xaml file.✔
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application contains the following code fragment. Hello World
You need to define a style that applies the following properties to the text in the StackPanel object:
FontSize = 32
FontWeight = Bold
Which code fragment should you use?