当在文本框中插入一个值时,我想将焦点放在页面上的特定按钮上。 我写了这个:
Private Sub CalcolaImporto() Handles txtQnt.TextChanged
Try
//Some code
btnAdd.Focus()
Catch ex As Exception
m_WriteLogEventi(MethodInfo.GetCurrentMethod().Name, "Si è verificato un errore:", ex.ToString(), logLivello.Errore,,, True)
End Try
End Sub
事实上它是 onFocus 因为如果我按下 Enter 按钮星号的指令。
这是scss规则
&.action {
background-color: $verde;
text-transform: uppercase;
&:hover {
background-color: lighten($verde,10%);
}
&:focus {
-webkit-box-shadow: 0 0 9px 0 $verde;
box-shadow: 0 0 9px 0 $verde;
background-color: lighten($verde,10%) !important;
}
但是不应用在 css (: focus) 中定义的样式。 为什么? 我想让用户清楚地知道按钮是有焦点的
最佳答案
你试试这些代码:
button:focus {
background: pink;
}
关于css - AspNet Set Focus() 有效但 :focus style's not apply,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40522698/