即時創建一個Windows應用商店應用程序,我想集中我的PopDialog的文本框。我如何在Windows應用商店應用中關注UI元素?
GroupName = new TextBox();
GroupName.Width = 400;
GroupName.Height =35;
GroupName.VerticalAlignment = VerticalAlignment.Center;
GroupName.HorizontalAlignment = HorizontalAlignment.Left;
GroupName.Focus(Windows.UI.Xaml.FocusState.Programmatic);
Content.Children.Add(GroupName);
另外我需要關注按鈕,所以如果用戶按下輸入按鈕被激活。
Button create = new Button();
create.Content = "Erstellen";
create.Focus(FocusState.Pointer);
create.Click += AddGroup;
Btnpanel.Children.Add(create);