Share via


Remove Method (StyleSheet)

Removes the specified style from the style sheet.

public void Remove(
   string id
)

Parameters

  • id
    The name of the style to remove.

Example

The following example demonstrates how to use the Remove method to remove a Style from the StyleSheet control.

Sub cmdClick(sender As Object, e As EventArgs)
   StyleSheet1.Remove("Style1")
   MyForm1.StyleReference = "Style2"
End Sub

<mobile:StyleSheet id="StyleSheet1" runat="server">
  <Style Font-Size="Large" Font-Name="Arial" Font-Bold="true" 
     ForeColor="Red" Font-Italic="True" Alignment=Center 
     Wrapping="Wrap" Name="Style1" BackColor =LightBlue />
  <Style Font-Size="Normal" Font-Name="Arial" Font-Bold="false"
     foreColor="Blue" Font-Italic="true" BackColor="LightGreen"
     Wrapping="NoWrap" Name="Style2" />
</mobile:StyleSheet>  

[C#]

void cmdClick(object sender, EventArgs e)
{
  StyleSheet1.Remove("Style1");
  MyForm1.StyleReference="Style2";
}

<mobile:StyleSheet id="StyleSheet1" runat="server">
  <Style Font-Size="Large" Font-Name="Arial" Font-Bold="true" 
     ForeColor="Red" Font-Italic="True" Alignment=Center 
     Wrapping="Wrap" Name="Style1" BackColor =LightBlue />
  <Style Font-Size="Normal" Font-Name="Arial" Font-Bold="false"
     foreColor="Blue" Font-Italic="true" BackColor="LightGreen"
     Wrapping="NoWrap" Name="Style2" />
</mobile:StyleSheet>  

See Also

Remove Method (DeviceSpecificChoiceCollection) | Remove Method (MobileListItemCollection) | Remove Method (ObjectListCommandCollection) | Remove Method (ObjectListFieldCollection)

Applies to: StyleSheet Class