How to set focus on TextBox in Silverlight 4 out-of-browser popup

后端 未结 6 1069
后悔当初
后悔当初 2020-12-18 10:30

I have a simple ChildWindow popup in Silverlight 4 (beta).

Important: This is an out-of-browser application.

i want to auto

6条回答
  •  渐次进展
    2020-12-18 10:50

    Thanks for all the posts but after doing a little research the below thing work for me

    in Xamal:

    
    
    // Initialiazing Main Part View Model
    /// 
    /// 
    public ChildWindowLoginControl(MainPartViewModel mainPartViewModel)
    {
         InitializeComponent();
         this.DataContext = mainPartViewModel;
         System.Windows.Browser.HtmlPage.Plugin.Focus();
         this.GotFocus += (s, e) => { txtUserName.Focus(); };
    }
    

提交回复
热议问题