You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controls/numerictextbox/appearance-and-styling/creating-a-custom-skin.md
+29-25Lines changed: 29 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,11 @@ position: 3
13
13
14
14
15
15
The following tutorial demonstrates creating a custom **RadNumericTextBox** skin, using the default skin as a base. This new skin will take the appearance of the input controls from their default look:
16
+
16
17

17
18
18
19
to the following:
20
+
19
21

20
22
21
23
See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styling/html-output-and-css-styling%}) for more information on specific CSS file properties.
@@ -29,29 +31,31 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
29
31
1. In the Solution Explorer, create a new "Green" directory in your project.
30
32
31
33
1. Copy the default **RadNumericTextBox** skin files from the installation directory to the "Green" directory; copy both the \Input directory that contains the images for this skin and the Input.Default.css file that defines the skin styles.
32
-
>note The file path will typically be similar to this example: *\Program Files\Progress\UI for ASP.NET AJAX RX YYYY\Skins\Default.*
33
-
>
34
+
>note The file path will typically be similar to this example: *\Program Files\Progress\UI for ASP.NET AJAX RX YYYY\Skins\Default.*
34
35
35
36
1. In the Solution Explorer, rename "Input.Default.css" to "Input.Green.css".
36
-

37
+
38
+

37
39
1. Open Input.Green.css and replace all instances of _Default with _Green. Then save the file:
38
-

39
40
40
-
1. Drag the "Input.Green.Css" file from the Solution Explorer onto your Web page. This automatically adds a reference to the page "<head>" tag as a "<link>" to the new stylesheet:
41
+

42
+
43
+
1. Drag the "Input.Green.Css" file from the Solution Explorer onto your Web page. This automatically adds a reference to the page `<head>` tag as a `<link>` to the new stylesheet:
41
44

42
45
43
46
1. Change the **Skin** property of your four **RadInput** controls to "Green".
44
47
45
48
1. Set the **EnableEmbeddedSkins** property of your four **RadInput** controls to "False".
46
49
47
50
1. Run the application. The new "Green" skin looks just like the Default skin:
51
+
48
52

49
53
50
54
## Editing the CSS classes
51
55
52
-
1.The classes that control the background for spin buttons are **.riUp** and **.riDown**. Locate the mentioned selectors. The class definitions are qualified by the **.RadInput_Green** class, which is the class definition for the entire control. Add a property to the selectors, setting the background color for the spin buttons:
56
+
The classes that control the background for spin buttons are **.riUp** and **.riDown**. Locate the mentioned selectors. The class definitions are qualified by the **.RadInput_Green** class, which is the class definition for the entire control. Add a property to the selectors, setting the background color for the spin buttons:
53
57
54
-
````CSS
58
+
````CSS
55
59
.RadInput_Greena.riUp
56
60
{
57
61
background-position: 4px-98px;
@@ -60,7 +64,7 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
60
64
}
61
65
````
62
66
63
-
````CSS
67
+
````CSS
64
68
.RadInput_Greena.riDown
65
69
{
66
70
background-position: 4px-199px;
@@ -69,9 +73,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
69
73
}
70
74
````
71
75
72
-
1.The class that controls the background of the button is **.riButton**. There is currently no definition for this class in the skin file. Add one, setting a background for the button:
76
+
The class that controls the background of the button is **.riButton**. There is currently no definition for this class in the skin file. Add one, setting a background for the button:
73
77
74
-
````CSS
78
+
````CSS
75
79
.RadInput_Greena.riButton
76
80
{
77
81
background-color: #ddffe0;
@@ -80,9 +84,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
80
84
81
85
82
86
83
-
1. The text area when the control is enabled has the **.riEnabled** class applied. Locate this selector. Change the border color to Green and add a background color:
87
+
The textarea when the control is enabled has the **.riEnabled** class applied. Locate this selector. Change the border color to Green and add a background color:
84
88
85
-
````CSS
89
+
````CSS
86
90
.RadInput_Green.riEnabled
87
91
{
88
92
color: #333;
@@ -93,9 +97,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
93
97
94
98
95
99
96
-
1.The class that controls the text area when the mouse hovers over the control is **.riHover**. Locate this selector, and change the border color from "#000" to "Green".
100
+
The class that controls the text area when the mouse hovers over the control is **.riHover**. Locate this selector, and change the border color from "#000" to "Green".
97
101
98
-
````CSS
102
+
````CSS
99
103
.RadInput_Green.riHover
100
104
{
101
105
color: #333;
@@ -105,9 +109,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
105
109
106
110
107
111
108
-
1. The class that controls the text area when it is displaying the empty message is **.riEmpty**. Locate this selector and change the color and border colors to "Green". Add in a background color as well:
112
+
The class that controls the text area when it is displaying the empty message is **.riEmpty**. Locate this selector and change the color and border colors to "Green". Add in a background color as well:
109
113
110
-
````CSS
114
+
````CSS
111
115
.RadInput_Green.riEmpty
112
116
{
113
117
color: Green;
@@ -118,9 +122,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
118
122
119
123
120
124
121
-
1.The class that controls the text area when it has focus is **.riFocused**. Change the border color to "Green":
125
+
The class that controls the text area when it has focus is **.riFocused**. Change the border color to "Green":
122
126
123
-
````CSS
127
+
````CSS
124
128
.RadInput_Green.riFocused
125
129
{
126
130
border: solid1pxGreen;
@@ -130,9 +134,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
130
134
131
135
132
136
133
-
1. The class that controls the text area of **RadNumericTextBox** when it's value is negative is **.riNegative**. Change the border color to "Green":
137
+
The class that controls the text area of **RadNumericTextBox** when it's value is negative is **.riNegative**. Change the border color to "Green":
134
138
135
-
````CSS
139
+
````CSS
136
140
.RadInput_Green.riNegative
137
141
{
138
142
border: solid1pxGreen;
@@ -142,9 +146,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
142
146
143
147
144
148
145
-
1.The class that controls the text area when it's value is invalid is **.riError**. Add a **background-color** of "#ddd", and change the color and border-color attributes to "#ffcc55":
149
+
The class that controls the text area when it's value is invalid is **.riError**. Add a **background-color** of "#ddd", and change the color and border-color attributes to "#ffcc55":
146
150
147
-
````CSS
151
+
````CSS
148
152
.RadInput_Green.riError
149
153
{
150
154
background-image: url('Input/errorSign.gif');
@@ -157,9 +161,9 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
157
161
158
162
159
163
160
-
1. The class that controls the Label is **.riLabel**. Change the font color to "Green":
164
+
The class that controls the Label is **.riLabel**. Change the font color to "Green":
161
165
162
-
````CSS
166
+
````CSS
163
167
.RadInput_Green.riLabel
164
168
{
165
169
color: Green;
@@ -169,6 +173,6 @@ See [Understanding the Skin CSS File]({%slug numerictextbox/appearance-and-styli
169
173
````
170
174
171
175
176
+
Run the application. The input controls should now look as follows:
172
177
173
-
1. Run the application. The input controls should now look as follows:
0 commit comments