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/maskedtextbox/appearance-and-styling/creating-a-custom-skin.md
+32-29Lines changed: 32 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,12 @@ position: 3
13
13
14
14
15
15
The following tutorial demonstrates creating a custom **RadMaskedTextBox** 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:
19
-

20
+
21
+

20
22
21
23
See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-styling/html-output-and-css-styling%}) for more information on specific CSS file properties.
22
24
@@ -29,29 +31,29 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
29
31
1. In the Solution Explorer, create a new "Green" directory in your project.
30
32
31
33
1. Copy the default **RadMaskedTextBox** 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
-
34
+
>note The file path will typically be similar to this example: *\Program Files\Progress\UI for ASP.NET AJAX RX YYYY\Skins\Default.*
35
35
1. In the Solution Explorer, rename "Input.Default.css" to "Input.Green.css".
36
36

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

38
+

39
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
-

41
+
42
+

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

49
+
50
+

49
51
50
52
## Editing the CSS classes
51
53
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:
54
+
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
55
54
-
````CSS
56
+
````CSS
55
57
.RadInput_Greena.riUp
56
58
{
57
59
background-position: 4px-98px;
@@ -60,7 +62,7 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
60
62
}
61
63
````
62
64
63
-
````CSS
65
+
````CSS
64
66
.RadInput_Greena.riDown
65
67
{
66
68
background-position: 4px-199px;
@@ -69,9 +71,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
69
71
}
70
72
````
71
73
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:
74
+
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
75
74
-
````CSS
76
+
````CSS
75
77
.RadInput_Greena.riButton
76
78
{
77
79
background-color: #ddffe0;
@@ -80,9 +82,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
80
82
81
83
82
84
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:
85
+
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:
84
86
85
-
````CSS
87
+
````CSS
86
88
.RadInput_Green.riEnabled
87
89
{
88
90
color: #333;
@@ -92,10 +94,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
92
94
````
93
95
94
96
97
+
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".
95
98
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".
97
-
98
-
````CSS
99
+
````CSS
99
100
.RadInput_Green.riHover
100
101
{
101
102
color: #333;
@@ -105,9 +106,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
105
106
106
107
107
108
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:
109
+
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
110
110
-
````CSS
111
+
````CSS
111
112
.RadInput_Green.riEmpty
112
113
{
113
114
color: Green;
@@ -118,9 +119,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
118
119
119
120
120
121
121
-
1.The class that controls the text area when it has focus is **.riFocused**. Change the border color to "Green":
122
+
The class that controls the text area when it has focus is **.riFocused**. Change the border color to "Green":
122
123
123
-
````CSS
124
+
````CSS
124
125
.RadInput_Green.riFocused
125
126
{
126
127
border: solid1pxGreen;
@@ -130,9 +131,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
130
131
131
132
132
133
133
-
1. The class that controls the text area of **RadMaskedTextBox** when it's value is negative is **.riNegative**. Change the border color to "Green":
134
+
The class that controls the text area of **RadMaskedTextBox** when it's value is negative is **.riNegative**. Change the border color to "Green":
134
135
135
-
````CSS
136
+
````CSS
136
137
.RadInput_Green.riNegative
137
138
{
138
139
border: solid1pxGreen;
@@ -142,9 +143,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
142
143
143
144
144
145
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":
146
+
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
147
147
-
````CSS
148
+
````CSS
148
149
.RadInput_Green.riError
149
150
{
150
151
background-image: url('Input/errorSign.gif');
@@ -157,9 +158,9 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
157
158
158
159
159
160
160
-
1. The class that controls the Label is **.riLabel**. Change the font color to "Green":
161
+
The class that controls the Label is **.riLabel**. Change the font color to "Green":
161
162
162
-
````CSS
163
+
````CSS
163
164
.RadInput_Green.riLabel
164
165
{
165
166
color: Green;
@@ -170,5 +171,7 @@ See [Understanding the Skin CSS File]({%slug radmaskedtextbox/appearance-and-sty
170
171
171
172
172
173
173
-
1. Run the application. The input controls should now look as follows:
174
+
Run the application. The input controls should now look as follows:
0 commit comments