小编Jot*_*oth的帖子

将焦点设置为uwp中的textBox

我有一个Universal Windows平台项目,它有一个textBox元素.
单击单选按钮时,我想将焦点设置为它.

在单选按钮单击事件中,我可以说:

txtBoxID.IsEnabled = true;
txtBoxID.Text = "";
Run Code Online (Sandbox Code Playgroud)

但是我该如何设定焦点呢?我看到一些答案说使用:

FocusManager.SetFocusedElement(
Run Code Online (Sandbox Code Playgroud)

但是我的FocusManager类没有那个方法.

编辑:解决了,谢谢.只需要知道传递给SetFocus的参数.被认为是相似的另一个人的问题是关于他将注意力集中在他的控制之后发生的事件.

c# uwp uwp-xaml

3
推荐指数
1
解决办法
7531
查看次数

Set a unique constraint across multiple table columns

I am creating a table in SQL Server with the following columns:

ic_card_num, 
employee_id, 
active
Run Code Online (Sandbox Code Playgroud)

multiple duplicates of ic_card_num and active are okay if only one card is active:

employee_id | ic_card_num |  active       
   123      |    111      |   false      
   235      |    111      |   true      
   987      |    111      |   false      
Run Code Online (Sandbox Code Playgroud)

I want to avoid this:

employee_id | ic_card_num |  active       
   123      |    111      |   true      
   235      |    111      |   true      
   987      |    111      |   false      
Run Code Online (Sandbox Code Playgroud)

I am working with SQL Server, …

sql-server database-design unique-constraint

0
推荐指数
1
解决办法
47
查看次数