diff --git a/dotnet-desktop-guide/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control.md b/dotnet-desktop-guide/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control.md index d882157448..4bb6d83c68 100644 --- a/dotnet-desktop-guide/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control.md +++ b/dotnet-desktop-guide/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control.md @@ -1,6 +1,5 @@ --- title: How to Create an Unbound Windows Forms DataGridView Control - description: Populate an unbound Windows Forms DataGridView Control programmatically and display a small amount of data in a table format without binding it to a data source ms.date: "03/30/2017" @@ -15,9 +14,9 @@ ms.assetid: b5d4b47d-9a28-4d88-9dba-0a3c90fba71d --- # How to: Create an Unbound Windows Forms DataGridView Control -The following code example demonstrates how to populate a control programmatically without binding it to a data source. This is useful when you have a small amount of data that you want to display in a table format. +The following code example demonstrates how to populate a control programmatically without binding it to a data source. This is useful when you have a small amount of data that you want to display in a table format. - For a complete explanation of this code example, see [Walkthrough: Creating an Unbound Windows Forms DataGridView Control](walkthrough-creating-an-unbound-windows-forms-datagridview-control.md). +For a complete explanation of this code example, see [Walkthrough: Creating an Unbound Windows Forms DataGridView Control](walkthrough-creating-an-unbound-windows-forms-datagridview-control.md). ## Example @@ -26,13 +25,13 @@ The following code example demonstrates how to populate a -- [Walkthrough: Creating an Unbound Windows Forms DataGridView Control](walkthrough-creating-an-unbound-windows-forms-datagridview-control.md) +- [Walk-through: Creating an Unbound Windows Forms DataGridView Control](walkthrough-creating-an-unbound-windows-forms-datagridview-control.md) - [Displaying Data in the Windows Forms DataGridView Control](displaying-data-in-the-windows-forms-datagridview-control.md) - [Data Display Modes in the Windows Forms DataGridView Control](data-display-modes-in-the-windows-forms-datagridview-control.md) diff --git a/dotnet-desktop-guide/framework/winforms/controls/run-procedures-at-set-intervals-with-wf-timer-component.md b/dotnet-desktop-guide/framework/winforms/controls/run-procedures-at-set-intervals-with-wf-timer-component.md index 2446395cd1..58489ae1fb 100644 --- a/dotnet-desktop-guide/framework/winforms/controls/run-procedures-at-set-intervals-with-wf-timer-component.md +++ b/dotnet-desktop-guide/framework/winforms/controls/run-procedures-at-set-intervals-with-wf-timer-component.md @@ -17,7 +17,7 @@ ms.assetid: 8025247a-2de4-4d86-b8ab-a8cb8aeab2ea --- # How to: Run Procedures at Set Intervals with the Windows Forms Timer Component -You might sometimes want to create a procedure that runs at specific time intervals until a loop has finished or that runs when a set time interval has elapsed. The component makes such a procedure possible. +The component makes both procedures possible. You can create a procedure that runs at specific time intervals until a loop has finished. You can also create a procedure that runs when a set time interval has elapsed. See Examples 1 and 2 below. This component is designed for a Windows Forms environment. If you need a timer that is suitable for a server environment, see [Introduction to Server-Based Timers](/previous-versions/visualstudio/visual-studio-2008/tb9yt5e6(v=vs.90)). @@ -26,20 +26,20 @@ You might sometimes want to create a procedure that runs at specific time interv ## To run a procedure at set intervals with the Timer component -1. Add a to your form. See the following Example section for an illustration of how to do this programmatically. Visual Studio also has support for adding components to a form. Also see [How to: Add Controls Without a User Interface to Windows Forms](how-to-add-controls-without-a-user-interface-to-windows-forms.md). +1. Add a to your form. See Example 3: To show how to set typographic property of text programmatically [How-to: Alter the Typography of Text](../../wpf/advanced/how-to-alter-the-typography-of-text.md). Visual Studio also has support for adding components to a form. See [How to: Add Controls Without a User Interface to Windows Forms](how-to-add-controls-without-a-user-interface-to-windows-forms.md). -2. Set the property (in milliseconds) for the timer. This property determines how much time will pass before the procedure is run again. +1. Set the property (in milliseconds) for the timer. This property determines how much time will pass before the procedure is run again. > [!NOTE] > The more often a timer event occurs, the more processor time is used in responding to the event. This can slow down overall performance. Do not set a smaller interval than you need. -3. Write appropriate code in the event handler. The code you write in this event will run at the interval specified in the property. +1. Write appropriate code in the event handler. The code you write in this event will run at the interval specified in the property. -4. Set the property to `true` to start the timer. The event will begin to occur, running your procedure at the set interval. +1. Set the property to `true` to start the timer. The event will begin to occur, running your procedure at the set interval. -5. At the appropriate time, set the property to `false` to stop the procedure from running again. Setting the interval to `0` does not cause the timer to stop. +1. At the appropriate time, set the property to `false` to stop the procedure from running again. Setting the interval to `0` does not cause the timer to stop. -## Example +## Example 1: Shows how to track the time of day in oe-second increments This first code example tracks the time of day in one-second increments. It uses a , a , and a component on a form. The property is set to 1000 (equal to one second). In the event, the label's caption is set to the current time. When the button is clicked, the property is set to `false`, stopping the timer from updating the label's caption. The following code example requires that you have a form with a control named `Button1`, a control named `Timer1`, and a control named `Label1`. @@ -145,7 +145,7 @@ private: } ``` -## Example +## Example 2: Shows how to run a procedure every 600 milliseconds until a loop has finished This second code example runs a procedure every 600 milliseconds until a loop has finished. The following code example requires that you have a form with a control named `Button1`, a control named `Timer1`, and a control named `Label1`. diff --git a/dotnet-desktop-guide/framework/winforms/controls/walkthrough-creating-an-unbound-windows-forms-datagridview-control.md b/dotnet-desktop-guide/framework/winforms/controls/walkthrough-creating-an-unbound-windows-forms-datagridview-control.md index 6b8c7cdf0d..fb9727feb3 100644 --- a/dotnet-desktop-guide/framework/winforms/controls/walkthrough-creating-an-unbound-windows-forms-datagridview-control.md +++ b/dotnet-desktop-guide/framework/winforms/controls/walkthrough-creating-an-unbound-windows-forms-datagridview-control.md @@ -1,8 +1,6 @@ --- -title: Walkthrough to Creating an Unbound Windows Forms DataGridView Control - -description: You can create an Unbound Windows Forms DataGridView Control and display a small amount of data without binding it to a data source - +title: Walkthrough to Populate an Unbound Windows Forms DataGridView Control +description: You can populate an Unbound Windows Forms DataGridView Control and display a small amount of data without binding it to a data source ms.date: "03/30/2017" dev_langs: - "csharp" @@ -17,80 +15,80 @@ ms.assetid: 5a8d6afa-1b4b-4b24-8db8-501086ffdebe --- # Walkthrough: Creating an Unbound Windows Forms DataGridView Control -You may frequently want to display tabular data that does not originate from a database. For example, you may want to show the contents of a two-dimensional array of strings. The class provides an easy and highly customizable way to display data without binding to a data source. This walkthrough shows how to populate a control and manage the addition and deletion of rows in "unbound" mode. By default, the user can add new rows. To prevent row addition, set the property is `false`. +You may frequently want to display tabular data that does not originate from a database. For example, you may want to show the contents of a two-dimensional array of strings. The class provides an easy and highly customizable way to display data without binding to a data source. This walk-through shows how to populate a control and manage the addition and deletion of rows in "unbound" mode. By default, the user can add new rows. To prevent row addition, set the property to `false`. - To copy the code in this topic as a single listing, see [How to: Create an Unbound Windows Forms DataGridView Control](how-to-create-an-unbound-windows-forms-datagridview-control.md). + To copy the code in this topic as a single listing, see [How to: Create an Unbound Windows Forms DataGridView Control](how-to-create-an-unbound-windows-forms-datagridview-control.md). -## Creating the Form +## Creating the Form -### To use an unbound DataGridView control +### To use an unbound DataGridView control -1. Create a class that derives from and contains the following variable declarations and `Main` method. +1. Create a class that derives from and contains the following variable declarations and `Main` method. [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#01](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#01)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#01](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#01)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#01](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#01)] [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#02](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#02)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#02](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#02)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#02](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#02)] -2. Implement a `SetupLayout` method in your form's class definition to set up the form's layout. +2. Implement a `SetupLayout` method in your form's class definition to set up the form's layout. [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#20](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#20)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#20](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#20)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#20](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#20)] -3. Create a `SetupDataGridView` method to set up the columns and properties. +3. Create a `SetupDataGridView` method to set up the columns and properties. This method first adds the control to the form's collection. Next, the number of columns to be displayed is set using the property. The default style for the column headers is set by setting the , , and properties of the returned by the property. - Layout and appearance properties are set, and then the column names are assigned. When this method exits, the control is ready to be populated. + Layout and appearance properties are set, and then the column names are assigned. When this method exits, the control is ready to be populated. [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#30](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#30)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#30](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#30)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#30](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#30)] -4. Create a `PopulateDataGridView` method to add rows to the control. +4. Create a `PopulateDataGridView` method to add rows to the control. - Each row represents a song and its associated information. + Each row represents a song and its associated information. [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#40](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#40)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#40](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#40)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#40](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#40)] -5. With the utility methods in place, you can attach event handlers. +5. With the utility methods in place, you can attach event handlers. - You will handle the **Add** and **Delete** buttons' events, the form's event, and the control's event. + You will handle the **Add** and **Delete** buttons' events, the form's event, and the control's event. - When the **Add** button's event is raised, a new, empty row is added to the . + When the **Add** button's event is raised, a new, empty row is added to the . - When the **Delete** button's event is raised, the selected row is deleted, unless it is the row for new records, which enables the user add new rows. This row is always the last row in the control. + When the **Delete** button's event is raised, the selected row is deleted, unless it is the row for new records, which enables the user add new rows. This row is always the last row in the control. - When the form's event is raised, the `SetupLayout`, `SetupDataGridView`, and `PopulateDataGridView` utility methods are called. + When the form's event is raised, the `SetupLayout`, `SetupDataGridView`, and `PopulateDataGridView` utility methods are called. - When the event is raised, each cell in the `Date` column is formatted as a long date, unless the cell's value cannot be parsed. + When the event is raised, each cell in the `Date` column is formatted as a long date, unless the cell's value cannot be parsed. [!code-csharp[System.Windows.Forms.DataGridViewSimpleUnbound#10](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/CS/simpleunbound.cs#10)] - [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#10)] + [!code-vb[System.Windows.Forms.DataGridViewSimpleUnbound#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb#10)] ## Testing the Application - You can now test the form to make sure it behaves as expected. + You can now test the form to make sure it behaves as expected. -### To test the form +### To test the form -- Press F5 to run the application. +Press F5 to run the application. - You will see a control that displays the songs listed in `PopulateDataGridView`. You can add new rows with the **Add Row** button, and you can delete selected rows with the **Delete Row** button. The unbound control is the data store, and its data is independent of any external source, such as a or an array. +You will see a control that displays the songs listed in `PopulateDataGridView`. You can add new rows with the **Add Row** button, and you can delete selected rows with the **Delete Row** button. The unbound control is the data store, and its data is independent of any external source, such as a or an array. ## Next Steps - This application gives you a basic understanding of the control's capabilities. You can customize the appearance and behavior of the control in several ways: + This application gives you a basic understanding of the control's capabilities. You can customize the appearance and behavior of the control in several ways: -- Change border and header styles. For more information, see [How to: Change the Border and Gridline Styles in the Windows Forms DataGridView Control](change-the-border-and-gridline-styles-in-the-datagrid.md). +- Change border and header styles. For more information, see [How to: Change the Border and Gridline Styles in the Windows Forms DataGridView Control](change-the-border-and-gridline-styles-in-the-datagrid.md). -- Enable or restrict user input to the control. For more information, see [How to: Prevent Row Addition and Deletion in the Windows Forms DataGridView Control](prevent-row-addition-and-deletion-datagridview.md), and [How to: Make Columns Read-Only in the Windows Forms DataGridView Control](how-to-make-columns-read-only-in-the-windows-forms-datagridview-control.md). +- Enable or restrict user input to the control. For more information, see [How to: Prevent Row Addition and Deletion in the Windows Forms DataGridView Control](prevent-row-addition-and-deletion-datagridview.md), and [How to: Make Columns Read-Only in the Windows Forms DataGridView Control](how-to-make-columns-read-only-in-the-windows-forms-datagridview-control.md). -- Check user input for database-related errors. For more information, see [Walkthrough: Handling Errors that Occur During Data Entry in the Windows Forms DataGridView Control](handling-errors-that-occur-during-data-entry-in-the-datagrid.md). +- Check user input for database-related errors. For more information, see [Walk-through: Handling Errors that Occur During Data Entry in the Windows Forms DataGridView Control](handling-errors-that-occur-during-data-entry-in-the-datagrid.md). -- Handle very large data sets using virtual mode. For more information, see [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](implementing-virtual-mode-wf-datagridview-control.md). +- Handle very large data sets using virtual mode. For more information, see [Walk-through: Implementing Virtual Mode in the Windows Forms DataGridView Control](implementing-virtual-mode-wf-datagridview-control.md). -- Customize the appearance of cells. For more information, see [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](customize-the-appearance-of-cells-in-the-datagrid.md) and [How to: Set Default Cell Styles for the Windows Forms DataGridView Control](how-to-set-default-cell-styles-for-the-windows-forms-datagridview-control.md). +- Customize the appearance of cells. For more information, see [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](customize-the-appearance-of-cells-in-the-datagrid.md) and [How to: Set Default Cell Styles for the Windows Forms DataGridView Control](how-to-set-default-cell-styles-for-the-windows-forms-datagridview-control.md). ## See also diff --git a/dotnet-desktop-guide/framework/winforms/data-binding-and-windows-forms.md b/dotnet-desktop-guide/framework/winforms/data-binding-and-windows-forms.md index 3868beea56..e0006939af 100644 --- a/dotnet-desktop-guide/framework/winforms/data-binding-and-windows-forms.md +++ b/dotnet-desktop-guide/framework/winforms/data-binding-and-windows-forms.md @@ -1,5 +1,5 @@ --- -title: Data Binding +title: Data Binding and Windows Forms description: Learn how to bind to an array of values that you calculate at runtime, read from a file, or derive from the values of other controls in Windows Forms. ms.date: "03/30/2017" ms.topic: overview @@ -16,6 +16,7 @@ helpviewer_keywords: ms.assetid: 419aac5e-819b-4aad-88b0-73a2f8c0bd27 --- # Data Binding and Windows Forms + In Windows Forms, you can bind to not just traditional data sources, but also to almost any structure that contains data. You can bind to an array of values that you calculate at run time, read from a file, or derive from the values of other controls. In addition, you can bind any property of any control to the data source. In traditional data binding, you typically bind the display property—for example, the property of a control—to the data source. With the .NET Framework, you also have the option of setting other properties through binding as well. You might use binding to perform the following tasks: @@ -28,7 +29,8 @@ In Windows Forms, you can bind to not just traditional data sources, but also to Essentially, data binding is an automatic way of setting any run-time accessible property of any control on a form. -## Types of Data Binding +## Types of Data Binding + Windows Forms can take advantage of two types of data binding: simple binding and complex binding. Each offers different advantages. |Type of data binding|Description| @@ -36,10 +38,12 @@ In Windows Forms, you can bind to not just traditional data sources, but also to |Simple data binding|The ability of a control to bind to a single data element, such as a value in a column in a dataset table. This is the type of binding typical for controls such as a control or control, which are controls that typically only displays a single value. In fact, any property on a control can be bound to a field in a database. There is extensive support for this feature in Visual Studio.

