mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 00:56:03 +02:00
Merge pull request #1318 from dotnet/publish-16699
Merge main into live
This commit is contained in:
+57
-55
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Default keyboard and mouse handling in DataGridView control
|
||||
ms.date: "02/13/2018"
|
||||
title: Keyboard and mouse behavior in DataGridView control
|
||||
description: Describes how the keyboard and mouse interacts with the DataGridView control in Windows Forms, including accessibility keyboard shortcuts.
|
||||
ms.date: "02/08/2022"
|
||||
helpviewer_keywords:
|
||||
- "data grids [Windows Forms], mouse handling"
|
||||
- "DataGridView control [Windows Forms], navigation keys"
|
||||
@@ -11,7 +12,7 @@ helpviewer_keywords:
|
||||
- "navigation keys [Windows Forms], DataGridView control"
|
||||
ms.assetid: 4519b928-bfc8-4e8b-bb9c-b1e76a0ca552
|
||||
---
|
||||
# Default keyboard and mouse handling in the Windows Forms DataGridView control
|
||||
# Default keyboard and mouse behavior with the DataGridView control
|
||||
|
||||
The following tables describe how users can interact with the <xref:System.Windows.Forms.DataGridView> control through a keyboard and a mouse.
|
||||
|
||||
@@ -22,50 +23,51 @@ The following tables describe how users can interact with the <xref:System.Windo
|
||||
|
||||
### Basic navigation and entry keys
|
||||
|
||||
|Key or key combination|Description|
|
||||
|----------------------------|-----------------|
|
||||
|DOWN ARROW|Moves the focus to the cell directly below the current cell. If the focus is in the last row, does nothing.|
|
||||
|LEFT ARROW|Moves the focus to the previous cell in the row. If the focus is in the first cell in the row, does nothing.|
|
||||
|RIGHT ARROW|Moves the focus to the next cell in the row. If the focus is in the last cell in the row, does nothing.|
|
||||
|UP ARROW|Moves the focus to the cell directly above the current cell. If the focus is in the first row, does nothing.|
|
||||
|HOME|Moves the focus to the first cell in the current row.|
|
||||
|END|Moves the focus to the last cell in the current row.|
|
||||
|PAGE DOWN|Scrolls the control downward by the number of rows that are fully displayed. Moves the focus to the last fully displayed row without changing columns.|
|
||||
|PAGE UP|Scrolls the control upward by the number of rows that are fully displayed. Moves focus to the first displayed row without changing columns.|
|
||||
|TAB|If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the next cell in the current row. If the focus is already in the last cell of the row, moves the focus to the first cell in the next row. If the focus is in the last cell in the control, moves the focus to the next control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the next control in the tab order of the parent container.|
|
||||
|SHIFT+TAB|If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the previous cell in the current row. If the focus is already in the first cell of the row, moves the focus to the last cell in the previous row. If the focus is in the first cell in the control, moves the focus to the previous control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the previous control in the tab order of the parent container.|
|
||||
|CTRL+TAB|If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the next control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the next cell in the current row. If the focus is already in the last cell of the row, moves the focus to the first cell in the next row. If the focus is in the last cell in the control, moves the focus to the next control in the tab order of the parent container.|
|
||||
|CTRL+SHIFT+TAB|If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the previous control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the previous cell in the current row. If the focus is already in the first cell of the row, moves the focus to the last cell in the previous row. If the focus is in the first cell in the control, moves the focus to the previous control in the tab order of the parent container.|
|
||||
|CTRL+ARROW|Moves the focus to the farthest cell in the direction of the arrow.|
|
||||
|CTRL+HOME|Moves the focus to the first cell in the control.|
|
||||
|CTRL+END|Moves the focus to the last cell in the control.|
|
||||
|CTRL+PAGE DOWN/UP|Same as PAGE DOWN or PAGE UP.|
|
||||
|F2|Puts the current cell into cell edit mode if the <xref:System.Windows.Forms.DataGridView.EditMode%2A> property value is <xref:System.Windows.Forms.DataGridViewEditMode.EditOnF2> or <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2>.|
|
||||
|F3|Sorts the current column if the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A?displayProperty=nameWithType> property value is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. It's the same as clicking the current column header. Available since .NET Framework 4.7.2. To enable this feature, applications must target .NET Framework 4.7.2 or later versions or explicitly opt into accessibility improvements using AppContext switches.|
|
||||
|F4|If the current cell is a <xref:System.Windows.Forms.DataGridViewComboBoxCell>, puts the cell into edit mode and displays the drop-down list.|
|
||||
|ALT+UP/DOWN ARROW|If the current cell is a <xref:System.Windows.Forms.DataGridViewComboBoxCell>, puts the cell into edit mode and displays the drop-down list.|
|
||||
|SPACE|If the current cell is a <xref:System.Windows.Forms.DataGridViewButtonCell>, <xref:System.Windows.Forms.DataGridViewLinkCell>, or <xref:System.Windows.Forms.DataGridViewCheckBoxCell>, raises the <xref:System.Windows.Forms.DataGridView.CellClick> and <xref:System.Windows.Forms.DataGridView.CellContentClick> events. If the current cell is a <xref:System.Windows.Forms.DataGridViewButtonCell>, also presses the button. If the current cell is a <xref:System.Windows.Forms.DataGridViewCheckBoxCell>, also changes the check state.|
|
||||
|ENTER|Commits any changes to the current cell and row and moves the focus to the cell directly below the current cell. If the focus is in the last row, commits any changes without moving the focus.|
|
||||
|ESC|If the control is in edit mode, cancels the edit. If the control is not in edit mode, reverts any changes that have been made to the current row if the control is bound to a data source that supports editing or virtual mode has been implemented with row-level commit scope.|
|
||||
|BACKSPACE|Deletes the character before the insertion point when editing a cell.|
|
||||
|DELETE|Deletes the character after the insertion point when editing a cell.|
|
||||
|CTRL+ENTER|Commits any changes to the current cell without moving the focus. Also commits any changes to the current row if the control is bound to a data source that supports editing or virtual mode has been implemented with row-level commit scope.|
|
||||
|CTRL+0|Enters a <xref:System.DBNull.Value?displayProperty=nameWithType> value into the current cell if the cell can be edited. By default, the display value for a <xref:System.DBNull> cell value is the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> in effect for the current cell.|
|
||||
|
||||
| Key or key combination | Description |
|
||||
|-----------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
|
||||
| <kbd>Down arrow</kbd> | Moves the focus to the cell directly below the current cell. If the focus is in the last row, does nothing. |
|
||||
| <kbd>Left arrow</kbd> | Moves the focus to the previous cell in the row. If the focus is in the first cell in the row, does nothing. |
|
||||
| <kbd>Right arrow</kbd> | Moves the focus to the next cell in the row. If the focus is in the last cell in the row, does nothing. |
|
||||
| <kbd>Up arrow</kbd> | Moves the focus to the cell directly above the current cell. If the focus is in the first row, does nothing. |
|
||||
| <kbd>Home</kbd> | Moves the focus to the first cell in the current row. |
|
||||
| <kbd>End</kbd> | Moves the focus to the last cell in the current row. |
|
||||
| <kbd>Page down</kbd> | Scrolls the control downward by the number of rows that are fully displayed. Moves the focus to the last fully displayed row without changing columns. |
|
||||
| <kbd>Page up</kbd> | Scrolls the control upward by the number of rows that are fully displayed. Moves focus to the first displayed row without changing columns. |
|
||||
| <kbd>Tab</kbd> | If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the next cell in the current row. If the focus is already in the last cell of the row, moves the focus to the first cell in the next row. If the focus is in the last cell in the control, moves the focus to the next control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the next control in the tab order of the parent container. |
|
||||
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the previous cell in the current row. If the focus is already in the first cell of the row, moves the focus to the last cell in the previous row. If the focus is in the first cell in the control, moves the focus to the previous control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the previous control in the tab order of the parent container. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Tab</kbd> | If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the next control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the next cell in the current row. If the focus is already in the last cell of the row, moves the focus to the first cell in the next row. If the focus is in the last cell in the control, moves the focus to the next control in the tab order of the parent container. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd> | If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `false`, moves the focus to the previous control in the tab order of the parent container.<br /><br /> If the <xref:System.Windows.Forms.DataGridView.StandardTab%2A> property value is `true`, moves the focus to the previous cell in the current row. If the focus is already in the first cell of the row, moves the focus to the last cell in the previous row. If the focus is in the first cell in the control, moves the focus to the previous control in the tab order of the parent container. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>arrow</kbd> | Moves the focus to the farthest cell in the direction of the arrow. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Home</kbd> | Moves the focus to the first cell in the control. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>End</kbd> | Moves the focus to the last cell in the control. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Page down/up</kbd> | Same as <kbd>Page down</kbd> or <kbd>Page up</kbd>. |
|
||||
| <kbd>F2</kbd> | Puts the current cell into cell edit mode if the <xref:System.Windows.Forms.DataGridView.EditMode%2A> property value is <xref:System.Windows.Forms.DataGridViewEditMode.EditOnF2> or <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2>. |
|
||||
| <kbd>F3</kbd> | Sorts the current column if the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A?displayProperty=nameWithType> property value is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. It's the same as clicking the current column header. Available since .NET Framework 4.7.2. To enable this feature, applications must target .NET Framework 4.7.2 or later versions or explicitly opt into accessibility improvements using AppContext switches. |
|
||||
| <kbd>F4</kbd> | If the current cell is a <xref:System.Windows.Forms.DataGridViewComboBoxCell>, puts the cell into edit mode and displays the drop-down list. |
|
||||
| <kbd>Alt</kbd> + <kbd>Up/Down arrow</kbd> | If the current cell is a <xref:System.Windows.Forms.DataGridViewComboBoxCell>, puts the cell into edit mode and displays the drop-down list. |
|
||||
| <kbd>Alt</kbd> + <kbd>Left/Right arrow</kbd> | Increases or decreases the width of the current cell's column. |
|
||||
| <kbd>Space</kbd> | If the current cell is a <xref:System.Windows.Forms.DataGridViewButtonCell>, <xref:System.Windows.Forms.DataGridViewLinkCell>, or <xref:System.Windows.Forms.DataGridViewCheckBoxCell>, raises the <xref:System.Windows.Forms.DataGridView.CellClick> and <xref:System.Windows.Forms.DataGridView.CellContentClick> events. If the current cell is a <xref:System.Windows.Forms.DataGridViewButtonCell>, also presses the button. If the current cell is a <xref:System.Windows.Forms.DataGridViewCheckBoxCell>, also changes the check state. |
|
||||
| <kbd>Enter</kbd> | Commits any changes to the current cell and row and moves the focus to the cell directly below the current cell. If the focus is in the last row, commits any changes without moving the focus. |
|
||||
| <kbd>Esc</kbd> | If the control is in edit mode, cancels the edit. If the control is not in edit mode, reverts any changes that have been made to the current row if the control is bound to a data source that supports editing or virtual mode has been implemented with row-level commit scope. |
|
||||
| <kbd>Backspace</kbd> | Deletes the character before the insertion point when editing a cell. |
|
||||
| <kbd>Delete</kbd> | Deletes the character after the insertion point when editing a cell. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>Enter</kbd> | Commits any changes to the current cell without moving the focus. Also commits any changes to the current row if the control is bound to a data source that supports editing or virtual mode has been implemented with row-level commit scope. |
|
||||
| <kbd>Ctrl</kbd> + <kbd>0</kbd> | Enters a <xref:System.DBNull.Value?displayProperty=nameWithType> value into the current cell if the cell can be edited. By default, the display value for a <xref:System.DBNull> cell value is the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> in effect for the current cell. |
|
||||
|
||||
### Selection keys
|
||||
|
||||
If the <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> property is set to `false` and the <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> property is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.CellSelect>, changing the current cell by using the navigation keys changes the selection to the new cell. The SHIFT, CTRL, and ALT keys do not affect this behavior.
|
||||
If the <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> property is set to `false` and the <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> property is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.CellSelect>, changing the current cell by using the navigation keys changes the selection to the new cell. The <kbd>Shift</kbd>, <kbd>Ctrl</kbd>, and <kbd>Alt</kbd> keys do not affect this behavior.
|
||||
|
||||
If the <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect>, the same behavior occurs but with the following additions.
|
||||
|
||||
|Key or key combination|Description|
|
||||
|----------------------------|-----------------|
|
||||
|SHIFT+SPACEBAR|Selects the full row or column (the same as clicking the row or column header).|
|
||||
|navigation key (arrow key, PAGE UP/DOWN, HOME, END)|If a full row or column is selected, changing the current cell to a new row or column moves the selection to the full new row or column (depending on the selection mode).|
|
||||
| Key or key combination | Description |
|
||||
|-------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| <kbd>Shift</kbd> + <kbd>Spacebar</kbd> | Selects the full row or column (the same as clicking the row or column header). |
|
||||
| navigation key (<kbd>arrow key</kbd>, <kbd>Page up/down</kbd>, <kbd>Home</kbd>, <kbd>End</kbd>) | If a full row or column is selected, changing the current cell to a new row or column moves the selection to the full new row or column (depending on the selection mode). |
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `false` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, changing the current cell to a new row or column by using the keyboard moves the selection to the full new row or column. The SHIFT, CTRL, and ALT keys do not affect this behavior.
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `false` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, changing the current cell to a new row or column by using the keyboard moves the selection to the full new row or column. The <kbd>Shift</kbd>, <kbd>Ctrl</kbd>, and <kbd>Alt</kbd> keys do not affect this behavior.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true`, the navigation behavior does not change, but navigating with the keyboard while pressing SHIFT (including CTRL+SHIFT) will modify a multi-cell selection. Before navigation begins, the control marks the current cell as an anchor cell. When you navigate while pressing SHIFT, the selection includes all cells between the anchor cell and the current cell. Other cells in the control will remain selected if they were already selected, but they may become unselected if the keyboard navigation temporarily puts them between the anchor cell and the current cell.
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true`, the navigation behavior does not change, but navigating with the keyboard while pressing <kbd>Shift</kbd> (including <kbd>Ctrl</kbd> + <kbd>Shift</kbd>) will modify a multi-cell selection. Before navigation begins, the control marks the current cell as an anchor cell. When you navigate while pressing <kbd>Shift</kbd>, the selection includes all cells between the anchor cell and the current cell. Other cells in the control will remain selected if they were already selected, but they may become unselected if the keyboard navigation temporarily puts them between the anchor cell and the current cell.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, the behavior of the anchor cell and current cell is the same, but only full rows or columns become selected or unselected.
|
||||
|
||||
@@ -76,12 +78,12 @@ The following tables describe how users can interact with the <xref:System.Windo
|
||||
> [!NOTE]
|
||||
> Clicking a cell with the left mouse button always changes the current cell. Clicking a cell with the right mouse button opens a shortcut menu, when one is available.
|
||||
|
||||
|Mouse action|Description|
|
||||
|------------------|-----------------|
|
||||
|Left mouse button down|Makes the clicked cell the current cell, and raises the <xref:System.Windows.Forms.DataGridView.CellMouseDown?displayProperty=nameWithType> event.|
|
||||
|Left mouse button up|Raises the <xref:System.Windows.Forms.DataGridView.CellMouseUp?displayProperty=nameWithType> event|
|
||||
|Left mouse button click|Raises the <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> and <xref:System.Windows.Forms.DataGridView.CellMouseClick?displayProperty=nameWithType> events|
|
||||
|Left mouse button down, and drag on a column header cell|If the <xref:System.Windows.Forms.DataGridView.AllowUserToOrderColumns%2A?displayProperty=nameWithType> property is `true`, moves the column so that it can be dropped into a new position.|
|
||||
| Mouse action | Description |
|
||||
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Left mouse button down | Makes the clicked cell the current cell, and raises the <xref:System.Windows.Forms.DataGridView.CellMouseDown?displayProperty=nameWithType> event. |
|
||||
| Left mouse button up | Raises the <xref:System.Windows.Forms.DataGridView.CellMouseUp?displayProperty=nameWithType> event |
|
||||
| Left mouse button click | Raises the <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> and <xref:System.Windows.Forms.DataGridView.CellMouseClick?displayProperty=nameWithType> events |
|
||||
| Left mouse button down, and drag on a column header cell | If the <xref:System.Windows.Forms.DataGridView.AllowUserToOrderColumns%2A?displayProperty=nameWithType> property is `true`, moves the column so that it can be dropped into a new position. |
|
||||
|
||||
### Mouse selection
|
||||
|
||||
@@ -89,24 +91,24 @@ The following tables describe how users can interact with the <xref:System.Windo
|
||||
|
||||
If the <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> property is set to `false` and the <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> property is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.CellSelect>, the following behavior occurs.
|
||||
|
||||
|Mouse action|Description|
|
||||
|------------------|-----------------|
|
||||
|Click left mouse button|Selects only the current cell if the user clicks a cell. No selection behavior if the user clicks a row or column header.|
|
||||
|Click right mouse button|Displays a shortcut menu if one is available.|
|
||||
| Mouse action | Description |
|
||||
|--------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| Click | Selects only the current cell if the user clicks a cell. No selection behavior if the user clicks a row or column header. |
|
||||
| Right-click | Displays a shortcut menu if one is available. |
|
||||
|
||||
The same behavior occurs when the <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect>, except that, depending on the selection mode, clicking a row or column header will select the full row or column and set the current cell to the first cell in the row or column.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, clicking any cell in a row or column will select the full row or column.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true`, clicking a cell while pressing CTRL or SHIFT will modify a multi-cell selection.
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true`, clicking a cell while pressing <kbd>Ctrl</kbd> or <kbd>Shift</kbd> will modify a multi-cell selection.
|
||||
|
||||
When you click a cell while pressing CTRL, the cell will change its selection state while all other cells retain their current selection state.
|
||||
When you click a cell while pressing <kbd>Ctrl</kbd>, the cell will change its selection state while all other cells retain their current selection state.
|
||||
|
||||
When you click a cell or a series of cells while pressing SHIFT, the selection includes all cells between the current cell and an anchor cell located at the position of the current cell before the first click. When you click and drag the pointer across multiple cells, the anchor cell is the cell clicked at the beginning of the drag operation. Subsequent clicks while pressing SHIFT change the current cell, but not the anchor cell. Other cells in the control will remain selected if they were already selected, but they may become unselected if mouse navigation temporarily puts them between the anchor cell and the current cell.
|
||||
When you click a cell or a series of cells while pressing <kbd>Shift</kbd>, the selection includes all cells between the current cell and an anchor cell located at the position of the current cell before the first click. When you click and drag the pointer across multiple cells, the anchor cell is the cell clicked at the beginning of the drag operation. Subsequent clicks while pressing <kbd>Shift</kbd> change the current cell, but not the anchor cell. Other cells in the control will remain selected if they were already selected, but they may become unselected if mouse navigation temporarily puts them between the anchor cell and the current cell.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect>, clicking a row or column header (depending on the selection mode) while pressing SHIFT will modify an existing selection of full rows or columns if such a selection exists. Otherwise, it will clear the selection and start a new selection of full rows or columns. Clicking a row or column header while pressing CTRL, however, will add or remove the clicked row or column from the current selection without otherwise modifying the current selection.
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect>, clicking a row or column header (depending on the selection mode) while pressing <kbd>Shift</kbd> will modify an existing selection of full rows or columns if such a selection exists. Otherwise, it will clear the selection and start a new selection of full rows or columns. Clicking a row or column header while pressing <kbd>Ctrl</kbd>, however, will add or remove the clicked row or column from the current selection without otherwise modifying the current selection.
|
||||
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, clicking a cell while pressing SHIFT or CTRL behaves the same way except that only full rows and columns are affected.
|
||||
If <xref:System.Windows.Forms.DataGridView.MultiSelect%2A> is set to `true` and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A> is set to <xref:System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect> or <xref:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect>, clicking a cell while pressing <kbd>Shift</kbd> or <kbd>Ctrl</kbd> behaves the same way except that only full rows and columns are affected.
|
||||
|
||||
## See also
|
||||
|
||||
|
||||
+8
-6
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Build a Table Programmatically"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to build a table programmatically.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -11,13 +13,13 @@ ms.assetid: e3ca88f3-6e94-4b61-82fc-42104c10b761
|
||||
# How to: Build a Table Programmatically
|
||||
The following examples show how to programmatically create a <xref:System.Windows.Documents.Table> and populate it with content. The contents of the table are apportioned into five rows (represented by <xref:System.Windows.Documents.TableRow> objects contained in a <xref:System.Windows.Documents.Table.RowGroups%2A> object) and six columns (represented by <xref:System.Windows.Documents.TableColumn> objects). The rows are used for different presentation purposes, including a title row intended to title the entire table, a header row to describe the columns of data in the table, and a footer row with summary information. Note that the notion of "title", "header", and "footer" rows are not inherent to the table; these are simply rows with different characteristics. Table cells contain the actual content, which can be comprised of text, images, or nearly any other [!INCLUDE[TLA#tla_ui](../../../includes/tlasharptla-ui-md.md)] element.
|
||||
|
||||
## Example
|
||||
## Create a table
|
||||
First, a <xref:System.Windows.Documents.FlowDocument> is created to host the <xref:System.Windows.Documents.Table>, and a new <xref:System.Windows.Documents.Table> is created and added to the contents of the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[TableSnippets#_TableCreate](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tablecreate)]
|
||||
[!code-vb[TableSnippets#_TableCreate](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets/VisualBasic/Table.vb#_tablecreate)]
|
||||
|
||||
## Example
|
||||
## Add columns
|
||||
Next, six <xref:System.Windows.Documents.TableColumn> objects are created and added to the table's <xref:System.Windows.Documents.Table.Columns%2A> collection, with some formatting applied.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -26,25 +28,25 @@ The following examples show how to programmatically create a <xref:System.Window
|
||||
[!code-csharp[TableSnippets#_TableCreateColumns](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tablecreatecolumns)]
|
||||
[!code-vb[TableSnippets#_TableCreateColumns](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets/VisualBasic/Table.vb#_tablecreatecolumns)]
|
||||
|
||||
## Example
|
||||
## Add a title row
|
||||
Next, a title row is created and added to the table with some formatting applied. The title row happens to contain a single cell that spans all six columns in the table.
|
||||
|
||||
[!code-csharp[TableSnippets#_TableAddTitleRow](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tableaddtitlerow)]
|
||||
[!code-vb[TableSnippets#_TableAddTitleRow](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets/VisualBasic/Table.vb#_tableaddtitlerow)]
|
||||
|
||||
## Example
|
||||
## Add a header row
|
||||
Next, a header row is created and added to the table, and the cells in the header row are created and populated with content.
|
||||
|
||||
[!code-csharp[TableSnippets#_TableAddHeaderRow](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tableaddheaderrow)]
|
||||
[!code-vb[TableSnippets#_TableAddHeaderRow](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets/VisualBasic/Table.vb#_tableaddheaderrow)]
|
||||
|
||||
## Example
|
||||
## Add a row
|
||||
Next, a row for data is created and added to the table, and the cells in this row are created and populated with content. Building this row is similar to building the header row, with slightly different formatting applied.
|
||||
|
||||
[!code-csharp[TableSnippets#_TableAddDataRow](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tableadddatarow)]
|
||||
[!code-vb[TableSnippets#_TableAddDataRow](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets/VisualBasic/Table.vb#_tableadddatarow)]
|
||||
|
||||
## Example
|
||||
## Add a footer row
|
||||
Finally, a footer row is created, added, and formatted. Like the title row, the footer contains a single cell that spans all six columns in the table.
|
||||
|
||||
[!code-csharp[TableSnippets#_TableAddFooterRow](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets/CSharp/Table.cs#_tableaddfooterrow)]
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Change the FlowDirection of Content Programmatically"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to change the FlowDirection of content programmatically.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -12,12 +14,12 @@ ms.assetid: 02f5a8ba-f8c0-4e5a-84b9-4c5bf12922a2
|
||||
# How to: Change the FlowDirection of Content Programmatically
|
||||
This example shows how to programmatically change the <xref:System.Windows.FrameworkElement.FlowDirection%2A> property of a <xref:System.Windows.Controls.FlowDocumentReader>.
|
||||
|
||||
## Example
|
||||
## Create button elements
|
||||
Two <xref:System.Windows.Controls.Button> elements are created, each representing one of the possible values of <xref:System.Windows.FlowDirection>. When a button is clicked, the associated property value is applied to the contents of a <xref:System.Windows.Controls.FlowDocumentReader> named `tf1`. The property value is also written to a <xref:System.Windows.Controls.TextBlock> named `txt1`.
|
||||
|
||||
[!code-xaml[FlowDirectionSnippets#_FlowDirectionXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDirectionSnippets/CSharp/Window1.xaml#_flowdirectionxaml)]
|
||||
|
||||
## Example
|
||||
## C# code example
|
||||
The events associated with the button clicks defined above are handled in a C# code-behind file.
|
||||
|
||||
[!code-csharp[FlowDirectionSnippets#_FlowDirection](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDirectionSnippets/CSharp/Window1.xaml.cs#_flowdirection)]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Create a Data Object"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to create a Data Object.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -13,7 +15,7 @@ ms.assetid: 022fa142-717d-4fea-a53c-3b52e9d91aff
|
||||
# How to: Create a Data Object
|
||||
The following examples show various ways to create a data object using the constructors provided by the <xref:System.Windows.DataObject> class.
|
||||
|
||||
## Example
|
||||
## DataObject(Object) constructor
|
||||
|
||||
### Description
|
||||
The following example code creates a new data object and uses one of the overloaded constructors (<xref:System.Windows.DataObject.%23ctor%28System.Object%29>) to initialize the data object with a string. In this case, an appropriate data format is determined automatically according to the stored data's type, and auto-converting of the stored data is allowed by default.
|
||||
@@ -29,7 +31,7 @@ The following examples show various ways to create a data object using the const
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_Simple_Condensed](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_createdataobject_simple_condensed)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_Simple_Condensed](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_createdataobject_simple_condensed)]
|
||||
|
||||
## Example
|
||||
## DataObject(String, Object) constructor
|
||||
|
||||
### Description
|
||||
The following example code creates a new data object and uses one of the overloaded constructors (<xref:System.Windows.DataObject.%23ctor%28System.String%2CSystem.Object%29>) to initialize the data object with a string and a specified data format. In this case the data format is specified by a string; the <xref:System.Windows.DataFormats> class provides a set of pre-defined type strings. Auto-converting of the stored data is allowed by default.
|
||||
@@ -45,7 +47,7 @@ The following examples show various ways to create a data object using the const
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_TypeString_Condensed](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_createdataobject_typestring_condensed)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_TypeString_Condensed](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_createdataobject_typestring_condensed)]
|
||||
|
||||
## Example
|
||||
## DataObject() constructor
|
||||
|
||||
### Description
|
||||
The following example code creates a new data object and uses one of the overloaded constructors (<xref:System.Windows.DataObject.%23ctor%2A>) to initialize the data object with a string and a specified data format. In this case the data format is specified by a <xref:System.Type> parameter. Auto-converting of the stored data is allowed by default.
|
||||
@@ -61,7 +63,7 @@ The following examples show various ways to create a data object using the const
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_Type_Condensed](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_createdataobject_type_condensed)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_CreateDataObject_Type_Condensed](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_createdataobject_type_condensed)]
|
||||
|
||||
## Example
|
||||
## DataObject(String, Object, Boolean) constructor
|
||||
|
||||
### Description
|
||||
The following example code creates a new data object and uses one of the overloaded constructors (<xref:System.Windows.DataObject.%23ctor%28System.String%2CSystem.Object%2CSystem.Boolean%29>) to initialize the data object with a string and a specified data format. In this case the data format is specified by a string; the <xref:System.Windows.DataFormats> class provides a set of pre-defined type strings. This particular constructor overload enables the caller to specify whether auto-converting is allowed.
|
||||
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Determine if a Data Format is Present in a Data Object"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to determine if a Data Format is present in a Data Object.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -13,7 +15,7 @@ ms.assetid: e487a454-c9fc-4e53-aeaa-c458d059ad4c
|
||||
# How to: Determine if a Data Format is Present in a Data Object
|
||||
The following examples show how to use the various <xref:System.Windows.DataObject.GetDataPresent%2A> method overloads to query whether a particular data format is present in a data object.
|
||||
|
||||
## Example
|
||||
## GetDataPresent(String) overload
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetDataPresent%28System.String%29> overload to query for the presence of a particular data format by descriptor string.
|
||||
@@ -22,7 +24,7 @@ The following examples show how to use the various <xref:System.Windows.DataObje
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_String](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_querydataformats_string)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_String](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_querydataformats_string)]
|
||||
|
||||
## Example
|
||||
## GetDataPresent(Type) overload
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetDataPresent%28System.Type%29> overload to query for the presence of a particular data format by type.
|
||||
@@ -31,7 +33,7 @@ The following examples show how to use the various <xref:System.Windows.DataObje
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Type](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_querydataformats_type)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_QueryDataFormats_Type](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_querydataformats_type)]
|
||||
|
||||
## Example
|
||||
## GetDataPresent(String, Boolean) overload
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetDataPresent%28System.String%2CSystem.Boolean%29> overload to query for data by descriptor string, and specifying how to treat auto-convertible data formats.
|
||||
|
||||
+6
-4
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Flip a UIElement Horizontally or Vertically"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to flip a UIElement horizontally or vertically.
|
||||
helpviewer_keywords:
|
||||
- "flipping UIElements [WPF]"
|
||||
- "UIElements [WPF], flipping"
|
||||
@@ -9,7 +11,7 @@ ms.assetid: 02c6730f-65c0-40d5-a553-4cb663721882
|
||||
# How to: Flip a UIElement Horizontally or Vertically
|
||||
This example shows how to use a <xref:System.Windows.Media.ScaleTransform> to flip a <xref:System.Windows.UIElement> horizontally or vertically. In this example, a <xref:System.Windows.Controls.Button> control (a type of <xref:System.Windows.UIElement>) is flipped by applying a <xref:System.Windows.Media.ScaleTransform> to its <xref:System.Windows.UIElement.RenderTransform%2A> property.
|
||||
|
||||
## Example
|
||||
## Illustration to flip a button
|
||||
The following illustration shows the button to flip.
|
||||
|
||||

|
||||
@@ -19,7 +21,7 @@ The UIElement to flip
|
||||
|
||||
[!code-xaml[Transforms_snip#GraphicsMMButtonWithoutFlip](~/samples/snippets/csharp/VS_Snippets_Wpf/Transforms_snip/CS/FlipExample.xaml#graphicsmmbuttonwithoutflip)]
|
||||
|
||||
## Example
|
||||
## Illustration to flip a button horizontally
|
||||
To flip the button horizontally, create a <xref:System.Windows.Media.ScaleTransform> and set its <xref:System.Windows.Media.ScaleTransform.ScaleX%2A> property to -1. Apply the <xref:System.Windows.Media.ScaleTransform> to the button's <xref:System.Windows.UIElement.RenderTransform%2A> property.
|
||||
|
||||
[!code-xaml[Transforms_snip#GraphicsMMFlipButtonExample1](~/samples/snippets/csharp/VS_Snippets_Wpf/Transforms_snip/CS/FlipExample.xaml#graphicsmmflipbuttonexample1)]
|
||||
@@ -27,7 +29,7 @@ The UIElement to flip
|
||||

|
||||
The button after applying the ScaleTransform
|
||||
|
||||
## Example
|
||||
## Illustration to flip a button at its place
|
||||
As you can see from the previous illustration, the button was flipped, but it was also moved. That's because the button was flipped from its top left corner. To flip the button in place, you want to apply the <xref:System.Windows.Media.ScaleTransform> to its center, not its corner. An easy way to apply the <xref:System.Windows.Media.ScaleTransform> to the buttons center is to set the button's <xref:System.Windows.UIElement.RenderTransformOrigin%2A> property to 0.5, 0.5.
|
||||
|
||||
[!code-xaml[Transforms_snip#GraphicsMMFlipButtonExample2](~/samples/snippets/csharp/VS_Snippets_Wpf/Transforms_snip/CS/FlipExample.xaml#graphicsmmflipbuttonexample2)]
|
||||
@@ -35,7 +37,7 @@ The button after applying the ScaleTransform
|
||||

|
||||
The button with a RenderTransformOrigin of 0.5, 0.5
|
||||
|
||||
## Example
|
||||
## Illustration to flip a button vertically
|
||||
To flip the button vertically, set the <xref:System.Windows.Media.ScaleTransform> object's <xref:System.Windows.Media.ScaleTransform.ScaleY%2A> property instead of its <xref:System.Windows.Media.ScaleTransform.ScaleX%2A> property.
|
||||
|
||||
[!code-xaml[Transforms_snip#GraphicsMMVerticalFlipButtonExample2](~/samples/snippets/csharp/VS_Snippets_Wpf/Transforms_snip/CS/FlipExample.xaml#graphicsmmverticalflipbuttonexample2)]
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: List the Data Formats in a Data Object"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to list the Data Formats in a Data Object.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -13,7 +15,7 @@ ms.assetid: 18e7ba4b-ccef-4815-ae2d-3a32891010c0
|
||||
# How to: List the Data Formats in a Data Object
|
||||
The following examples show how to use the <xref:System.Windows.DataObject.GetFormats%2A> method overloads get an array of strings denoting each data format that is available in a data object.
|
||||
|
||||
## Example
|
||||
## GetFormats() overload for all Data Formats
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetFormats%2A> overload to get an array of strings denoting all data formats available in a data object (both native and auto-convertible).
|
||||
@@ -22,7 +24,7 @@ The following examples show how to use the <xref:System.Windows.DataObject.GetFo
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_GetAllDataFormats](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_getalldataformats)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_GetAllDataFormats](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_getalldataformats)]
|
||||
|
||||
## Example
|
||||
## GetFormats() overload for native Data Formats
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetFormats%2A> overload to get an array of strings denoting only data formats available in a data object (auto-convertible data formats are filtered).
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Localize an app
|
||||
ms.date: 03/30/2017
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to localize an application.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -103,8 +105,8 @@ Now that you have created the LocBaml tool, you are ready to use it to parse Hel
|
||||
|
||||
3. When you run LocBaml to parse files, the output consists of seven fields delimited by commas (.csv files) or tabs (.txt files). The following shows the parsed .csv file for the HelloApp.resources.dll:
|
||||
|
||||
| |
|
||||
|-|
|
||||
| Parsed .csv file |
|
||||
|------------------|
|
||||
|HelloApp.g.en-US.resources:window1.baml,Stack1:System.Windows.Controls.StackPanel.$Content,Ignore,FALSE, FALSE,,#Text1;#Text2;|
|
||||
|HelloApp.g.en-US.resources:window1.baml,Text1:System.Windows.Controls.TextBlock.$Content,None,TRUE, TRUE,,Hello World|
|
||||
|HelloApp.g.en-US.resources:window1.baml,Text2:System.Windows.Controls.TextBlock.$Content,None,TRUE, TRUE,,Goodbye World|
|
||||
|
||||
+7
-5
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Manipulate a FlowDocument through the Blocks Property"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to manipulate a FlowDocument through the Blocks property.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -12,31 +14,31 @@ ms.assetid: cbb7291e-3f1b-433e-9e16-f4d93ced14e8
|
||||
# How to: Manipulate a FlowDocument through the Blocks Property
|
||||
These examples demonstrate some of the more common operations that can be performed on a <xref:System.Windows.Documents.FlowDocument> through the <xref:System.Windows.Documents.FlowDocument.Blocks%2A> property.
|
||||
|
||||
## Example
|
||||
## Create a new FlowDocument
|
||||
The following example creates a new <xref:System.Windows.Documents.FlowDocument> and then appends a new <xref:System.Windows.Documents.Paragraph> element to the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_FlowDocumentBlocksAdd](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_flowdocumentblocksadd)]
|
||||
[!code-vb[FlowDocumentSnippets#_FlowDocumentBlocksAdd](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_flowdocumentblocksadd)]
|
||||
|
||||
## Example
|
||||
## Create a new Paragraph element
|
||||
The following example creates a new <xref:System.Windows.Documents.Paragraph> element and inserts it at the beginning of the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_FlowDocumentBlocksInsert](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_flowdocumentblocksinsert)]
|
||||
[!code-vb[FlowDocumentSnippets#_FlowDocumentBlocksInsert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_flowdocumentblocksinsert)]
|
||||
|
||||
## Example
|
||||
## Get top-level Block elements
|
||||
The following example gets the number of top-level <xref:System.Windows.Documents.Block> elements contained in the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_FlowDocumentBlocksCount](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_flowdocumentblockscount)]
|
||||
[!code-vb[FlowDocumentSnippets#_FlowDocumentBlocksCount](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_flowdocumentblockscount)]
|
||||
|
||||
## Example
|
||||
## Delete the last Block element
|
||||
The following example deletes the last <xref:System.Windows.Documents.Block> element in the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_FlowDocumentBlocksRemoveLast](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_flowdocumentblocksremovelast)]
|
||||
[!code-vb[FlowDocumentSnippets#_FlowDocumentBlocksRemoveLast](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_flowdocumentblocksremovelast)]
|
||||
|
||||
## Example
|
||||
## Clear all the Block contents
|
||||
The following example clears all of the contents (<xref:System.Windows.Documents.Block> elements) from the <xref:System.Windows.Documents.FlowDocument>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_FlowDocumentBlocksClear](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_flowdocumentblocksclear)]
|
||||
|
||||
+7
-5
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Manipulate Flow Content Elements through the Blocks Property"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to manipulate Flow Content Elements through the Blocks property.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -26,31 +28,31 @@ These examples demonstrate some of the more common operations that can be perfor
|
||||
|
||||
These examples happen to use <xref:System.Windows.Documents.Section> as the flow content element, but these techniques are applicable to all elements that host a flow content element collection.
|
||||
|
||||
## Example
|
||||
## Create a new Section
|
||||
The following example creates a new <xref:System.Windows.Documents.Section> and then uses the **Add** method to add a new Paragraph to the **Section** contents.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_SectionBlocksAdd](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_sectionblocksadd)]
|
||||
[!code-vb[FlowDocumentSnippets#_SectionBlocksAdd](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_sectionblocksadd)]
|
||||
|
||||
## Example
|
||||
## Create a new Paragraph element
|
||||
The following example creates a new <xref:System.Windows.Documents.Paragraph> element and inserts it at the beginning of the <xref:System.Windows.Documents.Section>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_SectionBlocksInsert](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_sectionblocksinsert)]
|
||||
[!code-vb[FlowDocumentSnippets#_SectionBlocksInsert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_sectionblocksinsert)]
|
||||
|
||||
## Example
|
||||
## Get the top-level Block elements in the Section
|
||||
The following example gets the number of top-level <xref:System.Windows.Documents.Block> elements contained in the <xref:System.Windows.Documents.Section>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_SectionBlocksCount](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_sectionblockscount)]
|
||||
[!code-vb[FlowDocumentSnippets#_SectionBlocksCount](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_sectionblockscount)]
|
||||
|
||||
## Example
|
||||
## Delete the last Block element in the Section
|
||||
The following example deletes the last <xref:System.Windows.Documents.Block> element in the <xref:System.Windows.Documents.Section>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_SectionBlocksRemoveLast](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_sectionblocksremovelast)]
|
||||
[!code-vb[FlowDocumentSnippets#_SectionBlocksRemoveLast](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowDocumentSnippets/visualbasic/window1.xaml.vb#_sectionblocksremovelast)]
|
||||
|
||||
## Example
|
||||
## Clear all the Block element content from the Section
|
||||
The following example clears all of the contents (<xref:System.Windows.Documents.Block> elements) from the <xref:System.Windows.Documents.Section>.
|
||||
|
||||
[!code-csharp[FlowDocumentSnippets#_SectionBlocksClear](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowDocumentSnippets/CSharp/Window1.xaml.cs#_sectionblocksclear)]
|
||||
|
||||
+7
-5
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Manipulate Flow Content Elements through the Inlines Property"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to manipulate Flow Content Elements through the Inlines property.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -28,31 +30,31 @@ These examples demonstrate some of the more common operations that can be perfor
|
||||
|
||||
These examples happen to use <xref:System.Windows.Documents.Span> as the flow content element, but these techniques are applicable to all elements or controls that host an <xref:System.Windows.Documents.InlineCollection> collection.
|
||||
|
||||
## Example
|
||||
## Create a new Span object
|
||||
The following example creates a new <xref:System.Windows.Documents.Span> object, and then uses the **Add** method to add two text runs as content children of the <xref:System.Windows.Documents.Span>.
|
||||
|
||||
[!code-csharp[SpanSnippets#_SpanInlinesAdd](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesadd)]
|
||||
[!code-vb[SpanSnippets#_SpanInlinesAdd](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesadd)]
|
||||
|
||||
## Example
|
||||
## Create a new Run element
|
||||
The following example creates a new <xref:System.Windows.Documents.Run> element and inserts it at the beginning of the <xref:System.Windows.Documents.Span>.
|
||||
|
||||
[!code-csharp[SpanSnippets#_SpanInlinesInsert](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesinsert)]
|
||||
[!code-vb[SpanSnippets#_SpanInlinesInsert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesinsert)]
|
||||
|
||||
## Example
|
||||
## Get the top-level Inline elements in the Span
|
||||
The following example gets the number of top-level <xref:System.Windows.Documents.Inline> elements contained in the <xref:System.Windows.Documents.Span>.
|
||||
|
||||
[!code-csharp[SpanSnippets#_SpanInlinesCount](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinescount)]
|
||||
[!code-vb[SpanSnippets#_SpanInlinesCount](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinescount)]
|
||||
|
||||
## Example
|
||||
## Delete the last Inline element in the Span
|
||||
The following example deletes the last <xref:System.Windows.Documents.Inline> element in the <xref:System.Windows.Documents.Span>.
|
||||
|
||||
[!code-csharp[SpanSnippets#_SpanInlinesRemoveLast](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesremovelast)]
|
||||
[!code-vb[SpanSnippets#_SpanInlinesRemoveLast](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesremovelast)]
|
||||
|
||||
## Example
|
||||
## Clear all the Inline element content from the Span
|
||||
The following example clears all of the contents (<xref:System.Windows.Documents.Inline> elements) from the <xref:System.Windows.Documents.Span>.
|
||||
|
||||
[!code-csharp[SpanSnippets#_SpanInlinesClear](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesclear)]
|
||||
|
||||
+9
-7
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Manipulate a Table's Columns through the Columns Property"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to manipulate a Table's Columns through the Columns property.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -14,13 +16,13 @@ ms.assetid: 3f8884f4-7e1f-456b-be06-fbd3cf469bf3
|
||||
# How to: Manipulate a Table's Columns through the Columns Property
|
||||
This example demonstrates some of the more common operations that can be performed on a table's columns through the <xref:System.Windows.Documents.Table.Columns%2A> property.
|
||||
|
||||
## Example
|
||||
## Create a new table
|
||||
The following example creates a new table and then uses the <xref:System.Windows.Documents.TableColumnCollection.Add%2A> method to add columns to the table's <xref:System.Windows.Documents.Table.Columns%2A> collection.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_Add](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_add)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_Add](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_add)]
|
||||
|
||||
## Example
|
||||
## Insert a new TableColumn
|
||||
The following example inserts a new <xref:System.Windows.Documents.TableColumn>. The new column is inserted at index position 0, making it the new first column in the table.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -29,31 +31,31 @@ This example demonstrates some of the more common operations that can be perform
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_Insert](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_insert)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_Insert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_insert)]
|
||||
|
||||
## Example
|
||||
## Access properties in the TableColumnCollection
|
||||
The following example accesses some arbitrary properties on columns in the <xref:System.Windows.Documents.TableColumnCollection> collection, referring to particular columns by index.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_Manip](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_manip)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_Manip](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_manip)]
|
||||
|
||||
## Example
|
||||
## Get the number of columns in a table
|
||||
The following example gets the number of columns currently hosted by the table.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_Count](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_count)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_Count](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_count)]
|
||||
|
||||
## Example
|
||||
## Remove a column by reference
|
||||
The following example removes a particular column by reference.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_DelRef](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_delref)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_DelRef](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_delref)]
|
||||
|
||||
## Example
|
||||
## Remove a column by index
|
||||
The following example removes a particular column by index.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_DelIndex](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_delindex)]
|
||||
[!code-vb[TableSnippets2#_Table_Columns_DelIndex](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_columns_delindex)]
|
||||
|
||||
## Example
|
||||
## Remove all the columns
|
||||
The following example removes all columns from the table's columns collection.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_Columns_Clear](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_columns_clear)]
|
||||
|
||||
+12
-10
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Manipulate a Table's Row Groups through the RowGroups Property"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to manipulate a Table's Row Groups through the RowGroups property.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -14,13 +16,13 @@ ms.assetid: ea61440f-08ae-44ed-b314-5716aaaae3ed
|
||||
# How to: Manipulate a Table's Row Groups through the RowGroups Property
|
||||
This example demonstrates some of the more common operations that can be performed on a table's row groups through the <xref:System.Windows.Documents.Table.RowGroups%2A> property.
|
||||
|
||||
## Example
|
||||
## Create a new table using Add method
|
||||
The following example creates a new table and then uses the <xref:System.Windows.Documents.TableRowGroupCollection.Add%2A> method to add columns to the table's <xref:System.Windows.Documents.Table.RowGroups%2A> collection.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_Add](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_add)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_Add](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_add)]
|
||||
|
||||
## Example
|
||||
## Inserts a new TableRowGroup
|
||||
The following example inserts a new <xref:System.Windows.Documents.TableRowGroup>. The new column is inserted at index position 0, making it the new first row group in the table.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -29,49 +31,49 @@ This example demonstrates some of the more common operations that can be perform
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_Insert](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_insert)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_Insert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_insert)]
|
||||
|
||||
## Example
|
||||
## Add rows to the TableRowGroup
|
||||
The following example adds several rows to a particular <xref:System.Windows.Documents.TableRowGroup> (specified by index) in the table.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_AddRows](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_addrows)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_AddRows](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_addrows)]
|
||||
|
||||
## Example
|
||||
## Access row properties in the first row group
|
||||
The following example accesses some arbitrary properties on rows in the first row group in the table.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_ManipRows](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_maniprows)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_ManipRows](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_maniprows)]
|
||||
|
||||
## Example
|
||||
## Add cells to a TableRow
|
||||
The following example adds several cells to a particular <xref:System.Windows.Documents.TableRow> (specified by index) in the table.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_AddCells](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_addcells)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_AddCells](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_addcells)]
|
||||
|
||||
## Example
|
||||
## Access methods and properties on cells in the first row group
|
||||
The following example access some arbitrary methods and properties on cells in the first row in the first row group.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_ManipCells](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_manipcells)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_ManipCells](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_manipcells)]
|
||||
|
||||
## Example
|
||||
## Get the number of TableRowGroup elements in a table
|
||||
The following example returns the number of <xref:System.Windows.Documents.TableRowGroup> elements hosted by the table.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_Count](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_count)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_Count](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_count)]
|
||||
|
||||
## Example
|
||||
## Remove a row group by reference
|
||||
The following example removes a particular row group by reference.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_DelRef](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_delref)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_DelRef](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_delref)]
|
||||
|
||||
## Example
|
||||
## Remove a row group by index
|
||||
The following example removes a particular row group by index.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_DelIndex](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_delindex)]
|
||||
[!code-vb[TableSnippets2#_Table_RowGroups_DelIndex](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TableSnippets2/visualbasic/window1.xaml.vb#_table_rowgroups_delindex)]
|
||||
|
||||
## Example
|
||||
## Remove all row groups from the table's row groups collection
|
||||
The following example removes all row groups from the table's row groups collection.
|
||||
|
||||
[!code-csharp[TableSnippets2#_Table_RowGroups_Clear](~/samples/snippets/csharp/VS_Snippets_Wpf/TableSnippets2/CSharp/Window1.xaml.cs#_table_rowgroups_clear)]
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Retrieve Data in a Particular Data Format"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to retrieve Data in a particular Data Format.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -13,7 +15,7 @@ ms.assetid: a625acf3-1144-44cd-add7-456aefc3859f
|
||||
# How to: Retrieve Data in a Particular Data Format
|
||||
The following examples show how to retrieve data from a data object in a specified format.
|
||||
|
||||
## Example
|
||||
## Use the GetDataPresent(String) overload to retrieve the data
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetDataPresent%28System.String%29> overload to first check if a specified data format is available (natively or by auto-convert); if the specified format is available, the example retrieves the data by using the <xref:System.Windows.DataObject.GetData%28System.String%29> method.
|
||||
@@ -22,7 +24,7 @@ The following examples show how to retrieve data from a data object in a specifi
|
||||
[!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_getspecificdataformat)]
|
||||
[!code-vb[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_getspecificdataformat)]
|
||||
|
||||
## Example
|
||||
## Use the GetDataPresent(String, Boolean) overload to retrieve the data
|
||||
|
||||
### Description
|
||||
The following example code uses the <xref:System.Windows.DataObject.GetDataPresent%28System.String%2CSystem.Boolean%29> overload to first check if a specified data format is available natively (auto-convertible data formats are filtered); if the specified format is available, the example retrieves the data by using the <xref:System.Windows.DataObject.GetData%28System.String%29> method.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "How to: Rotate Ink"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to rotate Ink.
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
@@ -10,14 +12,14 @@ helpviewer_keywords:
|
||||
ms.assetid: fac36cc9-dd01-41ca-9bde-9d33e3790bbe
|
||||
---
|
||||
# How to: Rotate Ink
|
||||
## Example
|
||||
## Example to rotate Ink
|
||||
The following example copies the ink from an <xref:System.Windows.Controls.InkCanvas> to a <xref:System.Windows.Controls.Canvas> that contains an <xref:System.Windows.Controls.InkPresenter>. When the application copies the ink, it also rotates the ink 90 degrees clockwise.
|
||||
|
||||
[!code-xaml[HowToRotateInk#1](~/samples/snippets/csharp/VS_Snippets_Wpf/HowToRotateInk/CSharp/Window1.xaml#1)]
|
||||
|
||||
[!code-csharp[HowToRotateInk#2](~/samples/snippets/csharp/VS_Snippets_Wpf/HowToRotateInk/CSharp/Window1.xaml.cs#2)]
|
||||
|
||||
## Example
|
||||
## Adorner for Strokes
|
||||
The following example is a custom <xref:System.Windows.Documents.Adorner> that rotates the strokes on an <xref:System.Windows.Controls.InkPresenter>.
|
||||
|
||||
[!code-csharp[AdornerForStrokes#1](~/samples/snippets/csharp/VS_Snippets_Wpf/AdornerForStrokes/CSharp/RotatingAdornerForStrokes.cs#1)]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "Localization Attributes and Comments"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn how to use localization attributes and comments.
|
||||
helpviewer_keywords:
|
||||
- "localization [WPF], attributes"
|
||||
- "localization [WPF], comments"
|
||||
@@ -10,7 +12,7 @@ ms.assetid: ead2d9ac-b709-4ec1-a924-39927a29d02f
|
||||
[!INCLUDE[TLA#tla_winclient](../../../includes/tlasharptla-winclient-md.md)] localization comments are properties, inside XAML source code, supplied by developers to provide rules and hints for localization. [!INCLUDE[TLA#tla_winclient](../../../includes/tlasharptla-winclient-md.md)] localization comments contain two sets of information: localizability attributes and free-form localization comments. Localizability attributes are used by the [!INCLUDE[TLA2#tla_winclient](../../../includes/tla2sharptla-winclient-md.md)] Localization API to indicate which resources are to be localized. Free-form comments are any information that the application author wants to include.
|
||||
|
||||
<a name="Localizer_Comments_"></a>
|
||||
## Localization Comments
|
||||
## Add Localization Comments
|
||||
If markup application authors have requirements for specific elements in XAML, such as constraints on text length, font family, or font size, they can convey this information to localizers with comments in the XAML code. The process for adding comments to source code is as follows:
|
||||
|
||||
1. Application developer adds localization comments to XAML source code.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "mc:Ignorable Attribute"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn about the mc Ignorable attribute.
|
||||
helpviewer_keywords:
|
||||
- "mc XML namespace prefix [WPF]"
|
||||
- "mc:Ignorable attribute"
|
||||
@@ -38,8 +40,8 @@ Specifies which XML namespace prefixes encountered in a markup file may be ignor
|
||||
|
||||
## XAML Values
|
||||
|
||||
|||
|
||||
|-|-|
|
||||
| Value | Description |
|
||||
|-------|-------------|
|
||||
|*ignorablePrefix, ignorablePrefix1, etc.*|Any valid prefix string, per the XML 1.0 specification.|
|
||||
|*ignorableUri*|Any valid URI for designating a namespace, per the XML 1.0 specification.|
|
||||
|*ThisElementCanBeIgnored*|An element that can be ignored by [!INCLUDE[TLA#tla_xaml](../../../includes/tlasharptla-xaml-md.md)] processor implementations, if the underlying type cannot be resolved.|
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "mc:ProcessContent Attribute"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn about the mc ProcessContent attribute.
|
||||
helpviewer_keywords:
|
||||
- "mc:ProcessContent attribute"
|
||||
- "XAML [WPF], mc:ProcessContent attribute"
|
||||
@@ -27,8 +29,8 @@ Specifies which [!INCLUDE[TLA2#tla_xaml](../../../includes/tla2sharptla-xaml-md.
|
||||
|
||||
## XAML Values
|
||||
|
||||
|||
|
||||
|-|-|
|
||||
| Value | Description |
|
||||
|-------|-------------|
|
||||
|*ignorablePrefix*|Any valid prefix string, per the XML 1.0 specification.|
|
||||
|*ignorableUri*|Any valid URI for designating a namespace, per the XML 1.0 specification.|
|
||||
|*ThisElementCanBeIgnored*|An element that can be ignored by [!INCLUDE[TLA#tla_xaml](../../../includes/tlasharptla-xaml-md.md)] processor implementations, if the underlying type cannot be resolved.|
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "PresentationOptions:Freeze Attribute"
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn about the Freeze attribute.
|
||||
helpviewer_keywords:
|
||||
- "Freeze attribute [WPF]"
|
||||
- "Freezable elements [WPF]"
|
||||
@@ -23,8 +25,8 @@ Sets the <xref:System.Windows.Freezable.IsFrozen%2A> state to `true` on the cont
|
||||
|
||||
## XAML Values
|
||||
|
||||
|||
|
||||
|-|-|
|
||||
| Value| Description|
|
||||
|------|------------|
|
||||
|`PresentationOptions`|An XML namespace prefix, which can be any valid prefix string, per the XML 1.0 specification. The prefix `PresentationOptions` is used for identification purposes in this documentation.|
|
||||
|`freezableElement`|An element that instantiates any derived class of <xref:System.Windows.Freezable>.|
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: "RelativeSource MarkupExtension"
|
||||
description: Specifies properties of a RelativeSource binding source, within a Binding Markup Extension, or when setting the RelativeSource property of a Binding in XAML.
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
f1_keywords:
|
||||
- "RelativeSource"
|
||||
helpviewer_keywords:
|
||||
@@ -52,8 +53,8 @@ Specifies properties of a <xref:System.Windows.Data.RelativeSource> binding sour
|
||||
|
||||
## XAML Values
|
||||
|
||||
|||
|
||||
|-|-|
|
||||
| Value | Description |
|
||||
|-------|-------------|
|
||||
|`modeEnumValue`|One of the following:<br /><br /> - The string token `Self`; corresponds to a <xref:System.Windows.Data.RelativeSource> as created with its <xref:System.Windows.Data.RelativeSource.Mode%2A> property set to <xref:System.Windows.Data.RelativeSourceMode.Self>.<br />- The string token `TemplatedParent`; corresponds to a <xref:System.Windows.Data.RelativeSource> as created with its <xref:System.Windows.Data.RelativeSource.Mode%2A> property set to <xref:System.Windows.Data.RelativeSourceMode.TemplatedParent>.<br />- The string token `PreviousData`; corresponds to a <xref:System.Windows.Data.RelativeSource> as created with its <xref:System.Windows.Data.RelativeSource.Mode%2A> property set to <xref:System.Windows.Data.RelativeSourceMode.PreviousData>.<br />- See below for information on `FindAncestor` mode.|
|
||||
|`FindAncestor`|The string token `FindAncestor`. Using this token enters a mode whereby a `RelativeSource` specifies an ancestor type and optionally an ancestor level. This corresponds to a <xref:System.Windows.Data.RelativeSource> as created with its <xref:System.Windows.Data.RelativeSource.Mode%2A> property set to <xref:System.Windows.Data.RelativeSourceMode.FindAncestor>.|
|
||||
|`typeName`|Required for `FindAncestor` mode. The name of a type, which fills the <xref:System.Windows.Data.RelativeSource.AncestorType%2A> property.|
|
||||
|
||||
+2
-2
@@ -2,6 +2,8 @@
|
||||
title: "SaveToHistory Function - WPF unmanaged API reference"
|
||||
titleSuffix: ""
|
||||
ms.date: "03/30/2017"
|
||||
ms.custom: devdivchpfy22
|
||||
description: Learn about the SaveToHistory function.
|
||||
dev_langs:
|
||||
- "cpp"
|
||||
api_name:
|
||||
@@ -27,8 +29,6 @@ HRESULT SaveToHistory(
|
||||
pHistoryStream
|
||||
A pointer to the history stream.
|
||||
|
||||
## Requirements
|
||||
|
||||
## Requirements
|
||||
**Platforms:** See [.NET Framework System Requirements](/dotnet/framework/get-started/system-requirements).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user