| |||||||
WebControl.BorderWidth PropertySystem.Web.UI.WebControls Namespace WebControl Class Sets or retrieves the border width of a Web control. Syntax
Property Value
This property is read/write with no default value. RemarksBorderWidth is used to specify how wide the border of a Web server control is rendered. This property is set with a Unit object that must evaluate to a positive value. Note that this property will render only for certain controls. In general, only controls that render as an HTML <table> or <div> element ( block objects ) can display a border color, such as Table, Panel, DataGrid, Calendar, etc. It will also work for list controls that have their RepeatLayout property set to Table, such as the CheckBoxList, RadioButtonList and DataList.
ExampleThe following example shows how to declaratively set the BorderWidth 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 BorderWidth property at run time, depending on user input. void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
for ( int i=5; i<=30; i+=5 ) {
widthSelect.Items.Add ( i.ToString ( ) );
}
widthSelect.SelectedIndex = 2;
}
myTable.BorderWidth = int.Parse ( widthSelect.SelectedItem.Text );
}
The following example demonstrates use of the BorderWidth property with client-side DHTML events to dynamically modify a control's border width. This sample uses calls to an embedded stylesheet to change the BorderWidth in response to mouse events. See AlsoWebControl Members Style 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