For more information, see:

- [Interfaces Related to Data Binding](interfaces-related-to-data-binding.md)
- [How to: Navigate Data in Windows Forms](how-to-navigate-data-in-windows-forms.md)
- [How to: Create a Simple-Bound Control on a Windows Form](how-to-create-a-simple-bound-control-on-a-windows-form.md)| |Complex data binding|The ability of a control to bind to more than one data element, typically more than one record in a database. Complex binding is also called list-based binding. Examples of controls that support complex binding are the , , and controls. For an example of complex data binding, see [How to: Bind a Windows Forms ComboBox or ListBox Control to Data](./controls/how-to-bind-a-windows-forms-combobox-or-listbox-control-to-data.md).| -## BindingSource Component +## BindingSource Component + To simplify data binding, Windows Forms enables you to bind a data source to the component and then bind controls to the . You can use the in simple or complex binding scenarios. In either case, the acts as an intermediary between the data source and bound controls providing change notification currency management and other services. -## Common Scenarios That Employ Data Binding +## Common Scenarios That Employ Data Binding + Nearly every commercial application uses information read from data sources of one type or another, usually through data binding. The following list shows a few of the most common scenarios that utilize data binding as the method of data presentation and manipulation. |Scenario|Description| diff --git a/dotnet-desktop-guide/framework/winforms/windows-forms-data-binding.md b/dotnet-desktop-guide/framework/winforms/windows-forms-data-binding.md index db4808877f..b43f6e1e4f 100644 --- a/dotnet-desktop-guide/framework/winforms/windows-forms-data-binding.md +++ b/dotnet-desktop-guide/framework/winforms/windows-forms-data-binding.md @@ -1,5 +1,5 @@ --- -title: Data Binding +title: Windows Forms Data Binding description: Learn how to use data binding in Windows Forms to display and make changes to information from a data source in controls on the form. ms.date: "03/30/2017" helpviewer_keywords: @@ -10,9 +10,11 @@ helpviewer_keywords: ms.assetid: c3826d8e-ea25-4ad4-a669-45bfb19192aa --- # Windows Forms Data Binding + Data binding in Windows Forms gives you the means to display and make changes to information from a data source in controls on the form. You can bind to both traditional data sources as well as almost any structure that contains data. -## In This Section +## In This Section + [Data Binding and Windows Forms](data-binding-and-windows-forms.md) Provides an overview of data binding in Windows Forms. @@ -48,14 +50,16 @@ Data binding in Windows Forms gives you the means to display and make changes to Also see [Interfaces Related to Data Binding](interfaces-related-to-data-binding.md), [How to: Navigate Data in Windows Forms](how-to-navigate-data-in-windows-forms.md), and [How to: Create a Simple-Bound Control on a Windows Form](how-to-create-a-simple-bound-control-on-a-windows-form.md). -## Reference +## Reference + Describes the class that represents the binding between a bindable component and a data source. Describes the class that encapsulates a data source for binding to controls. -## Related Sections +## Related Sections + [BindingSource Component](./controls/bindingsource-component.md) Contains a list of topics that demonstrate how to use the component. diff --git a/dotnet-desktop-guide/framework/wpf/advanced/documents.md b/dotnet-desktop-guide/framework/wpf/advanced/documents.md index 368e3bd49e..1c68696e66 100644 --- a/dotnet-desktop-guide/framework/wpf/advanced/documents.md +++ b/dotnet-desktop-guide/framework/wpf/advanced/documents.md @@ -10,7 +10,7 @@ ms.assetid: 7bf37ccb-5d09-4eae-9661-929582aeb259 # Documents [!INCLUDE[TLA#tla_winclient](../../../includes/tlasharptla-winclient-md.md)] provides a versatile set of components that enable developers to build applications with advanced document features and an improved reading experience. In addition to enhanced capabilities and quality, [!INCLUDE[TLA#tla_winclient](../../../includes/tlasharptla-winclient-md.md)] also provides simplified management services for document packaging, security, and storage. - + ## In This Section [Documents in WPF](documents-in-wpf.md) diff --git a/dotnet-desktop-guide/framework/wpf/advanced/how-to-alter-the-typography-of-text.md b/dotnet-desktop-guide/framework/wpf/advanced/how-to-alter-the-typography-of-text.md index 25051f8326..df59466bdf 100644 --- a/dotnet-desktop-guide/framework/wpf/advanced/how-to-alter-the-typography-of-text.md +++ b/dotnet-desktop-guide/framework/wpf/advanced/how-to-alter-the-typography-of-text.md @@ -1,7 +1,6 @@ --- title: How to Alter the Typography of Text - -description: To alter the telegraphy of text, set the telegraphy attribute. You can set the typographic property of text programmatically. You can see how altered and default telegraphy properties of text render on screen each with an example. +description: To alter the telegraphy of text, set the telegraphy attribute. You can set the typographic property of text programmatically. ms.date: "03/30/2017" dev_langs: @@ -18,17 +17,23 @@ The following example shows how to set the attribute, using as the example element. + +## Example 2: To show how altered and default typographic properties of text render on screen + + [!code-xaml[TextElementSnippets#_TextElement_TypogXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/TextElementSnippets/CSharp/Window1.xaml#_textelement_typogxaml)] - The following figure shows how this example renders. +The following figure shows how this example renders. - ![Screenshot: Text element with altered typography](./media/textelement-typog.png "TextElement_Typog") + ![Screenshot: Text element with altered typography](./media/textelement-typog.png "TextElement_Typog") - In contrast, the following figure shows how a similar example with default typographic properties renders. +In contrast, the following figure shows how a similar example with default typographic properties renders. - ![Screenshot: Text element with default typography](./media/textelement-typog-default.png "TextElement_Typog_Default") + ![Screenshot: Text element with default typography](./media/textelement-typog-default.png "TextElement_Typog_Default") -## Example 2: To show how to set typographic property of text programmatically + ![Screenshot: Text element with default typography](./media/textelement-typog-default.png "TextElement_Typog_Default") + +## Example 3: To show how to set typographic property of text programmatically The following example shows how to set the property programmatically. diff --git a/dotnet-desktop-guide/framework/wpf/advanced/typography.md b/dotnet-desktop-guide/framework/wpf/advanced/typography.md index 933537d7be..2ce16f76e8 100644 --- a/dotnet-desktop-guide/framework/wpf/advanced/typography.md +++ b/dotnet-desktop-guide/framework/wpf/advanced/typography.md @@ -10,9 +10,11 @@ helpviewer_keywords: ms.assetid: e4ef38db-b7d1-4bda-87ab-8bb738440ddc --- # Typography + [!INCLUDE[TLA#tla_winclient](../../../includes/tlasharptla-winclient-md.md)] includes support for rich presentation of text content. Text in [!INCLUDE[TLA2#tla_winclient](../../../includes/tla2sharptla-winclient-md.md)] is rendered using Microsoft ClearType, which enhances the clarity and readability of text. [!INCLUDE[TLA2#tla_winclient](../../../includes/tla2sharptla-winclient-md.md)] also supports OpenType fonts, which provide additional capabilities beyond those defined by the TrueType® format. -## In This Section +## In This Section + [Typography in WPF](typography-in-wpf.md) [ClearType Overview](cleartype-overview.md) [ClearType Registry Settings](cleartype-registry-settings.md)