多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

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
答案解析:
进入题库查看解析

微信扫一扫手机做题