Can't set focus to a child of UserControl

后端 未结 18 619
耶瑟儿~
耶瑟儿~ 2020-12-04 21:55

I have a UserControl which contains a TextBox. When my main window loads I want to set the focus to this textbox so I added Focusable=\"True

18条回答
  •  醉话见心
    2020-12-04 22:30

    I've noticed a focus issue specifically related to hosting WPF UserControls within ElementHosts which are contained within a Form that is set as an MDI child via the MdiParent property.

    I'm not sure if this is the same issue others are experiencing but you dig into the details by following the link below.

    Issue with setting focus within a WPF UserControl hosted within an ElementHost in a WindowsForms child MDI form

提交回复
热议问题