O'Reilly logo

WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Common Properties

This appendix summarizes properties that are common to many WPF controls. See the earlier chapters and the following appendixes for more information about specific kinds of controls.

General Properties

Table A-1 summarizes general properties that apply to many controls. Note that not all properties apply to all control types.

Table A.1. General Properties

Property

Purpose

AcceptsReturn

Determines whether a [Return] character is inserted into a TextBox or RichTextBox, or whether a [Return] character in this control is ignored.

AcceptsTab

Determines whether a [Tab] character is inserted into a TextBox or RichTextBox, or whether a [Tab] character moves focus to the next control.

Background

The control's background color

BorderBrush

Determines the color of the control's border. Note that you must set BorderBrush to a visible color and BorderThickness to a value >0 before you can see the border.

BorderThickness

Determines the thickness of the control's border. Note that you must set BorderBrush to a visible color and BorderThickness to a value >0 before you can see the border.

Content

The content that the control should contain. Some controls (such as Button and Label) can hold only a single child as content, while others (such as Grid and StackPanel) can have many children. If a control can display text (such as a Button or Label), then you can set the Content property to a string for the control to display.

ContextMenu

The ContextMenu that the control should display when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required