You need to modify the CSS declaration to this
.x-16 .x-btn-default-small .x-btn-inner
{
font-size: 16px !important;
}
and set the CtCls property to your custom class
X.Button().CtCls="x-16"
Pergunta
how I can change font size of a Ext.Net button. I have tryed: Css:
.x-16
{
font-size: 16px;
}
Razor:
X.Button().Icon(Icon.PluginAdd).ID("NewTask").Text("New Task").Handler("Myapp.ShowWinAddTask").Cls("x-16")
Any ideas?
Solução
You need to modify the CSS declaration to this
.x-16 .x-btn-default-small .x-btn-inner
{
font-size: 16px !important;
}
and set the CtCls property to your custom class
X.Button().CtCls="x-16"
Outras dicas
I would recommend a bit different solution.
It prunes "-small" from the CSS rule. That "-small" part depends on a Button's Scale.
Also it prunes the "!important" statement which is good to avoid as much as possible.
<!DOCTYPE html>
<html>
<head>
<title>Ext.Net.MVC v2 Example</title>
<style>
.x-16 .x-btn-inner {
font-size: 16px;
}
</style>
</head>
<body>
@Html.X().ResourceManager()
@Html.X().Button().Text("Button").Cls("x-16")
</body>
</html>