Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng]-1.pdf
Скачиваний:
143
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

Appendix A: Web Control

Reference

The following reference includes a list of important properties, methods, and events for most of the controls you’ll find in the Visual Web Developer Toolbox.

I’ve grouped the lists of controls on the basis of their locations within the Toolbox:

standard controls

validation controls

navigation controls

HTML server controls

As all the web controls listed here are based on (or, more specifically, derived from) the WebControl class, they inherit its properties and methods. First up, let’s review the more useful of these, which can be used with any of the web controls.

The WebControl Class

Properties

AccessKey

specifies a shortcut key that quickly selects a control

 

without the user needing to use a mouse; the shortcut

 

command is usually Alt plus a letter or number

Attributes

allows the accessing and manipulation of the attributes

 

of the HTML code rendered by the control

BackColor

the control’s current background color

BorderColor

color for the border

BorderStyle

style of border drawn around the web control; default

 

is NotSet; other values are None, Solid, Double,

 

Groove, Ridge, Dotted, Dashed, Inset, and Outset

Appendix A: Web Control Reference

BorderWidth

width of the border

Controls

a collection of all the controls contained within the

 

web control (its child controls)

CssClass

indicates the style class within the current CSS style

 

sheet that should be applied to the web control

Enabled

determines whether the web control is active and able

 

to receive user input

EnableTheming

determines whether the control uses themes

Font

a FontInfo object representing the control’s current

 

font

 

Properties of FontInfo include Bold, Italic, Name,

 

Names, Overline, Size, Strikeout, and Underline.

ForeColor

the control’s current foreground color

Height

the current height of the control

SkinID

the ID of the skin to be used by the control

Style

allows the manipulation of the CSS style elements

 

through the returned CssStyleCollection object

TabIndex

defines the order in which controls on the page are se-

 

lected when the user presses Tab; lowest value is selec-

 

ted first

Tooltip

the text that appears in a popup when the cursor is

 

hovered over the control

Visible

determines whether the control appears on-screen in

 

the user’s browser

Width

the current width of the control

Methods

ApplyStyle

copies an element of a Style object to a control

612