| |||||
WebControl.BorderStyle PropertySystem.Web.UI.WebControls Namespace WebControl Class Sets or retrieves the border style of a Web control. Syntax
Property ValueenumValue may be any of the BorderStyle enumeration values. This property is read/write with a default value of NotSet. RemarksBorderStyle is used to specify in what style the border of a Web server control is rendered. This property is set using a BorderStyle enumeration value, the possible values of which are shown above. A BorderWidth greater than 0 must be set for the BorderStyle attribute to render.
ExampleThe following example shows how to declaratively set the BorderStyle property of a Web control at design time. <asp:panel id = "myPanel" runat = "server" borderstyle = "ridge" borderwidth=3 bordercolor = "beige" /> The example below shows how to programmatically set the BorderStyle property at run time, depending on user input. The code also demonstrates how simple it is to retrieve the available system border styles and dynamically add each to a selectable list. void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
ICollection borders =
TypeDescriptor.GetConverter ( typeof ( BorderStyle ) ).GetStandardValues ( );
foreach ( BorderStyle b in borders ) {
BorderSelect.Items.Add ( b.ToString ( ) );
}
}
myTable.BorderStyle = ( BorderStyle ) BorderSelect.SelectedIndex;
}
The following example demonstrates use of the BorderStyle property with client-side DHTML events to dynamically modify a control's border style. This sample uses calls to an embedded stylesheet to change the BorderStyle in response to mouse events. See AlsoWebControl Members Style BorderStyle Enumeration Base Web Control Properties |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme