试题详情
- 单项选择题 You use Microsoft .NET Framework 4 to create a Windows Forms application. You plan to use a Windows Presentation Foundation (WPF) control of the UserControl1 type hosted in an ElementHost control named elementHost1. You write the following code segment. (Line numbers are included for reference only.) You need to ensure that the application changes the background color of the hosted control when the background color of the form changes. Which code segment should you insert at line 05?()
A、 elementHost1.PropertyMap.Remove("BackColor"); elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange));
B、 elementHost1.PropertyMap.Remove("Background"); elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange));
C、 elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange)); elementHost1.PropertyMap.Apply("BackColor");
D、 elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange)); elementHost1.PropertyMap.Apply("Background");
- A
关注下方微信公众号,在线模考后查看
热门试题