2016-11-10 86 views
0

当一个值被插入到一个文本框中我想集中一个特定的按钮在页面上。 我写了这个:AspNet设置焦点()的作品,但:焦点样式不适用

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 

事实上,它是聚焦状态,因为如果我按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中定义的样式:未施加(焦点)。 为什么? 我想讲清楚的是,按键集中

回答

0

你尝试这些代码的用户:

当然
button:focus { 
    background: pink; 
} 
+0

是的,我加我SCSS规则。 – laura