ElementStyle class contains CSS style settings for a specific Web UI element.
For a list of all members of this type, see ElementStyle Members.
System.Object
EO.Web.ElementStyle
[Visual Basic]
Public Class ElementStyle
[C#]
public class ElementStyle
Thread Safety
Public static (Shared in Visual Basic) members of this type are
safe for multithreaded operations. Instance members are not guaranteed to be
thread-safe.
Remarks
ElementStyle class maintains CSS style information used to control the style of an UI element. ElementStyle exposes the following properties:
| What property to use to control the style |
Description |
|
CssClass
|
The CSS class name. This property controls the CSS attributes according to the specified CSS class name. You can set this property in design time as well as run time. |
|
CssText or InlineStyle
|
Menu Builders support inline CSS editor which provides an easy way to edit and preview any CSS settings. CssText and InlineStyle properties are pointing to the same set of CSS style. Updating one will affect the other. See InlineStyle for programming examples. |
| Other properties that wrap CSS attributes |
Common attributes such as BackColor, Font and Paddings are directly exposed as properties. Setting these properties indirectly changes CssText and InlineStyle. See InlineStyle for programming examples. |
Tip:
Use item look to control the common appearance settings of items.
Here is an example to control style by using both
InlineStyle and individual CSS style attribute to achieve the same result:
[C#] // Get a menu look item
MenuItem lookItem;
lookItem = Menu1.ItINoDocServiceProvideremLooks.GetItemByID("default");
// Set look item's background color to red by using BackColor property.
lookItem.NormalStyle.BackColor = Color.Red;
// Set the submenu of the look item's background color to
// red by using BackColor property.
lookItem.SubMenu.Style.InlineStyle["background-color"] = "red";
[Visual Basic.NET] Dim foreColor As Color
' Get a menu look item
Dim lookItem as MenuItem
lookItem = Menu1.ItemLooks.GetItemByID("default")
'Set look item's background color to red by using BackColor property.
lookItem.NormalStyle.BackColor = Color.Red
'Set submenu of the look item's background color to red
'by using BackColor property.
lookItem.SubMenu.Style.InlineStyle.Item("background-color") = "red"
Requirements
Namespace:
EO.Web
Assembly: EO.Web (in EO.Web.dll)
See Also
ElementStyle Members | EO.Web Namespace | ElementStyle.InlineStyle property