DropDownList.BorderColor Property
.NET Framework 3.0
Gets or sets the border color of the control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public: virtual property Color BorderColor { Color get () override; void set (Color value) override; }
/** @property */ public Color get_BorderColor () /** @property */ public void set_BorderColor (Color value)
public override function get BorderColor () : Color public override function set BorderColor (value : Color)
Not applicable.
Property Value
A System.Drawing.Color that represents the border color of the control. Note: |
|---|
| The BorderColor property is inherited from the WebControl class and is not applicable to the DropDownList control. |
The following code example demonstrates how to get or set the BorderColor property in a custom DropDownList control.
<%@ Page Language="VJ#" AutoEventWireup="True" %>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSL.Controls" Assembly="Samples.AspNet.JSL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Custom DropDownList - BorderColor - VJ# Example</title>
<script runat="server">
private void Page_Load(Object sender, System.EventArgs e)
{
DropDownList1.get_Items().Add(new ListItem("Item1", "Item1"));
DropDownList1.get_Items().Add(new ListItem("Item2", "Item2"));
DropDownList1.get_Items().Add(new ListItem("Item2", "Item2"));
} //Page_Load
</script>
</head>
<body>
<form id="Form1" method="post" runat="server">
<h3>Custom DropDownList - BorderColor - VJ# Example</h3>
<aspSample:CustomDropDownListBorderColor
id="DropDownList1"
runat="server" />
</form>
</body>
</html>
...
package Samples.AspNet.JSL.Controls;
public class CustomDropDownListBorderColor
extends System.Web.UI.WebControls.DropDownList
{
/** @attribute System.ComponentModel.Browsable(false)
*/
// NOTE: The BorderColor property is inherited from the WebControl
// class and is not applicable to the DropDownList control.
/** @property
*/
public System.Drawing.Color get_BorderColor()
{
return super.get_BorderColor();
} //get_BorderColor
/** @property
*/
public void set_BorderColor(System.Drawing.Color value)
{
super.set_BorderColor(value);
} //set_BorderColor
// NOTE: The BorderStyle property is inherited from the WebControl
// class and is not applicable to the DropDownList control.
/** @property
*/
public System.Web.UI.WebControls.BorderStyle get_BorderStyle()
{
return super.get_BorderStyle();
} //get_BorderStyle
/** @property
*/
public void set_BorderStyle(System.Web.UI.WebControls.BorderStyle value)
{
super.set_BorderStyle(value);
} //set_BorderStyle
// NOTE: The BorderWidth property is inherited from the WebControl
// class and is not applicable to the DropDownList control.
/** @property
*/
public System.Web.UI.WebControls.Unit get_BorderWidth()
{
return super.get_BorderWidth();
} //get_BorderWidth
/** @property
*/
public void set_BorderWidth(System.Web.UI.WebControls.Unit value)
{
super.set_BorderWidth(value);
} //set_BorderWidth
// NOTE: The ToolTip property is inherited from the WebControl
// class and is not applicable to the DropDownList control.
/** @property
*/
public String get_ToolTip()
{
return super.get_ToolTip();
} //get_ToolTip
/** @property
*/
public void set_ToolTip(String value)
{
super.set_ToolTip(value);
} //set_ToolTip
} //CustomDropDownListBorderColor
Community Additions
ADD
Show:
Note: