70-511 · Question #167
You are developing a Windows Presentation Foundation (WPF) application. The application contains the following code in the code-behind file for an application window. (Line numbers are included for…
The correct answer is A. stack.Children.Add (btn). See the full explanation below for the reasoning.
Question
You are developing a Windows Presentation Foundation (WPF) application. The application contains the following code in the code-behind file for an application window. (Line numbers are included for reference only.) 01 Dim stack As StackPanel = New StackPanel() 02 Content = stack 03 For i As Integer = 0 To 9 04 Dim btn As Button = New Button () 05 btn.Name = Convert.ToChar (Asc("A") + i) .ToString () 06 btn.Content - btn.Name "says" "Click me1" 07 08 Next You need to ensure that all of the Button controls that are defined in this code segment appear in the application window. Which code segment should you insert at line 07?
Options
- Astack.Children.Add (btn)
- Bstack.Children.Insert (i + 1, btn)
- CContent = btn
- DContent = New Button ()
How the community answered
(42 responses)- A74% (31)
- B17% (7)
- C7% (3)
- D2% (1)
Community Discussion
No community discussion yet for this question.