From c22f2c48cddd6f330d2dd1d2ceb5552d40d503be Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 3 Jun 2025 09:53:11 -0700 Subject: [PATCH] update WinForms link URLs --- .../DirListBox.xml | 100 +- .../DriveListBox.xml | 88 +- .../FileListBox.xml | 96 +- .../Support.xml | 1148 ++++---- xml/Microsoft.VisualBasic.Devices/Ports.xml | 556 ++-- .../ClipboardProxy.xml | 1218 ++++---- .../ApplicationScopedSettingAttribute.xml | 2 +- .../ApplicationSettingsBase.xml | 570 ++-- .../ClientSettingsSection.xml | 40 +- .../DefaultSettingValueAttribute.xml | 72 +- .../IApplicationSettingsProvider.xml | 74 +- .../IPersistComponentSettings.xml | 154 +- .../ISettingsProviderService.xml | 26 +- .../LocalFileSettingsProvider.xml | 178 +- .../SettingsManageabilityAttribute.xml | 36 +- xml/System.Configuration/SettingsProvider.xml | 106 +- .../SettingsProviderAttribute.xml | 48 +- .../UserScopedSettingAttribute.xml | 2 +- xml/System.Media/SoundPlayer.xml | 452 ++- xml/System.Media/SystemSound.xml | 42 +- xml/System.Media/SystemSounds.xml | 94 +- xml/System.Windows.Data/RelativeSource.xml | 218 +- .../SnapLine.xml | 212 +- .../ElementHost.xml | 2 +- xml/System.Windows.Forms/Application.xml | 10 +- xml/System.Windows.Forms/AutoSizeMode.xml | 30 +- xml/System.Windows.Forms/AutoValidate.xml | 28 +- xml/System.Windows.Forms/BindingNavigator.xml | 4 +- xml/System.Windows.Forms/BindingSource.xml | 16 +- xml/System.Windows.Forms/ButtonRenderer.xml | 140 +- xml/System.Windows.Forms/CheckBox.xml | 470 +-- xml/System.Windows.Forms/CheckBoxRenderer.xml | 130 +- xml/System.Windows.Forms/CheckedListBox.xml | 836 +++--- xml/System.Windows.Forms/Clipboard.xml | 866 +++--- xml/System.Windows.Forms/ComboBoxRenderer.xml | 240 +- xml/System.Windows.Forms/ContainerControl.xml | 414 +-- xml/System.Windows.Forms/ContextMenuStrip.xml | 2 +- xml/System.Windows.Forms/Control.xml | 16 +- xml/System.Windows.Forms/DataGrid.xml | 2578 ++++++++--------- xml/System.Windows.Forms/DataGridView.xml | 1178 ++++---- .../DataGridViewAutoSizeColumnMode.xml | 46 +- ...ataGridViewAutoSizeColumnModeEventArgs.xml | 68 +- ...GridViewAutoSizeColumnModeEventHandler.xml | 16 +- .../DataGridViewAutoSizeColumnsMode.xml | 44 +- ...taGridViewAutoSizeColumnsModeEventArgs.xml | 56 +- ...ridViewAutoSizeColumnsModeEventHandler.xml | 16 +- .../DataGridViewAutoSizeModeEventArgs.xml | 68 +- .../DataGridViewAutoSizeModeEventHandler.xml | 30 +- .../DataGridViewAutoSizeRowMode.xml | 40 +- .../DataGridViewAutoSizeRowsMode.xml | 40 +- xml/System.Windows.Forms/DataGridViewBand.xml | 8 +- .../DataGridViewButtonCell.xml | 20 +- .../DataGridViewButtonColumn.xml | 216 +- xml/System.Windows.Forms/DataGridViewCell.xml | 64 +- ...iewCellContextMenuStripNeededEventArgs.xml | 2 +- ...CellContextMenuStripNeededEventHandler.xml | 2 +- ...taGridViewCellErrorTextNeededEventArgs.xml | 2 +- ...ridViewCellErrorTextNeededEventHandler.xml | 2 +- .../DataGridViewCellEventArgs.xml | 124 +- .../DataGridViewCellEventHandler.xml | 92 +- .../DataGridViewCellFormattingEventArgs.xml | 200 +- ...DataGridViewCellFormattingEventHandler.xml | 64 +- .../DataGridViewCellPaintingEventArgs.xml | 336 +-- .../DataGridViewCellPaintingEventHandler.xml | 30 +- .../DataGridViewCellStyle.xml | 384 +-- ...GridViewCellToolTipTextNeededEventArgs.xml | 2 +- ...dViewCellToolTipTextNeededEventHandler.xml | 2 +- .../DataGridViewCellValidatingEventArgs.xml | 80 +- .../DataGridViewCellValueEventArgs.xml | 110 +- .../DataGridViewCellValueEventHandler.xml | 30 +- .../DataGridViewCheckBoxCell.xml | 20 +- .../DataGridViewCheckBoxColumn.xml | 284 +- .../DataGridViewClipboardCopyMode.xml | 24 +- .../DataGridViewColumn.xml | 776 ++--- .../DataGridViewColumnCollection.xml | 1462 +++++----- .../DataGridViewColumnHeaderCell.xml | 104 +- ...ataGridViewColumnHeadersHeightSizeMode.xml | 34 +- .../DataGridViewColumnSortMode.xml | 24 +- .../DataGridViewComboBoxCell.xml | 8 +- .../DataGridViewComboBoxColumn.xml | 4 +- .../DataGridViewContentAlignment.xml | 24 +- .../DataGridViewDataErrorContexts.xml | 24 +- .../DataGridViewEditMode.xml | 28 +- .../DataGridViewElementStates.xml | 24 +- .../DataGridViewHeaderBorderStyle.xml | 14 +- .../DataGridViewHeaderCell.xml | 8 +- .../DataGridViewImageCell.xml | 236 +- .../DataGridViewImageCellLayout.xml | 14 +- .../DataGridViewImageColumn.xml | 268 +- .../DataGridViewLinkCell.xml | 10 +- .../DataGridViewPaintParts.xml | 24 +- xml/System.Windows.Forms/DataGridViewRow.xml | 74 +- .../DataGridViewRowCancelEventArgs.xml | 52 +- .../DataGridViewRowCollection.xml | 8 +- ...wRowContextMenuStripNeededEventHandler.xml | 2 +- ...ataGridViewRowErrorTextNeededEventArgs.xml | 2 +- ...GridViewRowErrorTextNeededEventHandler.xml | 2 +- .../DataGridViewRowHeadersWidthSizeMode.xml | 38 +- .../DataGridViewRowPostPaintEventArgs.xml | 284 +- .../DataGridViewRowPostPaintEventHandler.xml | 26 +- .../DataGridViewRowPrePaintEventArgs.xml | 316 +- .../DataGridViewRowPrePaintEventHandler.xml | 26 +- .../DataGridViewSelectedColumnCollection.xml | 2 +- .../DataGridViewSelectionMode.xml | 24 +- .../DataGridViewSortCompareEventArgs.xml | 188 +- .../DataGridViewSortCompareEventHandler.xml | 26 +- .../DataGridViewTextBoxCell.xml | 4 +- .../DataGridViewTextBoxColumn.xml | 130 +- xml/System.Windows.Forms/DateTimePicker.xml | 958 +++--- xml/System.Windows.Forms/DragDropEffects.xml | 38 +- xml/System.Windows.Forms/FileDialog.xml | 492 ++-- .../FileDialogCustomPlace.xml | 8 +- .../FileDialogCustomPlacesCollection.xml | 82 +- xml/System.Windows.Forms/FlowLayoutPanel.xml | 110 +- xml/System.Windows.Forms/Form.xml | 28 +- xml/System.Windows.Forms/GroupBoxRenderer.xml | 134 +- xml/System.Windows.Forms/HtmlDocument.xml | 1114 +++---- xml/System.Windows.Forms/HtmlElement.xml | 1578 +++++----- xml/System.Windows.Forms/HtmlWindow.xml | 2 +- .../IDataGridViewEditingCell.xml | 66 +- .../IDataGridViewEditingControl.xml | 212 +- xml/System.Windows.Forms/LayoutSettings.xml | 34 +- xml/System.Windows.Forms/ListView.xml | 2 +- xml/System.Windows.Forms/ListViewItem.xml | 1008 +++---- xml/System.Windows.Forms/MainMenu.xml | 222 +- xml/System.Windows.Forms/MaskedTextBox.xml | 1154 ++++---- xml/System.Windows.Forms/MdiClient.xml | 44 +- xml/System.Windows.Forms/MenuStrip.xml | 252 +- .../MessageBoxOptions.xml | 20 +- xml/System.Windows.Forms/MonthCalendar.xml | 8 +- xml/System.Windows.Forms/MouseEventArgs.xml | 192 +- xml/System.Windows.Forms/Padding.xml | 342 +-- xml/System.Windows.Forms/PictureBox.xml | 2 +- xml/System.Windows.Forms/PrintDialog.xml | 158 +- .../ProfessionalColorTable.xml | 82 +- .../ProfessionalColors.xml | 62 +- .../ProgressBarRenderer.xml | 284 +- .../RadioButtonRenderer.xml | 154 +- .../ScrollBarRenderer.xml | 446 +-- xml/System.Windows.Forms/SplitContainer.xml | 944 +++--- xml/System.Windows.Forms/StatusStrip.xml | 4 +- xml/System.Windows.Forms/TabControl.xml | 1170 ++++---- xml/System.Windows.Forms/TabRenderer.xml | 318 +- xml/System.Windows.Forms/TableLayoutPanel.xml | 656 ++--- .../TableLayoutPanelCellPosition.xml | 28 +- .../TableLayoutSettings.xml | 178 +- xml/System.Windows.Forms/TableLayoutStyle.xml | 50 +- xml/System.Windows.Forms/TextBoxRenderer.xml | 200 +- xml/System.Windows.Forms/TextFormatFlags.xml | 26 +- xml/System.Windows.Forms/ToolStrip.xml | 44 +- xml/System.Windows.Forms/ToolStripButton.xml | 270 +- .../ToolStripComboBox.xml | 764 ++--- .../ToolStripContainer.xml | 314 +- .../ToolStripContentPanel.xml | 328 +-- .../ToolStripControlHost.xml | 4 +- .../ToolStripDropDown.xml | 2 +- .../ToolStripDropDownButton.xml | 114 +- .../ToolStripDropDownItem.xml | 8 +- .../ToolStripDropDownMenu.xml | 128 +- xml/System.Windows.Forms/ToolStripItem.xml | 4 +- .../ToolStripItemRenderEventArgs.xml | 138 +- xml/System.Windows.Forms/ToolStripLabel.xml | 258 +- .../ToolStripMenuItem.xml | 2 +- .../ToolStripProfessionalRenderer.xml | 80 +- .../ToolStripRenderEventArgs.xml | 120 +- .../ToolStripRenderer.xml | 1128 ++++---- .../ToolStripSeparator.xml | 250 +- .../ToolStripSplitButton.xml | 260 +- .../ToolStripStatusLabel.xml | 86 +- xml/System.Windows.Forms/ToolStripTextBox.xml | 906 +++--- xml/System.Windows.Forms/ToolTip.xml | 614 ++-- xml/System.Windows.Forms/TrackBarRenderer.xml | 486 ++-- xml/System.Windows.Forms/TreeNode.xml | 1128 ++++---- xml/System.Windows.Forms/UserControl.xml | 180 +- xml/System.Windows.Forms/WebBrowser.xml | 1706 +++++------ .../WindowsFormsSection.xml | 10 +- xml/System.Windows/ContentElement.xml | 4 +- xml/System.Windows/UIElement.xml | 4 +- xml/System.Windows/UIElement3D.xml | 4 +- .../UnreferencedObjectEventArgs.xml | 206 +- .../XmlAttributeEventArgs.xml | 2 +- xml/ns-System.Drawing.Drawing2D.xml | 2 +- xml/ns-System.Drawing.Imaging.xml | 8 +- xml/ns-System.Drawing.Printing.xml | 2 +- xml/ns-System.Drawing.Text.xml | 2 +- xml/ns-System.Windows.Forms.VisualStyles.xml | 2 +- 186 files changed, 20866 insertions(+), 20868 deletions(-) diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml index f44f6c5ed4b..de84f800d4d 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml @@ -39,8 +39,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -69,8 +69,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Change"> @@ -103,8 +103,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnWidth"> @@ -151,8 +151,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataSource"> @@ -199,8 +199,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DirList"> @@ -249,8 +249,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DirListCount"> @@ -293,8 +293,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DirListIndex"> @@ -339,8 +339,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Dispose"> @@ -387,8 +387,8 @@ <para> <see langword="Dispose" /> can be called multiple times by other objects. When you override <see langword="Dispose(Boolean)" />, make sure not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see <see href="/dotnet/standard/garbage-collection/implementing-dispose">Implementing a Dispose Method</see>. For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see <see href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</see> and <see href="https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)">Overriding the Finalize Method</see>.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DrawMode"> @@ -431,8 +431,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ItemHeight"> @@ -479,8 +479,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Items"> @@ -527,8 +527,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="MultiColumn"> @@ -576,8 +576,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnBackColorChanged"> @@ -623,8 +623,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnBackColorChanged" /> in a derived class, make sure to call the <see langword="OnBackColorChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnChange"> @@ -665,8 +665,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnChanged" /> in a derived class, make sure to call the <see langword="OnChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDoubleClick"> @@ -712,8 +712,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnDoubleClick" /> in a derived class, make sure to call the <see langword="OnDoubleClick" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDrawItem"> @@ -755,8 +755,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnDrawItem" /> in a derived class, make sure to call the <see langword="OnDrawItem" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnFontChanged"> @@ -798,8 +798,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnFontChanged" /> in a derived class, make sure to call the <see langword="OnFontChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnHandleCreated"> @@ -841,8 +841,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnHandleCreated" /> in a derived class, make sure to call the <see langword="OnHandleCreated" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSelectedIndexChanged"> @@ -884,8 +884,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnSelectedIndexChanged" /> in a derived class, make sure to call the <see langword="OnSelectedIndexChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Path"> @@ -944,8 +944,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Refresh"> @@ -981,8 +981,8 @@ <block subset="none" type="overrides"> <para>When you override <see langword="Refresh" /> in a derived class, make sure to call the <see langword="Refresh" /> method so the control and its child controls are invalidated and redrawn.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectionMode"> @@ -1029,8 +1029,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Sorted"> @@ -1078,8 +1078,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ValueMember"> @@ -1126,8 +1126,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml index 311fd98103c..42682c9f4c1 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml @@ -39,8 +39,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -69,8 +69,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataSource"> @@ -117,8 +117,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DisplayMember"> @@ -165,8 +165,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Dispose"> @@ -209,8 +209,8 @@ <para> <see langword="Dispose" /> can be called multiple times by other objects. When you override <see langword="Dispose(Boolean)" />, make sure not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see <see href="/dotnet/standard/garbage-collection/implementing-dispose">Implementing a Dispose Method</see>. For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see <see href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</see> and <see href="https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)">Overriding the Finalize Method</see>.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DrawMode"> @@ -253,8 +253,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Drive"> @@ -301,8 +301,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DropDownStyle"> @@ -351,8 +351,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ItemHeight"> @@ -395,8 +395,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="Items"> @@ -452,8 +452,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Items"> @@ -500,8 +500,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="MaxLength"> @@ -548,8 +548,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnBackColorChanged"> @@ -591,8 +591,8 @@ <block subset="none" type="overrides"> <para>When you override <see langword="OnBackColorChanged" /> in a derived class, be sure to call the <see langword="OnBackColorChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDrawItem"> @@ -634,8 +634,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnDrawItem" /> in a derived class, make sure to call the <see langword="OnDrawItem" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnFontChanged"> @@ -677,8 +677,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnFontChanged" /> in a derived class, make sure to call the <see langword="OnFontChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnHandleCreated"> @@ -720,8 +720,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnHandleCreated" /> in a derived class, make sure to call the <see langword="OnHandleCreated" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSelectedIndexChanged"> @@ -763,8 +763,8 @@ <block subset="none" type="overrides"> <para>When overriding <see langword="OnSelectedIndexChanged" /> in a derived class, make sure to call the <see langword="OnSelectedIndexChanged" /> method of the base class so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Refresh"> @@ -804,8 +804,8 @@ <block subset="none" type="overrides"> <para>When you override <see langword="Refresh" /> in a derived class, make sure to call the <see langword="Refresh" /> method so the control and its child controls are invalidated and redrawn.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Sorted"> @@ -853,8 +853,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Text"> @@ -901,8 +901,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ValueMember"> @@ -949,8 +949,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="WndProc"> @@ -992,8 +992,8 @@ <block subset="none" type="overrides"> <para>Inheriting controls should call the <see cref="M:System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@)" /> method for the base class to process any messages that they do not handle.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml index 2a9917ece6d..11b0505ed4f 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml @@ -38,8 +38,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -67,8 +67,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Archive"> @@ -111,8 +111,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataSource"> @@ -158,8 +158,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="DisplayMember"> @@ -205,8 +205,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="FileName"> @@ -252,8 +252,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Hidden"> @@ -296,8 +296,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ItemHeight"> @@ -340,8 +340,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="Items"> @@ -396,8 +396,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Items"> @@ -443,8 +443,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Normal"> @@ -487,8 +487,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDoubleClick"> @@ -530,8 +530,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnPathChange"> @@ -568,8 +568,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnPatternChange"> @@ -606,8 +606,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSelectedIndexChanged"> @@ -645,8 +645,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Path"> @@ -706,8 +706,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="PathChange"> @@ -739,8 +739,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Pattern"> @@ -790,8 +790,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="PatternChange"> @@ -823,8 +823,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ReadOnly"> @@ -870,8 +870,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Refresh"> @@ -905,8 +905,8 @@ <block subset="none" type="overrides"> <para>When you override <see langword="Refresh" /> in a derived class, make sure to call the <see langword="Refresh" /> method of the base class so the control and its child controls are invalidated and redrawn.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Sorted"> @@ -953,8 +953,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="System"> @@ -997,8 +997,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="ValueMember"> @@ -1044,8 +1044,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/savefiledialog-component-overview-windows-forms">SaveFileDialog Component Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/openfiledialog-component-overview-windows-forms">OpenFileDialog Component Overview (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml index efd7893d49d..91a8db5706e 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml @@ -27,15 +27,15 @@ <Docs> <summary>Contains various utility functions for backward compatibility with Visual Basic 6.0.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -70,15 +70,15 @@ <summary>Duplicates Visual Basic 6.0 functionality of assigning an <see langword="Array" /> to a <see langword="Variant" />.</summary> <returns>The array to copy.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -113,15 +113,15 @@ <summary>Returns an OLE <see langword="IPicture" /> object that corresponds to the specified <see cref="T:System.Windows.Forms.Cursor" />.</summary> <returns>An <see cref="T:System.Object" /> that represents the OLE <see langword="IPicture" /> object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -168,22 +168,22 @@ <returns> <see langword="true" /> if the two expressions are equal; otherwise <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/assignment-operator">= Operator (Visual Basic)</related> @@ -221,22 +221,22 @@ <summary>Performs a logical equivalence on two <see cref="T:System.Byte" /> expressions.</summary> <returns>A <see cref="T:System.Byte" /> that contains the result of the bitwise comparison.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -275,13 +275,13 @@ <summary>Performs a logical equivalence on two <see cref="T:System.Int16" /> expressions.</summary> <returns>A <see cref="T:System.Int16" /> that contains the result of the comparison.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -320,13 +320,13 @@ <summary>Performs a logical equivalence on two <see cref="T:System.Int32" /> expressions.</summary> <returns>A <see cref="T:System.Int32" /> that contains the result of the comparison.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -365,13 +365,13 @@ <summary>Performs a logical equivalence on two <see cref="T:System.Int64" /> expressions.</summary> <returns>A <see cref="T:System.Int64" /> that contains the result of the comparison.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -410,13 +410,13 @@ <summary>Performs a logical equivalence on two <see cref="T:System.Object" /> expressions.</summary> <returns>A <see cref="T:System.Object" /> that contains the result of the comparison.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -460,13 +460,13 @@ <summary>Changes the <see cref="F:System.Drawing.FontStyle.Bold" /> style bit for a font.</summary> <returns>A <see cref="T:System.Drawing.Font" /> with the new style applied.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -503,13 +503,13 @@ <summary>Returns a font for a specified GDI character set.</summary> <returns>A <see cref="T:System.Drawing.Font" /> for the specified GDI character set.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <altmember cref="P:System.Drawing.Font.GdiCharSet" /> @@ -552,13 +552,13 @@ <summary>Changes the <see cref="F:System.Drawing.FontStyle.Italic" /> style bit for a font.</summary> <returns>A <see cref="T:System.Drawing.Font" /> with the new style applied.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -595,13 +595,13 @@ <summary>Returns a new <see cref="T:System.Drawing.Font" /> for a given Visual Basic 6.0 <see langword="Font" />.</summary> <returns>A <see cref="T:System.Drawing.Font" /> that matches the Visual Basic 6.0 <see langword="Font" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -638,13 +638,13 @@ <summary>Changes the <see cref="P:System.Drawing.Font.Size" /> property for a font.</summary> <returns>A <see cref="T:System.Drawing.Font" /> that matches the Visual Basic 6.0 <see langword="FontSize" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -686,13 +686,13 @@ <summary>Changes the <see cref="F:System.Drawing.FontStyle.Strikeout" /> style bit for a font.</summary> <returns>A <see cref="T:System.Drawing.Font" /> with the new style applied.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -734,13 +734,13 @@ <summary>Changes the <see cref="F:System.Drawing.FontStyle.Underline" /> style bit for a font.</summary> <returns>A <see cref="T:System.Drawing.Font" /> with the new style applied.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -775,13 +775,13 @@ <summary>Converts a <see cref="T:System.Drawing.Font" /> to a Visual Basic 6.0 <see langword="stdFont" /> object.</summary> <returns>A <see langword="stdFont" /> object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -821,13 +821,13 @@ <summary>Converts the Visual Basic 6.0 <see langword="Format" /> function to be compatible with Visual Basic.</summary> <returns>A <see cref="T:System.String" /> that contains the formatted data.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -866,13 +866,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 <see langword="ScaleHeight" /> measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleHeight" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -911,13 +911,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 <see langword="ScaleWidth" /> measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleWidth" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -958,13 +958,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 <see langword="ScaleLeft" /> measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleLeft" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1005,13 +1005,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 <see langword="ScaleTop" /> measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleTop" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1048,13 +1048,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 measurement for a given <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ScaleMode" />.</summary> <returns>A <see cref="T:System.Double" /> that contains the Visual Basic 6.0 value for the specified <see langword="ScaleMode" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1091,13 +1091,13 @@ <summary>Converts a pixel measurement to a Visual Basic 6.0 measurement for a given <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ScaleMode" />.</summary> <returns>A <see cref="T:System.Double" /> that contains the Visual Basic 6.0 value for the specified <see langword="ScaleMode" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1129,13 +1129,13 @@ <summary>Gets the control that currently has focus.</summary> <returns>The control that currently has focus.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1171,13 +1171,13 @@ <returns> <see langword="true" /> if <paramref name="btn" /> is the cancel button; otherwise <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1213,13 +1213,13 @@ <returns> <see langword="true" /> if <paramref name="btn" /> is the default button; otherwise <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1251,11 +1251,11 @@ <summary>Gets the name of the executable file (.exe) for the current application.</summary> <returns>A <see cref="T:System.String" /> that contains the name without a file name extension.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1287,13 +1287,13 @@ <summary>Gets the instance handle (HINSTANCE) for the current application.</summary> <returns>An <see cref="T:System.IntPtr" /> for the current application instance.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1330,13 +1330,13 @@ <summary>Gets an <see langword="Integer" /> associated with a <see cref="T:System.Windows.Forms.ListBox" /> or <see cref="T:System.Windows.Forms.ComboBox" /> item.</summary> <returns>The <see langword="Integer" /> associated with the specified <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1373,13 +1373,13 @@ <summary>Gets a <see cref="T:System.String" /> associated with a <see cref="T:System.Windows.Forms.ListBox" /> or <see cref="T:System.Windows.Forms.ComboBox" /> item.</summary> <returns>The <see cref="T:System.String" /> associated with the specified <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1411,11 +1411,11 @@ <summary>Gets the current path for the application.</summary> <returns>A <see cref="T:System.String" /> that contains the path of the currently executing assembly.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1450,13 +1450,13 @@ <summary>Gets an OLE <see langword="IPicture" /> object for a given <see cref="T:System.Drawing.Icon" />.</summary> <returns>An <see cref="T:System.Object" /> representing the OLE <see langword="IPicture" /> object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1491,13 +1491,13 @@ <summary>Converts a Visual Basic 6.0 <see langword="stdFont" /> object to a <see cref="T:System.Drawing.Font" />.</summary> <returns>A specified object to convert.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1532,13 +1532,13 @@ <summary>Gets an OLE <see langword="IPicture" /> object for a given <see cref="T:System.Drawing.Image" />.</summary> <returns>An <see cref="T:System.Object" /> representing the OLE <see langword="IPicture" /> object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1573,13 +1573,13 @@ <summary>Gets an OLE <see langword="IPictureDisp" /> object for a given <see cref="T:System.Drawing.Image" />.</summary> <returns>An <see cref="T:System.Object" /> representing the OLE <see langword="IPictureDisp" /> object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1625,15 +1625,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Boolean" /> expressions.</summary> <returns>A <see cref="T:System.Boolean" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1672,15 +1672,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Byte" /> expressions.</summary> <returns>A <see cref="T:System.Byte" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1719,15 +1719,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Int16" /> expressions.</summary> <returns>A <see langword="Short" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1766,15 +1766,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Int32" /> expressions.</summary> <returns>An <see langword="Integer" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1813,15 +1813,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Int64" /> expressions.</summary> <returns>A <see langword="Long" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1860,15 +1860,15 @@ <summary>Performs a logical implication on two <see cref="T:System.Object" /> expressions.</summary> <returns>An <see cref="T:System.Object" /> that contains the result.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/operators/not-operator">Not Operator (Visual Basic)</related> @@ -1905,13 +1905,13 @@ <summary>Gets an <see cref="T:System.Drawing.Image" /> for a given OLE <see langword="IPictureDisp" /> object.</summary> <returns>An image object.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1946,13 +1946,13 @@ <summary>Gets an <see cref="T:System.Drawing.Image" /> for a given OLE <see langword="IPicture" /> object.</summary> <returns>A converted object to image.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -1998,18 +1998,18 @@ <summary>Loads data of several possible types from a resource (.res) file.</summary> <returns>An <see cref="T:System.Object" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <Member MemberName="LoadResData"> @@ -2046,18 +2046,18 @@ <summary>Loads data of several possible types from a resource (.res) file, specifying a locale.</summary> <returns>An <see cref="T:System.Object" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <MemberGroup MemberName="LoadResPicture"> @@ -2101,18 +2101,18 @@ <summary>Loads a bitmap, icon, or cursor from a resource (.res) file.</summary> <returns>An <see cref="T:System.Object" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <Member MemberName="LoadResPicture"> @@ -2149,18 +2149,18 @@ <summary>Loads a bitmap, icon, or cursor from a resource (.res) file, specifying a locale.</summary> <returns>An <see cref="T:System.Object" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <MemberGroup MemberName="LoadResString"> @@ -2202,18 +2202,18 @@ <summary>Loads a string from a resource (.res) file.</summary> <returns>A <see cref="T:System.String" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <Member MemberName="LoadResString"> @@ -2248,18 +2248,18 @@ <summary>Loads a string from a resource (.res) file, specifying a locale.</summary> <returns>A <see cref="T:System.String" /> that contains the resource.</returns> <remarks> - <format type="text/markdown"><. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + <format type="text/markdown"><. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/globalizing-windows-forms">Globalizing Windows Forms</related> </Docs> </Member> <Member MemberName="PixelsToTwipsX"> @@ -2292,13 +2292,13 @@ <summary>Converts an X coordinate from pixels to twips.</summary> <returns>A <see cref="T:System.Double" /> that contains the X coordinate expressed in twips.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2333,13 +2333,13 @@ <summary>Converts a Y coordinate from pixels to twips.</summary> <returns>A <see cref="T:System.Double" /> that contains the Y coordinate expressed in twips.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2375,13 +2375,13 @@ <see langword="true" /> to process keystrokes before control is returned to the procedure; otherwise <see langword="false" />.</param> <summary>Sends one or more keystrokes to the active window as if typed at the keyboard.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2418,15 +2418,15 @@ <see langword="true" /> if the Visual Basic 6.0 <see langword="CommandButton" /> control's <see langword="Cancel" /> property is <see langword="true" />; otherwise <see langword="false" />.</param> <summary>Sets the <see cref="P:System.Windows.Forms.Form.CancelButton" /> property of a <see cref="T:System.Windows.Forms.Form" />.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2463,15 +2463,15 @@ <see langword="true" /> if the Visual Basic 6.0 <see langword="CommandButton" /> control's <see langword="Default" /> property is <see langword="true" />; otherwise <see langword="false" />.</param> <summary>Sets the <see cref="P:System.Windows.Forms.Form.AcceptButton" /> property of a <see cref="T:System.Windows.Forms.Form" />.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2509,13 +2509,13 @@ <param name="ItemData">An <see langword="Integer" /> to assign to the <see cref="F:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem.ItemData" /> property.</param> <summary>Sets the <see cref="F:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem.ItemData" /> property for a <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem" />.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2553,13 +2553,13 @@ <param name="ItemString">A <see cref="T:System.String" /> to assign to the <see cref="F:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem.ItemString" /> property.</param> <summary>Sets the <see cref="F:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem.ItemString" /> property for a <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ListBoxItem" />.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2602,13 +2602,13 @@ <param name="BaseFileName">A resource file (.res).</param> <summary>Assigns the name of a Visual Basic 6.0 resource file to the current Visual Basic project namespace.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2644,13 +2644,13 @@ <param name="BaseFileName">A resource file (.res).</param> <summary>Assigns the name of a Visual Basic 6.0 resource file to a Visual Basic project namespace.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2687,13 +2687,13 @@ <param name="OwnerForm">Optional. The <c>owner</c> parameter of the <see cref="M:System.Windows.Forms.Form.ShowDialog" /> method.</param> <summary>Displays a form by calling either the <see cref="M:System.Windows.Forms.Control.Show" /> or <see cref="M:System.Windows.Forms.Form.ShowDialog" /> method.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2735,13 +2735,13 @@ <summary>Formats strings to simulate the Visual Basic 6.0 <see langword="Debug.Print" /> functionality.</summary> <returns>A formatted <see cref="T:System.String" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2780,13 +2780,13 @@ <summary>Converts a Visual Basic 6.0 <see langword="ScaleHeight" /> measurement to a pixel measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleHeight" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2825,13 +2825,13 @@ <summary>Converts a Visual Basic 6.0 <see langword="ScaleWidth" /> measurement to a pixel measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleWidth" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2872,13 +2872,13 @@ <summary>Converts a Visual Basic 6.0 <see langword="ScaleLeft" /> measurement to a pixel measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleLeft" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2919,13 +2919,13 @@ <summary>Converts a Visual Basic 6.0 <see langword="ScaleTop" /> measurement to a pixel measurement.</summary> <returns>A <see cref="T:System.Double" /> that contains the converted Visual Basic 6.0 <see langword="ScaleLeft" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -2962,13 +2962,13 @@ <summary>Converts a Visual Basic 6.0 measurement to a pixel measurement for a given <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ScaleMode" />.</summary> <returns>A <see cref="T:System.Double" /> that contains the pixel value for the specified <see langword="ScaleMode" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3005,13 +3005,13 @@ <summary>Converts a Visual Basic 6.0 measurement to a pixel measurement for a given <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ScaleMode" />.</summary> <returns>A <see cref="T:System.Double" /> that contains the pixel value for the specified <see langword="ScaleMode" />.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3043,13 +3043,13 @@ <summary>Gets a value that is used to convert twips to pixels based on screen settings.</summary> <returns>A <see cref="T:System.Double" /> that contains the conversion factor.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3081,13 +3081,13 @@ <summary>Gets a value that is used to convert twips to pixels based on screen settings.</summary> <returns>A <see cref="T:System.Double" /> that contains the conversion factor.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3122,13 +3122,13 @@ <summary>Converts an X coordinate from twips to pixels.</summary> <returns>A <see cref="T:System.Double" /> that contains the X coordinate expressed in pixels.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3163,13 +3163,13 @@ <summary>Converts a Y coordinate from twips to pixels.</summary> <returns>A <see cref="T:System.Double" /> that contains the Y coordinate expressed in pixels.</returns> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3203,15 +3203,15 @@ <param name="Form">The <see cref="T:System.Windows.Forms.ContainerControl" /> where the control is parented.</param> <summary>Emulates the behavior of the Visual Basic 6.0 <see langword="ValidateControls" /> method.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3245,13 +3245,13 @@ <param name="Form">A <see cref="T:System.Windows.Forms.Form" />.</param> <summary>Displays pop-up Help for a form upgraded from Visual Basic 6.0.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> @@ -3287,13 +3287,13 @@ <param name="Position">A <see cref="T:Microsoft.VisualBasic.Compatibility.VB6.ZOrderConstants" /> enumeration.</param> <summary>Converts the Visual Basic <see langword="ZOrder" /> method for use in Visual Basic.</summary> <remarks> - <format type="text/markdown"><] - + <format type="text/markdown"><] + ]]></format> </remarks> </Docs> diff --git a/xml/Microsoft.VisualBasic.Devices/Ports.xml b/xml/Microsoft.VisualBasic.Devices/Ports.xml index c8ddf7a2073..1aaf012ae6b 100644 --- a/xml/Microsoft.VisualBasic.Devices/Ports.xml +++ b/xml/Microsoft.VisualBasic.Devices/Ports.xml @@ -21,45 +21,45 @@ <Docs> <summary>Provides a property and a method for accessing the computer's serial ports.</summary> <remarks> - <format type="text/markdown"><| -|Send a string to a serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| -|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to a serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| +|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <related type="Article" href="/dotnet/visual-basic/language-reference/objects/">Objects (Visual Basic)</related> @@ -132,46 +132,46 @@ <summary>Creates and opens a <see cref="T:System.IO.Ports.SerialPort" /> object.</summary> <returns>An open <see cref="T:System.IO.Ports.SerialPort" /> object, configured with the supplied arguments.</returns> <remarks> - <format type="text/markdown"><| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -215,46 +215,46 @@ <summary>Creates and opens a <see cref="T:System.IO.Ports.SerialPort" /> object.</summary> <returns>An open <see cref="T:System.IO.Ports.SerialPort" /> object, configured with the supplied arguments.</returns> <remarks> - <format type="text/markdown"><| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -303,46 +303,46 @@ <summary>Creates and opens a <see cref="T:System.IO.Ports.SerialPort" /> object.</summary> <returns>An open <see cref="T:System.IO.Ports.SerialPort" /> object, configured with the supplied arguments.</returns> <remarks> - <format type="text/markdown"><| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -396,46 +396,46 @@ <summary>Creates and opens a <see cref="T:System.IO.Ports.SerialPort" /> object.</summary> <returns>An open <see cref="T:System.IO.Ports.SerialPort" /> object, configured with the supplied arguments.</returns> <remarks> - <format type="text/markdown"><| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -492,46 +492,46 @@ <summary>Creates and opens a <see cref="T:System.IO.Ports.SerialPort" /> object.</summary> <returns>An open <see cref="T:System.IO.Ports.SerialPort" /> object, configured with the supplied arguments.</returns> <remarks> - <format type="text/markdown"><| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. - - The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + <format type="text/markdown"><| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the <xref:System.IO.Ports.SerialPort.Close%2A> method. + + The <xref:System.IO.Ports.SerialPort.WriteLine%2A> method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -571,46 +571,46 @@ <summary>Gets a collection of the names of the serial ports on the computer.</summary> <value>A collection of the names of the serial ports on the computer.</value> <remarks> - <format type="text/markdown"><| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example loops over all the strings that the `My.Computer.Ports.SerialPortNames` property returns. These strings are the names of the available serial ports on the computer. - - Typically, a user selects which serial port the application should use from the list of available ports. In this example, the serial port names are stored in a <xref:System.Windows.Forms.ListBox> control. For more information, see [ListBox Control](/dotnet/framework/winforms/controls/listbox-control-windows-forms). - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet45"::: - - This example requires: - -- A reference to the <xref:System?displayProperty=nameWithType> namespace. - -- That your form have a <xref:System.Windows.Forms.ListBox> control named `ListBox1`. - - For more information, see [How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports). - + + The following table lists an example of a task involving the `My.Computer.Ports.SerialPortNames` property. + +|To|See| +|-|-| +|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example loops over all the strings that the `My.Computer.Ports.SerialPortNames` property returns. These strings are the names of the available serial ports on the computer. + + Typically, a user selects which serial port the application should use from the list of available ports. In this example, the serial port names are stored in a <xref:System.Windows.Forms.ListBox> control. For more information, see [ListBox Control](/dotnet/desktop/winforms/controls/listbox-control-windows-forms). + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet45"::: + + This example requires: + +- A reference to the <xref:System?displayProperty=nameWithType> namespace. + +- That your form have a <xref:System.Windows.Forms.ListBox> control named `ListBox1`. + + For more information, see [How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports). + ]]></format> </remarks> <altmember cref="Overload:Microsoft.VisualBasic.Devices.Ports.OpenSerialPort" /> diff --git a/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml b/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml index 83d991c7989..9ab1cbf19e2 100644 --- a/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml +++ b/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml @@ -36,42 +36,42 @@ <Docs> <summary>Provides methods for manipulating the Clipboard.</summary> <remarks> - <format type="text/markdown">< or [Serialization - Visual Basic](/dotnet/visual-basic/programming-guide/concepts/serialization/). - - When accessing the Clipboard remotely, a <xref:System.Threading.ThreadStateException> is thrown unless the accessing thread operates in STA (single-threaded apartment) mode. To resolve this issue, set the `ThreadApartmentState` to `STA`. For more information, see <xref:System.STAThreadAttribute>. - - For more information, see [Storing Data to and Reading from the Clipboard](/dotnet/visual-basic/developing-apps/programming/computer-resources/storing-data-to-and-reading-from-the-clipboard). - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example will fail if there is no text on the Clipboard. - + <format type="text/markdown">< or [Serialization - Visual Basic](/dotnet/visual-basic/programming-guide/concepts/serialization/). + + When accessing the Clipboard remotely, a <xref:System.Threading.ThreadStateException> is thrown unless the accessing thread operates in STA (single-threaded apartment) mode. To resolve this issue, set the `ThreadApartmentState` to `STA`. For more information, see <xref:System.STAThreadAttribute>. + + For more information, see [Storing Data to and Reading from the Clipboard](/dotnet/visual-basic/developing-apps/programming/computer-resources/storing-data-to-and-reading-from-the-clipboard). + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example will fail if there is no text on the Clipboard. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -108,34 +108,34 @@ <Docs> <summary>Clears the Clipboard.</summary> <remarks> - <format type="text/markdown"><. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example clears the Clipboard. - -``` -My.Computer.Clipboard.Clear() -``` - - This removes all data from the Clipboard. - + <format type="text/markdown"><. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example clears the Clipboard. + +``` +My.Computer.Clipboard.Clear() +``` + + This removes all data from the Clipboard. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -175,29 +175,29 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if audio data is stored on the Clipboard; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines whether the Clipboard contains audio data and displays the result. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet10"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines whether the Clipboard contains audio data and displays the result. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -243,32 +243,32 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if data in the specified custom format is stored on the Clipboard; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you have placed custom formatted data on the Clipboard, this method allows you to check the Clipboard for data in that format. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example checks for data in the custom format `specialFormat`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet6"::: - - Replace `specialFormat` with the name of the custom format you wish to check. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you have placed custom formatted data on the Clipboard, this method allows you to check the Clipboard for data in that format. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example checks for data in the custom format `specialFormat`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet6"::: + + Replace `specialFormat` with the name of the custom format you wish to check. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -312,32 +312,32 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if a file drop list is stored on the Clipboard; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A file drop list is a collection of strings containing path information for files. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if there is a file drop list on the Clipboard and adds the list to the `ListBox.lstFiles` if they exist. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet12"::: - - This code will create an exception if there is no `ListBox` named `lstFiles`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A file drop list is a collection of strings containing path information for files. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if there is a file drop list on the Clipboard and adds the list to the `ListBox.lstFiles` if they exist. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet12"::: + + This code will create an exception if there is no `ListBox` named `lstFiles`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -379,31 +379,31 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if an image is stored on the Clipboard; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example checks to see if there is an image on the Clipboard and, if so, gets the image and adds it to `PictureBox1`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet8"::: - - This example depends on the existence of a `PictureBox` named `PictureBox1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example checks to see if there is an image on the Clipboard and, if so, gets the image and adds it to `PictureBox1`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet8"::: + + This example depends on the existence of a `PictureBox` named `PictureBox1`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -454,30 +454,30 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if the Clipboard contains text; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -524,30 +524,30 @@ My.Computer.Clipboard.Clear() <returns> <see langword="True" /> if the Clipboard contains text; otherwise <see langword="False" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -589,29 +589,29 @@ My.Computer.Clipboard.Clear() <summary>Retrieves an audio stream from the Clipboard.</summary> <returns>A <see cref="T:System.IO.Stream" /> object containing audio data or <see langword="Nothing" /> if the Clipboard does not contain any audio data.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example retrieves an audio stream from the Clipboard and plays it. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet11"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example retrieves an audio stream from the Clipboard and plays it. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet11"::: + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -663,31 +663,31 @@ My.Computer.Clipboard.Clear() <summary>Retrieves data in a custom format from the Clipboard.</summary> <returns>An <see langword="Object" /> representing the Clipboard data or <see langword="Nothing" /> if the Clipboard does not contain any data that is in the specified format or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads data in the format `specialformat` from the Clipboard and writes it to file. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet7"::: - - Replace `specialformat` with the custom data format you wish to retrieve. - + <format type="text/markdown"><![CDATA[ + +## Remarks + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads data in the format `specialformat` from the Clipboard and writes it to file. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet7"::: + + Replace `specialformat` with the custom data format you wish to retrieve. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -736,32 +736,32 @@ My.Computer.Clipboard.Clear() <summary>Retrieves data from the Clipboard as an <see cref="T:System.Windows.Forms.IDataObject" />.</summary> <returns>An <see cref="T:System.Windows.Forms.IDataObject" /> object that represents the data currently on the Clipboard, or <see langword="Nothing" /> if there is no data on the Clipboard.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This is an advanced member; it does not show in IntelliSense unless you click the **All** tab. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads data from the Clipboard in the form of an <xref:System.Windows.Forms.IDataObject> and then writes it to a file. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet1"::: - - Replace `C:\mylogfile` with the name of the file to which you want to write. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This is an advanced member; it does not show in IntelliSense unless you click the **All** tab. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads data from the Clipboard in the form of an <xref:System.Windows.Forms.IDataObject> and then writes it to a file. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet1"::: + + Replace `C:\mylogfile` with the name of the file to which you want to write. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -805,34 +805,34 @@ My.Computer.Clipboard.Clear() <summary>Retrieves a collection of strings representing file names from the Clipboard.</summary> <returns>A <see cref="T:System.Collections.Specialized.StringCollection" /> containing file names or <see langword="Nothing" /> if the Clipboard does not contain any data that is in the <see cref="F:System.Windows.Forms.DataFormats.FileDrop" /> format or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is available only for non-server applications. - - A file drop list is a collection of strings containing path information for files. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if there is a file drop list on the Clipboard and adds the list to the `ListBox.lstFiles` if they exist. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet9"::: - - This code creates an exception if there is no `ListBox` named `lstFiles`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is available only for non-server applications. + + A file drop list is a collection of strings containing path information for files. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if there is a file drop list on the Clipboard and adds the list to the `ListBox.lstFiles` if they exist. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet9"::: + + This code creates an exception if there is no `ListBox` named `lstFiles`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -874,31 +874,31 @@ My.Computer.Clipboard.Clear() <summary>Retrieves an image from the Clipboard.</summary> <returns>An <see cref="T:System.Drawing.Image" /> representing the Clipboard image data or <see langword="Nothing" /> if the Clipboard does not contain any data that is in the <see cref="F:System.Windows.Forms.DataFormats.Bitmap" /> format or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example checks to see if there is an image on the Clipboard before retrieving it and assigning it to `PictureBox1`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet4"::: - - For this example to function correctly, there must be a `PictureBox` named `PictureBox1` on your form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example checks to see if there is an image on the Clipboard before retrieving it and assigning it to `PictureBox1`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet4"::: + + For this example to function correctly, there must be a `PictureBox` named `PictureBox1` on your form. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -949,32 +949,32 @@ My.Computer.Clipboard.Clear() <summary>Retrieves text from the Clipboard.</summary> <returns>The Clipboard text data or an empty string if the Clipboard does not contain data in the <see cref="F:System.Windows.Forms.DataFormats.Text" /> or <see cref="F:System.Windows.Forms.TextDataFormat.UnicodeText" /> format, depending on the operating system.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example fails if there is no text on the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example fails if there is no text on the Clipboard. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1020,32 +1020,32 @@ My.Computer.Clipboard.Clear() <summary>Retrieves text from the Clipboard.</summary> <returns>The Clipboard text data or an empty string if the Clipboard does not contain data in the specified format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example fails if there is no text on the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example fails if there is no text on the Clipboard. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1099,34 +1099,34 @@ My.Computer.Clipboard.Clear() <see langword="Byte" /> array. Audio data to be written to the Clipboard. Required.</param> <summary>Writes audio data to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: - - Replace `cool.wav` with the name and path of the file you wish to read. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: + + Replace `cool.wav` with the name and path of the file you wish to read. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1170,34 +1170,34 @@ My.Computer.Clipboard.Clear() <see cref="T:System.IO.Stream" /> Audio data to be written to the clipboard. Required.</param> <summary>Writes audio data to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: - - Replace `cool.wav` with the name and path of the file you wish to read. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: + + Replace `cool.wav` with the name and path of the file you wish to read. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1245,34 +1245,34 @@ My.Computer.Clipboard.Clear() <see langword="Object" />. Data object to be written to the Clipboard. Required.</param> <summary>Writes data in a custom format to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the `DataObject.dataChunk` to the Clipboard in the custom format `specialFormat`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet7"::: - - This example depends on the existence of the custom data format `specialFormat`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the `DataObject.dataChunk` to the Clipboard in the custom format `specialFormat`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet7"::: + + This example depends on the existence of the custom data format `specialFormat`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1354,35 +1354,35 @@ My.Computer.Clipboard.Clear() <see cref="T:System.Windows.Forms.DataObject" />. Data object to be written to the Clipboard. Required.</param> <summary>Writes a <see cref="T:System.Windows.Forms.DataObject" /> to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This is an advanced member; it does not show in IntelliSense unless you click the **All** tab. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This is an advanced member; it does not show in IntelliSense unless you click the **All** tab. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the data object `dataChunk` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet9"::: - - This example depends on the existence of the data object `dataChunk`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the data object `dataChunk` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet9"::: + + This example depends on the existence of the data object `dataChunk`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1428,33 +1428,33 @@ My.Computer.Clipboard.Clear() <see cref="T:System.Collections.Specialized.StringCollection" />. List of file names. Required.</param> <summary>Writes a collection of strings representing file paths to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A file drop list is a collection of strings representing file names. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A file drop list is a collection of strings representing file names. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example gets the collection of file names from **MyDocuments**, converts it to a file drop list, and writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet3"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example gets the collection of file names from **MyDocuments**, converts it to a file drop list, and writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1499,34 +1499,34 @@ My.Computer.Clipboard.Clear() <see cref="T:System.Drawing.Image" />. Image to be written. Required.</param> <summary>Writes an image to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the image `coolPicture` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet8"::: - - This example depends on the existence of the image `coolPicture`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the image `coolPicture` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet8"::: + + This example depends on the existence of the image `coolPicture`. + ]]></format> </remarks> <altmember cref="T:Microsoft.VisualBasic.Devices.Computer" /> @@ -1580,35 +1580,35 @@ My.Computer.Clipboard.Clear() <see langword="String" />. Text to be written. Required.</param> <summary>Writes text to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - - Previous Clipboard formats are not preserved. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + + Previous Clipboard formats are not preserved. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the string `This is a test string.` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the string `This is a test string.` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -1660,35 +1660,35 @@ My.Computer.Clipboard.Clear() <see cref="T:System.Windows.Forms.TextDataFormat" />. Format to be used when writing text. Default is <see cref="F:System.Windows.Forms.TextDataFormat.UnicodeText" />. Required.</param> <summary>Writes text to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. - - Previous Clipboard formats are not preserved. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible formats are <xref:System.Windows.Forms.TextDataFormat.CommaSeparatedValue>, <xref:System.Windows.Forms.TextDataFormat.Html>, <xref:System.Windows.Forms.TextDataFormat.Rtf> and <xref:System.Windows.Forms.TextDataFormat.UnicodeText>. + + Previous Clipboard formats are not preserved. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the string `This is a test string.` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the string `This is a test string.` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> diff --git a/xml/System.Configuration/ApplicationScopedSettingAttribute.xml b/xml/System.Configuration/ApplicationScopedSettingAttribute.xml index 70c13fd5c9b..22c771ce9e1 100644 --- a/xml/System.Configuration/ApplicationScopedSettingAttribute.xml +++ b/xml/System.Configuration/ApplicationScopedSettingAttribute.xml @@ -53,7 +53,7 @@ <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> <altmember cref="T:System.Configuration.SettingsProvider" /> <altmember cref="T:System.Configuration.ConfigurationErrorsException" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Configuration/ApplicationSettingsBase.xml b/xml/System.Configuration/ApplicationSettingsBase.xml index 0b6c871e78c..f6e7023645c 100644 --- a/xml/System.Configuration/ApplicationSettingsBase.xml +++ b/xml/System.Configuration/ApplicationSettingsBase.xml @@ -36,58 +36,58 @@ <Docs> <summary>Acts as a base class for deriving concrete wrapper classes to implement the application settings feature in Window Forms applications.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of application settings to persist the following attributes of the main form: location, size, background color, and title bar text. All of these attributes are persisted as single application settings properties in the `FormSettings` class, named `FormLocation`, `FormSize`, `FormBackColor` and `FormText`, respectively. All except for `FormText` and `Size` are data bound to their associated form properties and have a default setting value applied using <xref:System.Configuration.DefaultSettingValueAttribute>. - - The form contains four child controls that have the following names and functions: - -- A button named `btnBackColor` used to display the **Color** common dialog box. - -- A button named `btnReload` used to <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> the application settings. - -- A button named `btnReset` used to <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> the application settings. - -- A textbox named `tbStatus` used to display status information about the program. - - Notice that after every execution of the application, an additional period character is appended to the title text of the form. - - This code example requires a Form with a <xref:System.Windows.Forms.ColorDialog> class named `colorDialog1`, and a <xref:System.Windows.Forms.StatusStrip> control with a <xref:System.Windows.Forms.ToolStripStatusLabel> named `tbStatus`. Additionally, it requires three <xref:System.Windows.Forms.Button> objects named `btnReload`, `btnReset`, and `btnBackColor`. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of application settings to persist the following attributes of the main form: location, size, background color, and title bar text. All of these attributes are persisted as single application settings properties in the `FormSettings` class, named `FormLocation`, `FormSize`, `FormBackColor` and `FormText`, respectively. All except for `FormText` and `Size` are data bound to their associated form properties and have a default setting value applied using <xref:System.Configuration.DefaultSettingValueAttribute>. + + The form contains four child controls that have the following names and functions: + +- A button named `btnBackColor` used to display the **Color** common dialog box. + +- A button named `btnReload` used to <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> the application settings. + +- A button named `btnReset` used to <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> the application settings. + +- A textbox named `tbStatus` used to display status information about the program. + + Notice that after every execution of the application, an additional period character is appended to the title text of the form. + + This code example requires a Form with a <xref:System.Windows.Forms.ColorDialog> class named `colorDialog1`, and a <xref:System.Windows.Forms.StatusStrip> control with a <xref:System.Windows.Forms.ToolStripStatusLabel> named `tbStatus`. Additionally, it requires three <xref:System.Windows.Forms.Button> objects named `btnReload`, `btnReset`, and `btnBackColor`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Configuration.LocalFileSettingsProvider" /> @@ -95,7 +95,7 @@ <altmember cref="T:System.Configuration.UserScopedSettingAttribute" /> <altmember cref="T:System.Configuration.SettingsGroupNameAttribute" /> <altmember cref="T:System.Configuration.SettingsProviderAttribute" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -134,25 +134,25 @@ <Docs> <summary>Initializes an instance of the <see cref="T:System.Configuration.ApplicationSettingsBase" /> class to its default state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The parameterless constructor was designed to work under the assumption that there is no component associated with the current settings wrapper class, which derives from <xref:System.Configuration.ApplicationSettingsBase>. - - When an instance of a wrapper class is created, inherited code will automatically perform the following actions: - -1. Reflect over the class. - -2. For each property on the wrapper marked with either `[UserScopedSettingAttribute]` or `[ApplicationScopedSettingAttribute]`, a corresponding <xref:System.Configuration.SettingsProperty> is created. - -3. Each <xref:System.Configuration.SettingsProperty> has some of its properties set based on other attributes that are optionally present on the wrapper's properties, such as the default value or the settings provider. - -4. All other attributes are simply put into an attribute bag, the <xref:System.Configuration.SettingsProperty.Attributes%2A> property of the <xref:System.Configuration.SettingsProperty> class. - -5. All <xref:System.Configuration.SettingsProperty> objects are added to a <xref:System.Configuration.SettingsPropertyCollection> represented by the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> property of the <xref:System.Configuration.ApplicationSettingsBase> class. This collection is then passed to the <xref:System.Configuration.SettingsBase.Initialize%2A> method. - - As implied by step 3 mentioned previously, <xref:System.Configuration.ApplicationSettingsBase> natively works with several property attributes, specifically the following: <xref:System.Configuration.SettingsProviderAttribute>, <xref:System.Configuration.DefaultSettingValueAttribute>, and <xref:System.Configuration.SettingsSerializeAsAttribute>. All other settings attributes are simply passed through to the appropriate underlying provider. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The parameterless constructor was designed to work under the assumption that there is no component associated with the current settings wrapper class, which derives from <xref:System.Configuration.ApplicationSettingsBase>. + + When an instance of a wrapper class is created, inherited code will automatically perform the following actions: + +1. Reflect over the class. + +2. For each property on the wrapper marked with either `[UserScopedSettingAttribute]` or `[ApplicationScopedSettingAttribute]`, a corresponding <xref:System.Configuration.SettingsProperty> is created. + +3. Each <xref:System.Configuration.SettingsProperty> has some of its properties set based on other attributes that are optionally present on the wrapper's properties, such as the default value or the settings provider. + +4. All other attributes are simply put into an attribute bag, the <xref:System.Configuration.SettingsProperty.Attributes%2A> property of the <xref:System.Configuration.SettingsProperty> class. + +5. All <xref:System.Configuration.SettingsProperty> objects are added to a <xref:System.Configuration.SettingsPropertyCollection> represented by the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> property of the <xref:System.Configuration.ApplicationSettingsBase> class. This collection is then passed to the <xref:System.Configuration.SettingsBase.Initialize%2A> method. + + As implied by step 3 mentioned previously, <xref:System.Configuration.ApplicationSettingsBase> natively works with several property attributes, specifically the following: <xref:System.Configuration.SettingsProviderAttribute>, <xref:System.Configuration.DefaultSettingValueAttribute>, and <xref:System.Configuration.SettingsSerializeAsAttribute>. All other settings attributes are simply passed through to the appropriate underlying provider. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProperty" /> @@ -191,15 +191,15 @@ <param name="owner">The component that will act as the owner of the application settings object.</param> <summary>Initializes an instance of the <see cref="T:System.Configuration.ApplicationSettingsBase" /> class using the supplied owner component.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor is exactly equivalent to the <xref:System.Configuration.ApplicationSettingsBase.%23ctor%28System.ComponentModel.IComponent%2CSystem.String%29> constructor using the invocation: - - `ApplicationSettingsBase(owner, String.Empty)` - - For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor is exactly equivalent to the <xref:System.Configuration.ApplicationSettingsBase.%23ctor%28System.ComponentModel.IComponent%2CSystem.String%29> constructor using the invocation: + + `ApplicationSettingsBase(owner, String.Empty)` + + For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -239,13 +239,13 @@ <param name="settingsKey">A <see cref="T:System.String" /> that uniquely identifies separate instances of the wrapper class.</param> <summary>Initializes an instance of the <see cref="T:System.Configuration.ApplicationSettingsBase" /> class using the supplied settings key.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class in the same application domain. - - For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class in the same application domain. + + For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. + ]]></format> </remarks> <altmember cref="P:System.Configuration.ApplicationSettingsBase.SettingsKey" /> @@ -284,15 +284,15 @@ <param name="settingsKey">A <see cref="T:System.String" /> that uniquely identifies separate instances of the wrapper class.</param> <summary>Initializes an instance of the <see cref="T:System.Configuration.ApplicationSettingsBase" /> class using the supplied owner component and settings key.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.ComponentModel.IComponent> object specified by the `owner` parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>, the owner's site is queried for a <xref:System.Configuration.ISettingsProviderService>. If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the <xref:System.Configuration.SettingsProviderAttribute>. - - This constructor initializes the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain. - - For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.ComponentModel.IComponent> object specified by the `owner` parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>, the owner's site is queried for a <xref:System.Configuration.ISettingsProviderService>. If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the <xref:System.Configuration.SettingsProviderAttribute>. + + This constructor initializes the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain. + + For information about how reflection is used during the instantiation of a wrapper class, see the default <xref:System.Configuration.ApplicationSettingsBase.%23ctor> constructor. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -339,13 +339,13 @@ <summary>Gets the application settings context associated with the settings group.</summary> <value>A <see cref="T:System.Configuration.SettingsContext" /> associated with the settings group.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase> has a context associated with it. The context is passed to the settings provider for each property to identify how the property is used. Context therefore acts as a hint to help the settings provider determine how best to persist the associated application settings values. - - In contrast, the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property enables the settings provider to disambiguate multiple instances of the same wrapper class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase> has a context associated with it. The context is passed to the settings provider for each property to identify how the property is used. Context therefore acts as a hint to help the settings provider determine how best to persist the associated application settings values. + + In contrast, the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property enables the settings provider to disambiguate multiple instances of the same wrapper class. + ]]></format> </remarks> <altmember cref="P:System.Configuration.ApplicationSettingsBase.SettingsKey" /> @@ -390,11 +390,11 @@ <summary>Returns the value of the named settings property for the previous version of the same application.</summary> <returns>An <see cref="T:System.Object" /> containing the value of the specified <see cref="T:System.Configuration.SettingsProperty" /> if found; otherwise, <see langword="null" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.GetPreviousVersion%2A> method is often used in conjunction with the <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> method when migrating application settings during the installation of a new version of an application. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.GetPreviousVersion%2A> method is often used in conjunction with the <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> method when migrating application settings during the installation of a new version of an application. + ]]></format> </remarks> <exception cref="T:System.Configuration.SettingsPropertyNotFoundException">The property does not exist. The property count is zero or the property cannot be found in the data store.</exception> @@ -441,17 +441,17 @@ <summary>Gets or sets the value of the specified application settings property.</summary> <value>If found, the value of the named settings property; otherwise, <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.Item%2A> property, also known as the indexer, is routinely used in the settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. <xref:System.Configuration.ApplicationSettingsBase.Item%2A> binds the public property of the wrapper class to the corresponding settings property. - - <xref:System.Configuration.ApplicationSettingsBase.Item%2A> raises several events depending on the operation being performed: - -- The first time a property is retrieved, the <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded> event is raised. - -- When a property is set, the <xref:System.Configuration.ApplicationSettingsBase.OnSettingChanging%2A> event is raised. If the handler does not cancel the event, then the property value is set and the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event is raised. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.Item%2A> property, also known as the indexer, is routinely used in the settings wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. <xref:System.Configuration.ApplicationSettingsBase.Item%2A> binds the public property of the wrapper class to the corresponding settings property. + + <xref:System.Configuration.ApplicationSettingsBase.Item%2A> raises several events depending on the operation being performed: + +- The first time a property is retrieved, the <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded> event is raised. + +- When a property is set, the <xref:System.Configuration.ApplicationSettingsBase.OnSettingChanging%2A> event is raised. If the handler does not cancel the event, then the property value is set and the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event is raised. + ]]></format> </remarks> <exception cref="T:System.Configuration.SettingsPropertyNotFoundException">There are no properties associated with the current wrapper or the specified property could not be found.</exception> @@ -498,13 +498,13 @@ <param name="e">A <see cref="T:System.ComponentModel.PropertyChangedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Configuration.ApplicationSettingsBase.PropertyChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Configuration.ApplicationSettingsBase.OnPropertyChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Configuration.ApplicationSettingsBase.OnPropertyChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -549,13 +549,13 @@ <param name="e">A <see cref="T:System.Configuration.SettingChangingEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Configuration.ApplicationSettingsBase.SettingChanging" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Configuration.ApplicationSettingsBase.OnSettingChanging%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Configuration.ApplicationSettingsBase.OnSettingChanging%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -602,13 +602,13 @@ <param name="e">A <see cref="T:System.Configuration.SettingsLoadedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Configuration.ApplicationSettingsBase.SettingsLoaded" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Configuration.ApplicationSettingsBase.OnSettingsLoaded%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Configuration.ApplicationSettingsBase.OnSettingsLoaded%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -655,13 +655,13 @@ <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Configuration.ApplicationSettingsBase.SettingsSaving" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Configuration.ApplicationSettingsBase.OnSettingsSaving%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Configuration.ApplicationSettingsBase.OnSettingsSaving%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -709,13 +709,13 @@ <summary>Gets the collection of settings properties in the wrapper.</summary> <value>A <see cref="T:System.Configuration.SettingsPropertyCollection" /> containing all the <see cref="T:System.Configuration.SettingsProperty" /> objects used in the current wrapper.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `get` accessor of the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> property reflects over the metadata of the settings wrapper class, which is derived from <xref:System.Configuration.ApplicationSettingsBase>, to dynamically determine the set of available application settings properties. - - The <xref:System.Configuration.ApplicationSettingsBase> class natively recognizes certain characteristics of an application setting, such as its name, property type, settings provider, default value, read only status, and a serialization preference. These characteristics are mirrored as properties in the <xref:System.Configuration.SettingsProperty> class. All other attributes of the settings property are just passed through to its associated settings provider. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `get` accessor of the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> property reflects over the metadata of the settings wrapper class, which is derived from <xref:System.Configuration.ApplicationSettingsBase>, to dynamically determine the set of available application settings properties. + + The <xref:System.Configuration.ApplicationSettingsBase> class natively recognizes certain characteristics of an application setting, such as its name, property type, settings provider, default value, read only status, and a serialization preference. These characteristics are mirrored as properties in the <xref:System.Configuration.SettingsProperty> class. All other attributes of the settings property are just passed through to its associated settings provider. + ]]></format> </remarks> <exception cref="T:System.Configuration.ConfigurationErrorsException">The associated settings provider could not be found or its instantiation failed.</exception> @@ -759,13 +759,13 @@ <Docs> <summary>Occurs after the value of an application settings property is changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event is raised when a settings property is changed through the `set` accessor of the <xref:System.Configuration.ApplicationSettingsBase.Item%2A> method, or for every property that is restored when a call is made to the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> or <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> methods. - - There is no corresponding `PropertyChanging` event for this class; instead, see the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event is raised when a settings property is changed through the `set` accessor of the <xref:System.Configuration.ApplicationSettingsBase.Item%2A> method, or for every property that is restored when a call is made to the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> or <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> methods. + + There is no corresponding `PropertyChanging` event for this class; instead, see the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event. + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.OnPropertyChanged(System.Object,System.ComponentModel.PropertyChangedEventArgs)" /> @@ -852,11 +852,11 @@ <summary>Gets the collection of application settings providers used by the wrapper.</summary> <value>A <see cref="T:System.Configuration.SettingsProviderCollection" /> containing all the <see cref="T:System.Configuration.SettingsProvider" /> objects used by the settings properties of the current settings wrapper.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.SettingsProviderAttribute> determines what setting provider is used by a settings wrapper class or an individual setting property. If this attribute is not specified, a client application will use the <xref:System.Configuration.LocalFileSettingsProvider>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.SettingsProviderAttribute> determines what setting provider is used by a settings wrapper class or an individual setting property. If this attribute is not specified, a client application will use the <xref:System.Configuration.LocalFileSettingsProvider>. + ]]></format> </remarks> <altmember cref="P:System.Configuration.ApplicationSettingsBase.Properties" /> @@ -895,26 +895,26 @@ <Docs> <summary>Refreshes the application settings property values from persistent storage.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: - -- It clears the currently cached properties by clearing the collection represented by the <xref:System.Configuration.SettingsBase.PropertyValues%2A> property. - -- It raises the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event for every member of the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> collection. - - <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> contrasts with <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. - - - -## Examples - The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method being invoked in the body of the <xref:System.Windows.Forms.Control.Click> event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: + +- It clears the currently cached properties by clearing the collection represented by the <xref:System.Configuration.SettingsBase.PropertyValues%2A> property. + +- It raises the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event for every member of the <xref:System.Configuration.ApplicationSettingsBase.Properties%2A> collection. + + <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> contrasts with <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + + + +## Examples + The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method being invoked in the body of the <xref:System.Windows.Forms.Control.Click> event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet6"::: + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.Reset" /> @@ -957,26 +957,26 @@ <Docs> <summary>Restores the persisted application settings values to their corresponding default properties.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: - -- It calls the <xref:System.Configuration.IApplicationSettingsProvider.Reset%2A?displayProperty=nameWithType> method on every settings provider that supports this optional method. - -- It calls the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method to force a refresh of the settings property values. - - <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> contrasts with <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. - - - -## Examples - The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method being invoked in the body of the <xref:System.Windows.Forms.Control.Click> event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: + +- It calls the <xref:System.Configuration.IApplicationSettingsProvider.Reset%2A?displayProperty=nameWithType> method on every settings provider that supports this optional method. + +- It calls the <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> method to force a refresh of the settings property values. + + <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> contrasts with <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + + + +## Examples + The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method being invoked in the body of the <xref:System.Windows.Forms.Control.Click> event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet5"::: + ]]></format> </remarks> <exception cref="T:System.Configuration.ConfigurationErrorsException">The configuration file could not be parsed.</exception> @@ -1016,29 +1016,29 @@ <Docs> <summary>Stores the current values of the application settings properties.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method writes the current value of each settings property to its associated data store. For each property, this method calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method on the associated settings provider. - - This method differs from the base class implementation in that it raises the <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event before the values are written. - - If the only settings defined are application-scoped settings, <xref:System.Configuration.ApplicationSettingsBase.Save%2A> will have no effect and return no error if called with the default <xref:System.Configuration.LocalFileSettingsProvider>. <xref:System.Configuration.LocalFileSettingsProvider> only saves user-scoped settings. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method writes the current value of each settings property to its associated data store. For each property, this method calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method on the associated settings provider. + + This method differs from the base class implementation in that it raises the <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event before the values are written. + + If the only settings defined are application-scoped settings, <xref:System.Configuration.ApplicationSettingsBase.Save%2A> will have no effect and return no error if called with the default <xref:System.Configuration.LocalFileSettingsProvider>. <xref:System.Configuration.LocalFileSettingsProvider> only saves user-scoped settings. + > [!IMPORTANT] -> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method to persist the current values of the application settings. This is typically performed in the <xref:System.Windows.Forms.Form.Closing> event handler of the primary or containing <xref:System.Windows.Forms.Form>. - - - -## Examples - The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method being called from the <xref:System.Windows.Forms.Form.Closing> event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's <xref:System.Windows.Forms.Control.Text%2A> property. - - The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - +> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method to persist the current values of the application settings. This is typically performed in the <xref:System.Windows.Forms.Form.Closing> event handler of the primary or containing <xref:System.Windows.Forms.Form>. + + + +## Examples + The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method being called from the <xref:System.Windows.Forms.Form.Closing> event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's <xref:System.Windows.Forms.Control.Text%2A> property. + + The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.Reset" /> @@ -1078,31 +1078,31 @@ <Docs> <summary>Occurs before the value of an application settings property is changed.</summary> <remarks> - <format type="text/markdown"><. - - There is no corresponding `SettingChanged` event for this class; instead, see the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event. - - - -## Examples - The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event handler for object of type `FormSettings`, which is a wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. The handler displays the event information in a textbox named `tbStatus`. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - + <format type="text/markdown"><. + + There is no corresponding `SettingChanged` event for this class; instead, see the <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged> event. + + + +## Examples + The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event handler for object of type `FormSettings`, which is a wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. The handler displays the event information in a textbox named `tbStatus`. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.OnSettingChanging(System.Object,System.Configuration.SettingChangingEventArgs)" /> <altmember cref="T:System.Configuration.SettingChangingEventArgs" /> <altmember cref="E:System.Configuration.ApplicationSettingsBase.PropertyChanged" /> <altmember cref="P:System.Configuration.ApplicationSettingsBase.Item(System.String)" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/how-to-validate-application-settings">How to: Validate Application Settings</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/how-to-validate-application-settings">How to: Validate Application Settings</related> </Docs> </Member> <Member MemberName="SettingsKey"> @@ -1146,21 +1146,21 @@ <summary>Gets or sets the settings key for the application settings group.</summary> <value>A <see cref="T:System.String" /> containing the settings key for the current settings group.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property is provided to enable client code, and in particular the settings provider, to disambiguate between multiple instances of the same application settings class. - - Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should be set according to how the property values are intended to be shared. - -- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should have the same value in all of the instances. This is the default behavior of the <xref:System.Configuration.ApplicationSettingsBase> class. - -- If the settings properties of the wrapper are intended to be per instance, then <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should have a unique value for every instance. The <xref:System.Configuration.ApplicationSettingsBase.%23ctor%28System.String%29> version of the constructor enables you to initialize <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> to a unique string. - - In contrast, the <xref:System.Configuration.ApplicationSettingsBase.Context%2A> property provides hints to the settings provider to enable it to persist values in an efficient and orderly manner. - - The <xref:System.Configuration.SettingChangingEventArgs> class contains a similar <xref:System.Configuration.SettingChangingEventArgs.SettingKey%2A> property that helps identify the source of the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> property is provided to enable client code, and in particular the settings provider, to disambiguate between multiple instances of the same application settings class. + + Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should be set according to how the property values are intended to be shared. + +- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should have the same value in all of the instances. This is the default behavior of the <xref:System.Configuration.ApplicationSettingsBase> class. + +- If the settings properties of the wrapper are intended to be per instance, then <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> should have a unique value for every instance. The <xref:System.Configuration.ApplicationSettingsBase.%23ctor%28System.String%29> version of the constructor enables you to initialize <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A> to a unique string. + + In contrast, the <xref:System.Configuration.ApplicationSettingsBase.Context%2A> property provides hints to the settings provider to enable it to persist values in an efficient and orderly manner. + + The <xref:System.Configuration.SettingChangingEventArgs> class contains a similar <xref:System.Configuration.SettingChangingEventArgs.SettingKey%2A> property that helps identify the source of the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> event. + ]]></format> </remarks> <altmember cref="P:System.Configuration.ApplicationSettingsBase.Context" /> @@ -1197,11 +1197,11 @@ <Docs> <summary>Occurs after the application settings are retrieved from storage.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded> event occurs only after the initial `get` access of the first configuration property used, typically through the <xref:System.Configuration.ApplicationSettingsBase.Item%2A> method. Subsequent accesses use values for the settings property that are cached locally. The <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> and <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> methods will clear all cached values so this event will be raised again upon subsequent property access. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded> event occurs only after the initial `get` access of the first configuration property used, typically through the <xref:System.Configuration.ApplicationSettingsBase.Item%2A> method. Subsequent accesses use values for the settings property that are cached locally. The <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> and <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> methods will clear all cached values so this event will be raised again upon subsequent property access. + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.OnSettingsLoaded(System.Object,System.Configuration.SettingsLoadedEventArgs)" /> @@ -1241,20 +1241,20 @@ <Docs> <summary>Occurs before values are saved to the data store.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event is raised by the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. - - - -## Examples - The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event handler for object of type `FormSettings`, which is a wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. The handler queries the user to save the current application settings property values. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event is raised by the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. + + + +## Examples + The following code example shows the <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event handler for object of type `FormSettings`, which is a wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. The handler queries the user to save the current application settings property values. The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="M:System.Configuration.ApplicationSettingsBase.OnSettingsSaving(System.Object,System.ComponentModel.CancelEventArgs)" /> @@ -1292,21 +1292,21 @@ <Docs> <summary>Updates application settings to reflect a more recent installation of the application.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> method performs two actions to assure smooth transition to a new version of an application: - -- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A?displayProperty=nameWithType> method, assuming they have implemented the <xref:System.Configuration.IApplicationSettingsProvider> interface. This action is not performed if the settings wrapper class is marked with <xref:System.Configuration.NoSettingsVersionUpgradeAttribute>. - -- It reloads the values for all of the application settings. - - You can override the default behavior of <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> to implement custom upgrading or merging behavior. Use the <xref:System.Configuration.ApplicationSettingsBase.GetPreviousVersion%2A> method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: - -- Using new policy defaults that override one or more of the previous user-specified values or previous defaults. - -- Special translation of old values to be compatible with newer ranges, a different settings property group, and so on. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> method performs two actions to assure smooth transition to a new version of an application: + +- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A?displayProperty=nameWithType> method, assuming they have implemented the <xref:System.Configuration.IApplicationSettingsProvider> interface. This action is not performed if the settings wrapper class is marked with <xref:System.Configuration.NoSettingsVersionUpgradeAttribute>. + +- It reloads the values for all of the application settings. + + You can override the default behavior of <xref:System.Configuration.ApplicationSettingsBase.Upgrade%2A> to implement custom upgrading or merging behavior. Use the <xref:System.Configuration.ApplicationSettingsBase.GetPreviousVersion%2A> method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: + +- Using new policy defaults that override one or more of the previous user-specified values or previous defaults. + +- Special translation of old values to be compatible with newer ranges, a different settings property group, and so on. + ]]></format> </remarks> <exception cref="T:System.Configuration.ConfigurationErrorsException">The configuration file could not be parsed.</exception> diff --git a/xml/System.Configuration/ClientSettingsSection.xml b/xml/System.Configuration/ClientSettingsSection.xml index 5f354fdb2e2..8dde93cc2f3 100644 --- a/xml/System.Configuration/ClientSettingsSection.xml +++ b/xml/System.Configuration/ClientSettingsSection.xml @@ -33,21 +33,21 @@ <Docs> <summary>Represents a group of user-scoped application settings in a configuration file.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Configuration.LocalFileSettingsProvider" /> <altmember cref="T:System.Configuration.AppSettingsSection" /> <altmember cref="T:System.Configuration.IConfigurationSectionHandler" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -83,11 +83,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Configuration.ClientSettingsSection" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The default <xref:System.Configuration.ClientSettingsSection.%23ctor%2A> constructor initializes the <xref:System.Configuration.ClientSettingsSection.Settings%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The default <xref:System.Configuration.ClientSettingsSection.%23ctor%2A> constructor initializes the <xref:System.Configuration.ClientSettingsSection.Settings%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Configuration.ClientSettingsSection.Settings" /> @@ -172,11 +172,11 @@ <summary>Gets the collection of client settings for the section.</summary> <value>A <see cref="T:System.Configuration.SettingElementCollection" /> containing all the client settings found in the current configuration section.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ClientSettingsSection.Settings%2A> property is itself a configuration property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ClientSettingsSection.Settings%2A> property is itself a configuration property. + ]]></format> </remarks> <altmember cref="T:System.Configuration.ConfigurationPropertyAttribute" /> diff --git a/xml/System.Configuration/DefaultSettingValueAttribute.xml b/xml/System.Configuration/DefaultSettingValueAttribute.xml index 97758453624..d1f85638afb 100644 --- a/xml/System.Configuration/DefaultSettingValueAttribute.xml +++ b/xml/System.Configuration/DefaultSettingValueAttribute.xml @@ -38,37 +38,37 @@ <Docs> <summary>Specifies the default value for an application settings property.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!IMPORTANT] -> <xref:System.Configuration.DefaultSettingValueAttribute> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. - - Different settings providers may have different requirements or limitations on the use of the <xref:System.Configuration.DefaultSettingValueAttribute>. For example, the <xref:System.Configuration.LocalFileSettingsProvider> does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. - - <xref:System.Configuration.DefaultSettingValueAttribute> requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the <xref:System.Configuration.SettingsSerializeAsAttribute>. - +> <xref:System.Configuration.DefaultSettingValueAttribute> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. + + Different settings providers may have different requirements or limitations on the use of the <xref:System.Configuration.DefaultSettingValueAttribute>. For example, the <xref:System.Configuration.LocalFileSettingsProvider> does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. + + <xref:System.Configuration.DefaultSettingValueAttribute> requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the <xref:System.Configuration.SettingsSerializeAsAttribute>. + > [!CAUTION] -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Configuration.DefaultSettingValueAttribute> applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the <xref:System.Configuration.ApplicationSettingsBase> class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. - - The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. - +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Configuration.DefaultSettingValueAttribute> applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the <xref:System.Configuration.ApplicationSettingsBase> class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. + + The full code example is listed in the <xref:System.Configuration.ApplicationSettingsBase> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProvider" /> <altmember cref="T:System.Configuration.LocalFileSettingsProvider" /> <altmember cref="T:System.Configuration.SettingsSerializeAsAttribute" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -108,14 +108,14 @@ <param name="value">A <see cref="T:System.String" /> that represents the default value for the property.</param> <summary>Initializes an instance of the <see cref="T:System.Configuration.DefaultSettingValueAttribute" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The supplied string must be a value that is compatible with the available serialization mechanism associated with the property type. For example, if the property is of type <xref:System.Drawing.Color>, then a `value` of `"Azure"` would be valid. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The supplied string must be a value that is compatible with the available serialization mechanism associated with the property type. For example, if the property is of type <xref:System.Drawing.Color>, then a `value` of `"Azure"` would be valid. + > [!CAUTION] -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. - +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. + ]]></format> </remarks> <altmember cref="P:System.Configuration.DefaultSettingValueAttribute.Value" /> @@ -159,13 +159,13 @@ <summary>Gets the default value for the application settings property.</summary> <value>A <see cref="T:System.String" /> that represents the default value for the property.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.DefaultSettingValueAttribute.Value%2A> property is set in the <xref:System.Configuration.DefaultSettingValueAttribute.%23ctor%2A> constructor. - - Setting providers may support multiple serialization schemes that can be specified with the <xref:System.Configuration.SettingsSerializeAsAttribute>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.DefaultSettingValueAttribute.Value%2A> property is set in the <xref:System.Configuration.DefaultSettingValueAttribute.%23ctor%2A> constructor. + + Setting providers may support multiple serialization schemes that can be specified with the <xref:System.Configuration.SettingsSerializeAsAttribute>. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsSerializeAsAttribute" /> diff --git a/xml/System.Configuration/IApplicationSettingsProvider.xml b/xml/System.Configuration/IApplicationSettingsProvider.xml index d54bfa0b123..42ae92224bf 100644 --- a/xml/System.Configuration/IApplicationSettingsProvider.xml +++ b/xml/System.Configuration/IApplicationSettingsProvider.xml @@ -30,27 +30,27 @@ <Docs> <summary>Defines extended capabilities for client-based application settings providers.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The application settings architecture enables you to provide a custom storage mechanism for application settings by creating a custom settings provider, which is a class derived from <xref:System.Configuration.SettingsProvider>. Such a class contains the basic functionality for storing and retrieving properties. However, you can add additional standardized functionality by implementing the <xref:System.Configuration.IApplicationSettingsProvider> interface in the custom settings provider. This interface contains three methods that primarily enable the settings provider to more intelligently handle application version changes. Typically, the settings provider will store application settings for different versions of an application separately to anticipate the following circumstances: - -- Side-by-side execution of different versions of an application. - -- Retaining application settings when upgrading an application. - -- Resetting the application settings to their default values for the currently used version. - - The <xref:System.Configuration.LocalFileSettingsProvider> class implements the <xref:System.Configuration.IApplicationSettingsProvider> interface. The same set of methods contained by <xref:System.Configuration.IApplicationSettingsProvider> is also found in the <xref:System.Configuration.ApplicationSettingsBase> class, enabling the establishment of a predefined communication channel between an application settings wrapper and its settings provider. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The application settings architecture enables you to provide a custom storage mechanism for application settings by creating a custom settings provider, which is a class derived from <xref:System.Configuration.SettingsProvider>. Such a class contains the basic functionality for storing and retrieving properties. However, you can add additional standardized functionality by implementing the <xref:System.Configuration.IApplicationSettingsProvider> interface in the custom settings provider. This interface contains three methods that primarily enable the settings provider to more intelligently handle application version changes. Typically, the settings provider will store application settings for different versions of an application separately to anticipate the following circumstances: + +- Side-by-side execution of different versions of an application. + +- Retaining application settings when upgrading an application. + +- Resetting the application settings to their default values for the currently used version. + + The <xref:System.Configuration.LocalFileSettingsProvider> class implements the <xref:System.Configuration.IApplicationSettingsProvider> interface. The same set of methods contained by <xref:System.Configuration.IApplicationSettingsProvider> is also found in the <xref:System.Configuration.ApplicationSettingsBase> class, enabling the establishment of a predefined communication channel between an application settings wrapper and its settings provider. + > [!NOTE] -> This interface is optional. If a provider does not implement this interface, the settings infrastructure will fail without notification if it attempts to access any of the methods defined by this interface. - +> This interface is optional. If a provider does not implement this interface, the settings infrastructure will fail without notification if it attempts to access any of the methods defined by this interface. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProvider" /> <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> </Docs> <Members> <Member MemberName="GetPreviousVersion"> @@ -90,11 +90,11 @@ <summary>Returns the value of the specified settings property for the previous version of the same application.</summary> <returns>A <see cref="T:System.Configuration.SettingsPropertyValue" /> containing the value of the specified property setting as it was last set in the previous version of the application; or <see langword="null" /> if the setting cannot be found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Configuration.IApplicationSettingsProvider.GetPreviousVersion%2A> method in conjunction with the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method to migrate application settings during or after the installation of a new version of an application. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Configuration.IApplicationSettingsProvider.GetPreviousVersion%2A> method in conjunction with the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method to migrate application settings during or after the installation of a new version of an application. + ]]></format> </remarks> <altmember cref="M:System.Configuration.IApplicationSettingsProvider.Upgrade(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyCollection)" /> @@ -136,13 +136,13 @@ <param name="context">A <see cref="T:System.Configuration.SettingsContext" /> describing the current application usage.</param> <summary>Resets the application settings associated with the specified application to their default values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.IApplicationSettingsProvider.Reset%2A> method reinitializes the stored values of the specified application settings group. In contrast, <xref:System.Configuration.DefaultSettingValueAttribute> supplies a default value for a single settings property during property initialization, if it has no stored value. - - The settings provider determines what reasonable defaults are for the specified group of application settings. For example, the implementation in <xref:System.Configuration.LocalFileSettingsProvider> resets user-scoped settings to their shared values in the `application.exe.config` file; in contrast, it leaves the application-scoped settings unchanged. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.IApplicationSettingsProvider.Reset%2A> method reinitializes the stored values of the specified application settings group. In contrast, <xref:System.Configuration.DefaultSettingValueAttribute> supplies a default value for a single settings property during property initialization, if it has no stored value. + + The settings provider determines what reasonable defaults are for the specified group of application settings. For example, the implementation in <xref:System.Configuration.LocalFileSettingsProvider> resets user-scoped settings to their shared values in the `application.exe.config` file; in contrast, it leaves the application-scoped settings unchanged. + ]]></format> </remarks> <altmember cref="T:System.Configuration.DefaultSettingValueAttribute" /> @@ -185,15 +185,15 @@ <param name="properties">A <see cref="T:System.Configuration.SettingsPropertyCollection" /> containing the settings property group whose values are to be retrieved.</param> <summary>Indicates to the provider that the application has been upgraded. This offers the provider an opportunity to upgrade its stored settings as appropriate.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The .NET Framework enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method, implemented in a class derived from <xref:System.Configuration.SettingsProvider>. - - You can use the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method in conjunction with the <xref:System.Configuration.IApplicationSettingsProvider.GetPreviousVersion%2A> method to migrate application settings during or after the installation of a new version of an application. - - This method should be suppressed for every application setting that has the <xref:System.Configuration.NoSettingsVersionUpgradeAttribute> is applied to it, or to the entire settings wrapper class, derived from <xref:System.Configuration.ApplicationSettingsBase>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The .NET Framework enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method, implemented in a class derived from <xref:System.Configuration.SettingsProvider>. + + You can use the <xref:System.Configuration.IApplicationSettingsProvider.Upgrade%2A> method in conjunction with the <xref:System.Configuration.IApplicationSettingsProvider.GetPreviousVersion%2A> method to migrate application settings during or after the installation of a new version of an application. + + This method should be suppressed for every application setting that has the <xref:System.Configuration.NoSettingsVersionUpgradeAttribute> is applied to it, or to the entire settings wrapper class, derived from <xref:System.Configuration.ApplicationSettingsBase>. + ]]></format> </remarks> <altmember cref="M:System.Configuration.IApplicationSettingsProvider.GetPreviousVersion(System.Configuration.SettingsContext,System.Configuration.SettingsProperty)" /> diff --git a/xml/System.Configuration/IPersistComponentSettings.xml b/xml/System.Configuration/IPersistComponentSettings.xml index 8ae71245a2d..abba951bd0b 100644 --- a/xml/System.Configuration/IPersistComponentSettings.xml +++ b/xml/System.Configuration/IPersistComponentSettings.xml @@ -30,15 +30,15 @@ <Docs> <summary>Defines standard functionality for controls or libraries that store and retrieve application settings.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Typically, you can add application settings support to an application by creating a settings wrapper class, which is derived from <xref:System.Configuration.ApplicationSettingsBase>, and then add special properties to this class. However, this approach does not sufficiently encapsulate application settings for a control so that its container is shielded from the details. The <xref:System.Configuration.IPersistComponentSettings> interface provides an application with a standard interface for communicating application settings state change requests to a control, component, or library module. Design-time tools also depend on this interface to properly manage controls and components. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Typically, you can add application settings support to an application by creating a settings wrapper class, which is derived from <xref:System.Configuration.ApplicationSettingsBase>, and then add special properties to this class. However, this approach does not sufficiently encapsulate application settings for a control so that its container is shielded from the details. The <xref:System.Configuration.IPersistComponentSettings> interface provides an application with a standard interface for communicating application settings state change requests to a control, component, or library module. Design-time tools also depend on this interface to properly manage controls and components. + ]]></format> </remarks> <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> </Docs> <Members> <Member MemberName="LoadComponentSettings"> @@ -72,15 +72,15 @@ <Docs> <summary>Reads the control's application settings into their corresponding properties and updates the control's state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - In general, the <xref:System.Configuration.IPersistComponentSettings.LoadComponentSettings%2A> method performs two essential operations: - -- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> methods. - -- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, <xref:System.Configuration.IPersistComponentSettings.LoadComponentSettings%2A> should ensure that the control's <xref:System.Windows.Forms.Control.Location%2A> property is updated to reflect this reloaded setting. - + <format type="text/markdown"><![CDATA[ + +## Remarks + In general, the <xref:System.Configuration.IPersistComponentSettings.LoadComponentSettings%2A> method performs two essential operations: + +- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their <xref:System.Configuration.ApplicationSettingsBase.Reload%2A> methods. + +- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, <xref:System.Configuration.IPersistComponentSettings.LoadComponentSettings%2A> should ensure that the control's <xref:System.Windows.Forms.Control.Location%2A> property is updated to reflect this reloaded setting. + ]]></format> </remarks> <altmember cref="M:System.Configuration.IPersistComponentSettings.SaveComponentSettings" /> @@ -119,11 +119,11 @@ <Docs> <summary>Resets the control's application settings properties to their default values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The implementation of the <xref:System.Configuration.IPersistComponentSettings.ResetComponentSettings%2A> method typically calls the <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method on each instance of an application settings class it contains. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The implementation of the <xref:System.Configuration.IPersistComponentSettings.ResetComponentSettings%2A> method typically calls the <xref:System.Configuration.ApplicationSettingsBase.Reset%2A> method on each instance of an application settings class it contains. + ]]></format> </remarks> <altmember cref="M:System.Configuration.IPersistComponentSettings.LoadComponentSettings" /> @@ -161,14 +161,14 @@ <Docs> <summary>Persists the control's application settings properties.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the <xref:System.Configuration.SettingsProviderAttribute>. You can override the choice of the settings provider by using the <xref:System.Configuration.ISettingsProviderService> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the <xref:System.Configuration.SettingsProviderAttribute>. You can override the choice of the settings provider by using the <xref:System.Configuration.ISettingsProviderService> interface. + > [!NOTE] -> If the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property is `true`, the control should call <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> in its own <xref:System.Windows.Forms.Control.Dispose%2A> method so that the control's configuration data is stored automatically before the application ends. - +> If the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property is `true`, the control should call <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> in its own <xref:System.Windows.Forms.Control.Dispose%2A> method so that the control's configuration data is stored automatically before the application ends. + ]]></format> </remarks> <altmember cref="P:System.Configuration.IPersistComponentSettings.SaveSettings" /> @@ -212,40 +212,40 @@ <value> <see langword="true" /> if the control should automatically persist its state; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If a control contains configuration data, it will typically persist this data in response to an explicit call to the <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> method or sometimes implicitly when the control's <xref:System.Windows.Forms.Control.Dispose%2A> method is invoked. The <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property determines whether a control automatically persists its configuration data when it is disposed. - - The default value of <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property is. - - - -## Examples - The following code example shows the proper way for a control to check the value of the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property before it attempts to automatically persist its configuration data. - - `protected override void Dispose( bool disposing ) {` - - `if(disposing) {` - - `try {` - - `if (SaveSettings) {` - - `SaveComponentSettings();` - - `}` - - `}` - - `finally {` - - `//...` - - `}` - - `}` - + <format type="text/markdown"><![CDATA[ + +## Remarks + If a control contains configuration data, it will typically persist this data in response to an explicit call to the <xref:System.Configuration.IPersistComponentSettings.SaveComponentSettings%2A> method or sometimes implicitly when the control's <xref:System.Windows.Forms.Control.Dispose%2A> method is invoked. The <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property determines whether a control automatically persists its configuration data when it is disposed. + + The default value of <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property is. + + + +## Examples + The following code example shows the proper way for a control to check the value of the <xref:System.Configuration.IPersistComponentSettings.SaveSettings%2A> property before it attempts to automatically persist its configuration data. + + `protected override void Dispose( bool disposing ) {` + + `if(disposing) {` + + `try {` + + `if (SaveSettings) {` + + `SaveComponentSettings();` + + `}` + + `}` + + `finally {` + + `//...` + + `}` + + `}` + ]]></format> </remarks> <altmember cref="M:System.Configuration.IPersistComponentSettings.SaveComponentSettings" /> @@ -283,26 +283,26 @@ <summary>Gets or sets the value of the application settings key for the current instance of the control.</summary> <value>A <see cref="T:System.String" /> containing the settings key for the current instance of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A> property to disambiguate groups of application settings properties when there are multiple instances of the same wrapper class. For example, if a control contains an associated wrapper class, then placing multiple instances of the same control in the same application will typically result in multiple instances of the wrapper class. A settings key is required only when the configuration data differs on a per-instance basis; for example, the location of dynamically positioned controls. - - The following general rules apply to the use of <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A>: - -- A control, like any class, may contain zero or more application settings classes, derived from <xref:System.Configuration.ApplicationSettingsBase>. Each settings class contains its own <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A?displayProperty=nameWithType> property, which helps disambiguate multiple instances of that class. - -- A control should separate its per-instance data and its shared data into different settings classes. - -- For a control with any per-instance configuration data, the `get` accessor of the <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A> property should default to the <xref:System.Windows.Forms.Control.Name%2A> of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. - -- The `set` accessor for this property should be implemented to distinguish between settings classes containing per-instance and shared configuration data. For each settings class containing per-instance data, `set` should just pass-through to the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A?displayProperty=nameWithType> property of the settings class. For settings classes containing shared data, `set` should perform no action for that settings class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A> property to disambiguate groups of application settings properties when there are multiple instances of the same wrapper class. For example, if a control contains an associated wrapper class, then placing multiple instances of the same control in the same application will typically result in multiple instances of the wrapper class. A settings key is required only when the configuration data differs on a per-instance basis; for example, the location of dynamically positioned controls. + + The following general rules apply to the use of <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A>: + +- A control, like any class, may contain zero or more application settings classes, derived from <xref:System.Configuration.ApplicationSettingsBase>. Each settings class contains its own <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A?displayProperty=nameWithType> property, which helps disambiguate multiple instances of that class. + +- A control should separate its per-instance data and its shared data into different settings classes. + +- For a control with any per-instance configuration data, the `get` accessor of the <xref:System.Configuration.IPersistComponentSettings.SettingsKey%2A> property should default to the <xref:System.Windows.Forms.Control.Name%2A> of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. + +- The `set` accessor for this property should be implemented to distinguish between settings classes containing per-instance and shared configuration data. For each settings class containing per-instance data, `set` should just pass-through to the <xref:System.Configuration.ApplicationSettingsBase.SettingsKey%2A?displayProperty=nameWithType> property of the settings class. For settings classes containing shared data, `set` should perform no action for that settings class. + ]]></format> </remarks> <altmember cref="M:System.Configuration.IPersistComponentSettings.SaveComponentSettings" /> <altmember cref="P:System.Configuration.ApplicationSettingsBase.SettingsKey" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> </Docs> </Member> </Members> diff --git a/xml/System.Configuration/ISettingsProviderService.xml b/xml/System.Configuration/ISettingsProviderService.xml index 68c9d06ae47..5c87f43207a 100644 --- a/xml/System.Configuration/ISettingsProviderService.xml +++ b/xml/System.Configuration/ISettingsProviderService.xml @@ -30,13 +30,13 @@ <Docs> <summary>Provides an interface for defining an alternate application settings provider.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.IPersistComponentSettings> interface enables controls and components hosted in an application to persist their application settings in a manner largely transparent to the application. However, in some cases, the application or environment may need to override the settings provider natively used by a component with one of its own choosing. The <xref:System.Configuration.ISettingsProviderService> interface enables the creation of a lightweight service that communicates such an alternate settings provider, typically offered through the owning <xref:System.ComponentModel.Container>. - - <xref:System.Configuration.ISettingsProviderService> is commonly used by design-time tools and debuggers that provide special support for application settings. To make such an arrangement function seamlessly, the <xref:System.Configuration.ApplicationSettingsBase> class contains constructors that take a reference to the owning component. These constructors automatically query for compatible settings providers. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.IPersistComponentSettings> interface enables controls and components hosted in an application to persist their application settings in a manner largely transparent to the application. However, in some cases, the application or environment may need to override the settings provider natively used by a component with one of its own choosing. The <xref:System.Configuration.ISettingsProviderService> interface enables the creation of a lightweight service that communicates such an alternate settings provider, typically offered through the owning <xref:System.ComponentModel.Container>. + + <xref:System.Configuration.ISettingsProviderService> is commonly used by design-time tools and debuggers that provide special support for application settings. To make such an arrangement function seamlessly, the <xref:System.Configuration.ApplicationSettingsBase> class contains constructors that take a reference to the owning component. These constructors automatically query for compatible settings providers. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProvider" /> @@ -44,7 +44,7 @@ <altmember cref="T:System.Configuration.IPersistComponentSettings" /> <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> <altmember cref="M:System.IServiceProvider.GetService(System.Type)" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-custom-controls">Application Settings for Custom Controls</related> </Docs> <Members> <Member MemberName="GetSettingsProvider"> @@ -82,11 +82,11 @@ <summary>Returns the settings provider compatible with the specified settings property.</summary> <returns>If found, the <see cref="T:System.Configuration.SettingsProvider" /> that can persist the specified settings property; otherwise, <see langword="null" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.ISettingsProviderService.GetSettingsProvider%2A> method enables an <xref:System.Configuration.ISettingsProviderService> to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.ISettingsProviderService.GetSettingsProvider%2A> method enables an <xref:System.Configuration.ISettingsProviderService> to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProvider" /> diff --git a/xml/System.Configuration/LocalFileSettingsProvider.xml b/xml/System.Configuration/LocalFileSettingsProvider.xml index 73e5b5858f2..6027402b57d 100644 --- a/xml/System.Configuration/LocalFileSettingsProvider.xml +++ b/xml/System.Configuration/LocalFileSettingsProvider.xml @@ -36,19 +36,19 @@ <Docs> <summary>Provides persistence for application settings classes.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProviderAttribute" /> @@ -57,7 +57,7 @@ <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> <altmember cref="T:System.Configuration.ClientSettingsSection" /> <altmember cref="T:System.Configuration.IConfigurationSectionHandler" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -87,11 +87,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Configuration.LocalFileSettingsProvider" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The parameterless constructor sets the <xref:System.Configuration.LocalFileSettingsProvider.ApplicationName%2A> property to <xref:System.String.Empty>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The parameterless constructor sets the <xref:System.Configuration.LocalFileSettingsProvider.ApplicationName%2A> property to <xref:System.String.Empty>. + ]]></format> </remarks> <altmember cref="P:System.Configuration.LocalFileSettingsProvider.ApplicationName" /> @@ -138,11 +138,11 @@ <summary>Gets or sets the name of the currently running application.</summary> <value>A string that contains the application's display name.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.LocalFileSettingsProvider.ApplicationName%2A> and <xref:System.Configuration.Provider.ProviderBase.Name%2A> properties help to disambiguate similarly named setting properties in different applications. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.LocalFileSettingsProvider.ApplicationName%2A> and <xref:System.Configuration.Provider.ProviderBase.Name%2A> properties help to disambiguate similarly named setting properties in different applications. + ]]></format> </remarks> <altmember cref="P:System.Configuration.Provider.ProviderBase.Name" /> @@ -188,11 +188,11 @@ <summary>Returns the value of the named settings property for the previous version of the same application.</summary> <returns>A <see cref="T:System.Configuration.SettingsPropertyValue" /> representing the application setting if found; otherwise, <see langword="null" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.LocalFileSettingsProvider.GetPreviousVersion%2A> method is often used in conjunction with the <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A> method when migrating application settings during the installation of a new version of an application. For more information, see the <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.LocalFileSettingsProvider.GetPreviousVersion%2A> method is often used in conjunction with the <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A> method when migrating application settings during the installation of a new version of an application. For more information, see the <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A> method. + ]]></format> </remarks> <altmember cref="M:System.Configuration.LocalFileSettingsProvider.GetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyCollection)" /> @@ -238,14 +238,14 @@ <summary>Returns the collection of setting property values for the specified application instance and settings property group.</summary> <returns>A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> containing the values for the specified settings property group.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.LocalFileSettingsProvider.GetPropertyValues%2A> method also manages the special application settings type <xref:System.Configuration.SpecialSetting.ConnectionString>. Connection strings are stored in a special section of the configuration file delimited by the element `<connectionstrings>`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.LocalFileSettingsProvider.GetPropertyValues%2A> method also manages the special application settings type <xref:System.Configuration.SpecialSetting.ConnectionString>. Connection strings are stored in a special section of the configuration file delimited by the element `<connectionstrings>`. + > [!CAUTION] -> <xref:System.Configuration.LocalFileSettingsProvider> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). - +> <xref:System.Configuration.LocalFileSettingsProvider> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). + ]]></format> </remarks> <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings.</exception> @@ -330,17 +330,17 @@ <param name="context">A <see cref="T:System.Configuration.SettingsContext" /> describing the current application usage.</param> <summary>Resets all application settings properties associated with the specified application to their default values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.LocalFileSettingsProvider.Reset%2A> method restores the stored values of the specified application settings group. The action of <xref:System.Configuration.LocalFileSettingsProvider.Reset%2A> depends on the scope of the application settings property: - -- Application-scoped settings are not affected. - -- User-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, `application.exe.config`. If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile. - - Notice that if roaming profiles are used, there can be two `user.config` files, one for the local settings and one for the roaming profile. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.LocalFileSettingsProvider.Reset%2A> method restores the stored values of the specified application settings group. The action of <xref:System.Configuration.LocalFileSettingsProvider.Reset%2A> depends on the scope of the application settings property: + +- Application-scoped settings are not affected. + +- User-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, `application.exe.config`. If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile. + + Notice that if roaming profiles are used, there can be two `user.config` files, one for the local settings and one for the roaming profile. + ]]></format> </remarks> <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings.</exception> @@ -387,32 +387,32 @@ <param name="values">A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> representing the group of property settings to set.</param> <summary>Sets the values of the specified group of property settings.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A settings wrapper class, derived from <xref:System.Configuration.ApplicationSettingsBase>, contains the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method for each <xref:System.Configuration.SettingsProvider> to perform the actual serialization operation. - - <xref:System.Configuration.LocalFileSettingsProvider.SetPropertyValues%2A> individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. - - By default, the <xref:System.Configuration.LocalFileSettingsProvider.SetPropertyValues%2A> method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: - -1. If the type has an associated <xref:System.ComponentModel.TypeConverter> with a <xref:System.ComponentModel.TypeConverter.ConvertToString%2A> method implementation, this conversion is used. - -2. XML serialization is used. - - However, you can specify a preferred serialization mechanism by using the <xref:System.Configuration.SettingsSerializeAsAttribute>. <xref:System.Configuration.LocalFileSettingsProvider> does not support binary serialization in Visual Studio 2005. - - If a user-scoped settings property is set back to its default value explicitly, then the local file settings provider will remove the entry for the associated setting from the user configuration file. The next read access for this property will simply use the default value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A settings wrapper class, derived from <xref:System.Configuration.ApplicationSettingsBase>, contains the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method for each <xref:System.Configuration.SettingsProvider> to perform the actual serialization operation. + + <xref:System.Configuration.LocalFileSettingsProvider.SetPropertyValues%2A> individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. + + By default, the <xref:System.Configuration.LocalFileSettingsProvider.SetPropertyValues%2A> method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: + +1. If the type has an associated <xref:System.ComponentModel.TypeConverter> with a <xref:System.ComponentModel.TypeConverter.ConvertToString%2A> method implementation, this conversion is used. + +2. XML serialization is used. + + However, you can specify a preferred serialization mechanism by using the <xref:System.Configuration.SettingsSerializeAsAttribute>. <xref:System.Configuration.LocalFileSettingsProvider> does not support binary serialization in Visual Studio 2005. + + If a user-scoped settings property is set back to its default value explicitly, then the local file settings provider will remove the entry for the associated setting from the user configuration file. The next read access for this property will simply use the default value. + > [!CAUTION] -> <xref:System.Configuration.LocalFileSettingsProvider> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). - +> <xref:System.Configuration.LocalFileSettingsProvider> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). + ]]></format> </remarks> - <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings. - - -or- - + <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings. + + -or- + There was a general failure saving the settings to the configuration file.</exception> <altmember cref="M:System.Configuration.LocalFileSettingsProvider.GetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyCollection)" /> <altmember cref="M:System.Configuration.ApplicationSettingsBase.Save" /> @@ -459,27 +459,27 @@ <param name="properties">A <see cref="T:System.Configuration.SettingsPropertyCollection" /> containing the settings property group whose values are to be retrieved.</param> <summary>Attempts to migrate previous user-scoped settings from a previous version of the same application.</summary> <remarks> - <format type="text/markdown"><. - -- Standard Windows Forms and console applications must manually call <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A>, because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. - - Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application. - + <format type="text/markdown"><. + +- Standard Windows Forms and console applications must manually call <xref:System.Configuration.LocalFileSettingsProvider.Upgrade%2A>, because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. + + Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application. + ]]></format> </remarks> - <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings. - - -or- - + <exception cref="T:System.Configuration.ConfigurationErrorsException">A user-scoped setting was encountered but the current configuration only supports application-scoped settings. + + -or- + The previous version of the configuration file could not be accessed.</exception> <altmember cref="M:System.Configuration.LocalFileSettingsProvider.GetPreviousVersion(System.Configuration.SettingsContext,System.Configuration.SettingsProperty)" /> <altmember cref="M:System.Configuration.LocalFileSettingsProvider.Reset(System.Configuration.SettingsContext)" /> diff --git a/xml/System.Configuration/SettingsManageabilityAttribute.xml b/xml/System.Configuration/SettingsManageabilityAttribute.xml index 7747a4a588c..d8212fad312 100644 --- a/xml/System.Configuration/SettingsManageabilityAttribute.xml +++ b/xml/System.Configuration/SettingsManageabilityAttribute.xml @@ -38,18 +38,18 @@ <Docs> <summary>Specifies special services for application settings properties. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsManageability" /> <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms">Application Settings for Windows Forms</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -89,11 +89,11 @@ <param name="manageability">A <see cref="T:System.Configuration.SettingsManageability" /> value that enumerates the services being requested.</param> <summary>Initializes a new instance of the <see cref="T:System.Configuration.SettingsManageabilityAttribute" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Multiple services can be requested by combining together values defined by the <xref:System.Configuration.SettingsManageability> enumeration with the logical `OR` operator. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Multiple services can be requested by combining together values defined by the <xref:System.Configuration.SettingsManageability> enumeration with the logical `OR` operator. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsManageability" /> @@ -136,11 +136,11 @@ <summary>Gets the set of special services that have been requested.</summary> <value>A value that results from using the logical <see langword="OR" /> operator to combine all the <see cref="T:System.Configuration.SettingsManageability" /> enumeration values corresponding to the requested services.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is set in the <xref:System.Configuration.SettingsManageabilityAttribute.%23ctor%2A> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is set in the <xref:System.Configuration.SettingsManageabilityAttribute.%23ctor%2A> constructor. + ]]></format> </remarks> <altmember cref="M:System.Configuration.SettingsManageabilityAttribute.#ctor(System.Configuration.SettingsManageability)" /> diff --git a/xml/System.Configuration/SettingsProvider.xml b/xml/System.Configuration/SettingsProvider.xml index 572b5d37b6d..ad2b73f58eb 100644 --- a/xml/System.Configuration/SettingsProvider.xml +++ b/xml/System.Configuration/SettingsProvider.xml @@ -32,25 +32,25 @@ <Docs> <summary>Acts as a base class for deriving custom settings providers in the application settings architecture.</summary> <remarks> - <format type="text/markdown"><. A custom setting provider should resolve attributes applied to settings properties in the following manner: - -1. If the provider can fulfill the request implied by the attribute, obviously it should do so. - -2. If the provider cannot fulfill the request, it should ignore it silently. - -3. If two or more properties conflict; for example, a property being decorated with both <xref:System.Configuration.ApplicationScopedSettingAttribute> and <xref:System.Configuration.UserScopedSettingAttribute>; the provider should throw a <xref:System.Configuration.ConfigurationException>. - + <format type="text/markdown"><. A custom setting provider should resolve attributes applied to settings properties in the following manner: + +1. If the provider can fulfill the request implied by the attribute, obviously it should do so. + +2. If the provider cannot fulfill the request, it should ignore it silently. + +3. If two or more properties conflict; for example, a property being decorated with both <xref:System.Configuration.ApplicationScopedSettingAttribute> and <xref:System.Configuration.UserScopedSettingAttribute>; the provider should throw a <xref:System.Configuration.ConfigurationException>. + ]]></format> </remarks> <altmember cref="T:System.Configuration.IApplicationSettingsProvider" /> @@ -58,8 +58,8 @@ <altmember cref="T:System.Configuration.SettingsProviderAttribute" /> <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> <altmember cref="T:System.Configuration.ConfigurationException" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-attributes">Application Settings Attributes</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-attributes">Application Settings Attributes</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -95,17 +95,17 @@ <Docs> <summary>Initializes an instance of the <see cref="T:System.Configuration.SettingsProvider" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This is this default protected constructor for this abstract class. Derived custom settings providers are not required to provide an explicit constructor because the <xref:System.Configuration.Provider.ProviderBase.Initialize%2A> method typically performs all initialization. - - Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property: - -1. Call the <xref:System.ComponentModel.Component.GetService%2A> method on the current <xref:System.ComponentModel.Component> or <xref:System.ComponentModel.ISite> to return a reference to the current <xref:System.Configuration.ISettingsProviderService>. - -2. Call the <xref:System.Configuration.ISettingsProviderService.GetSettingsProvider%2A> method of the <xref:System.Configuration.ISettingsProviderService> retrieved in the first step to return the settings provider. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This is this default protected constructor for this abstract class. Derived custom settings providers are not required to provide an explicit constructor because the <xref:System.Configuration.Provider.ProviderBase.Initialize%2A> method typically performs all initialization. + + Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property: + +1. Call the <xref:System.ComponentModel.Component.GetService%2A> method on the current <xref:System.ComponentModel.Component> or <xref:System.ComponentModel.ISite> to return a reference to the current <xref:System.Configuration.ISettingsProviderService>. + +2. Call the <xref:System.Configuration.ISettingsProviderService.GetSettingsProvider%2A> method of the <xref:System.Configuration.ISettingsProviderService> retrieved in the first step to return the settings provider. + ]]></format> </remarks> <altmember cref="M:System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection)" /> @@ -144,11 +144,11 @@ <summary>Gets or sets the name of the currently running application.</summary> <value>A <see cref="T:System.String" /> that contains the application's shortened name, which does not contain a full path or extension, for example, <c>SimpleAppSettings</c>.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.SettingsProvider.ApplicationName%2A> and <xref:System.Configuration.Provider.ProviderBase.Name%2A> properties help to disambiguate similarly named setting properties in different applications. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.SettingsProvider.ApplicationName%2A> and <xref:System.Configuration.Provider.ProviderBase.Name%2A> properties help to disambiguate similarly named setting properties in different applications. + ]]></format> </remarks> <altmember cref="P:System.Configuration.Provider.ProviderBase.Name" /> @@ -191,11 +191,11 @@ <summary>Returns the collection of settings property values for the specified application instance and settings property group.</summary> <returns>A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> containing the values for the specified settings property group.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.SettingsProvider.GetPropertyValues%2A> method must be implemented to handle special settings, those marked with <xref:System.Configuration.SpecialSettingAttribute>, as well as reconcile application and user settings. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.SettingsProvider.GetPropertyValues%2A> method must be implemented to handle special settings, those marked with <xref:System.Configuration.SpecialSettingAttribute>, as well as reconcile application and user settings. + ]]></format> </remarks> <altmember cref="M:System.Configuration.SettingsProvider.SetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyValueCollection)" /> @@ -238,17 +238,17 @@ <param name="collection">A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> representing the group of property settings to set.</param> <summary>Sets the values of the specified group of property settings.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Configuration.ApplicationSettingsBase> contains the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method for each <xref:System.Configuration.SettingsProvider> to perform the actual serialization operation. - - The <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method should be implemented with security in mind: - -- Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings. - -- Usage quotas should be considered to guard against resource attacks by partially trusted applications. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Configuration.ApplicationSettingsBase> contains the <xref:System.Configuration.ApplicationSettingsBase.Save%2A> method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method for each <xref:System.Configuration.SettingsProvider> to perform the actual serialization operation. + + The <xref:System.Configuration.SettingsProvider.SetPropertyValues%2A> method should be implemented with security in mind: + +- Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings. + +- Usage quotas should be considered to guard against resource attacks by partially trusted applications. + ]]></format> </remarks> <altmember cref="M:System.Configuration.SettingsProvider.GetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyCollection)" /> diff --git a/xml/System.Configuration/SettingsProviderAttribute.xml b/xml/System.Configuration/SettingsProviderAttribute.xml index d728071b564..60daf355fef 100644 --- a/xml/System.Configuration/SettingsProviderAttribute.xml +++ b/xml/System.Configuration/SettingsProviderAttribute.xml @@ -38,23 +38,23 @@ <Docs> <summary>Specifies the settings provider used to provide storage for the current application settings class or property. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each application settings class defines a group of application settings properties that represent information that persists between executions of the application. However, it is a settings provider - a class derived from <xref:System.Configuration.SettingsProvider> - that actually provides the storage mechanism. - - The <xref:System.Configuration.SettingsProviderAttribute> specifies the settings provider used to provide storage for application settings properties. This attribute can be applied to the entire application settings class or individual application settings properties. A <xref:System.Configuration.SettingsProviderAttribute> set at the property level will override the class-level attribute. If a settings provider is not explicitly specified, the default provider is used. For client applications, the default provider is <xref:System.Configuration.LocalFileSettingsProvider>. - - Setting providers cannot be determined at run time. Any run-time determination of storage methods must be coded into the settings provider class itself. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each application settings class defines a group of application settings properties that represent information that persists between executions of the application. However, it is a settings provider - a class derived from <xref:System.Configuration.SettingsProvider> - that actually provides the storage mechanism. + + The <xref:System.Configuration.SettingsProviderAttribute> specifies the settings provider used to provide storage for application settings properties. This attribute can be applied to the entire application settings class or individual application settings properties. A <xref:System.Configuration.SettingsProviderAttribute> set at the property level will override the class-level attribute. If a settings provider is not explicitly specified, the default provider is used. For client applications, the default provider is <xref:System.Configuration.LocalFileSettingsProvider>. + + Setting providers cannot be determined at run time. Any run-time determination of storage methods must be coded into the settings provider class itself. + > [!CAUTION] -> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. - +> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. + ]]></format> </remarks> <altmember cref="T:System.Configuration.SettingsProvider" /> <altmember cref="T:System.Configuration.SettingsBase" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -94,14 +94,14 @@ <param name="providerTypeName">A <see cref="T:System.String" /> containing the name of the settings provider.</param> <summary>Initializes an instance of the <see cref="T:System.Configuration.SettingsProviderAttribute" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The type name is the name of the class, derived from <xref:System.Configuration.SettingsProvider>, that is being specified as the settings provider. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The type name is the name of the class, derived from <xref:System.Configuration.SettingsProvider>, that is being specified as the settings provider. + > [!CAUTION] -> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. - +> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. + ]]></format> </remarks> <altmember cref="P:System.Configuration.SettingsProviderAttribute.ProviderTypeName" /> @@ -178,11 +178,11 @@ <summary>Gets the type name of the settings provider.</summary> <value>A <see cref="T:System.String" /> containing the name of the settings provider.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Configuration.SettingsProviderAttribute.ProviderTypeName%2A> property is set in the <xref:System.Configuration.SettingsProviderAttribute.%23ctor%2A> for the class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Configuration.SettingsProviderAttribute.ProviderTypeName%2A> property is set in the <xref:System.Configuration.SettingsProviderAttribute.%23ctor%2A> for the class. + ]]></format> </remarks> <altmember cref="M:System.Configuration.SettingsProviderAttribute.#ctor(System.String)" /> diff --git a/xml/System.Configuration/UserScopedSettingAttribute.xml b/xml/System.Configuration/UserScopedSettingAttribute.xml index 093efcd284b..4b88fdf7eb2 100644 --- a/xml/System.Configuration/UserScopedSettingAttribute.xml +++ b/xml/System.Configuration/UserScopedSettingAttribute.xml @@ -62,7 +62,7 @@ <altmember cref="T:System.Configuration.ApplicationSettingsBase" /> <altmember cref="T:System.Configuration.SettingsProvider" /> <altmember cref="T:System.Configuration.ConfigurationErrorsException" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/application-settings-architecture">Application Settings Architecture</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Media/SoundPlayer.xml b/xml/System.Media/SoundPlayer.xml index dca90a74148..0e916ee0c77 100644 --- a/xml/System.Media/SoundPlayer.xml +++ b/xml/System.Media/SoundPlayer.xml @@ -47,35 +47,33 @@ <Docs> <summary>Controls playback of a sound from a .wav file.</summary> <remarks> - <format type="text/markdown"><. - - When a <xref:System.Media.SoundPlayer> has finished loading a .wav file, it raises the <xref:System.Media.SoundPlayer.LoadCompleted> event. You can examine the <xref:System.ComponentModel.AsyncCompletedEventArgs> in your event handler to determine if the load succeeded or failed. The <xref:System.Media.SoundPlayer.SoundLocationChanged> event is raised when the audio source is set to a new file path or URL. The <xref:System.Media.SoundPlayer.StreamChanged> event is raised when the audio source is set to a new <xref:System.IO.Stream>. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - For more information about <xref:System.Media.SoundPlayer>, see [SoundPlayer Class Overview](/dotnet/framework/winforms/controls/soundplayer-class-overview). - + <format type="text/markdown"><. + + When a <xref:System.Media.SoundPlayer> has finished loading a .wav file, it raises the <xref:System.Media.SoundPlayer.LoadCompleted> event. You can examine the <xref:System.ComponentModel.AsyncCompletedEventArgs> in your event handler to determine if the load succeeded or failed. The <xref:System.Media.SoundPlayer.SoundLocationChanged> event is raised when the audio source is set to a new file path or URL. The <xref:System.Media.SoundPlayer.StreamChanged> event is raised when the audio source is set to a new <xref:System.IO.Stream>. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + For more information about <xref:System.Media.SoundPlayer>, see [SoundPlayer Class Overview](/dotnet/desktop/winforms/controls/soundplayer-class-overview). + > [!NOTE] -> The <xref:System.Media.SoundPlayer> class cannot play other file types, such as .wma or .mp3. If you want to play other file types, you can use the Windows Media Player control. For more information, see [Using the Windows Media Player Control in a .NET Framework Solution](https://go.microsoft.com/fwlink/?LinkId=131267) and [Windows Media Player Object Model Reference for Visual Basic .NET and C#](https://go.microsoft.com/fwlink/?LinkId=131269) in the Windows Media Player SDK. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer> class for playing .wav files from a local path or a Uniform Resource Identifier (URI). - +> The <xref:System.Media.SoundPlayer> class cannot play other file types, such as .wma or .mp3. If you want to play other file types, you can use the [MediaPlayer](/uwp/api/windows.media.playback.mediaplayer). + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer> class for playing .wav files from a local path or a Uniform Resource Identifier (URI). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSounds" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -114,14 +112,14 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Media.SoundPlayer" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes a <xref:System.Media.SoundPlayer> with no audio source. Until it is configured with an audio source path, the <xref:System.Media.SoundPlayer> will play a beep sound when one of its playback methods is called. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes a <xref:System.Media.SoundPlayer> with no audio source. Until it is configured with an audio source path, the <xref:System.Media.SoundPlayer> will play a beep sound when one of its playback methods is called. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName=".ctor"> @@ -162,14 +160,14 @@ <param name="stream">A <see cref="T:System.IO.Stream" /> to a .wav file.</param> <summary>Initializes a new instance of the <see cref="T:System.Media.SoundPlayer" /> class, and attaches the .wav file within the specified <see cref="T:System.IO.Stream" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.IO.Stream> passed to the `stream` parameter should be a <xref:System.IO.Stream> containing a .wav file. The data returned by the <xref:System.IO.Stream.Read%2A> method of the <xref:System.IO.Stream> should be the data within a .wav file. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.IO.Stream> passed to the `stream` parameter should be a <xref:System.IO.Stream> containing a .wav file. The data returned by the <xref:System.IO.Stream.Read%2A> method of the <xref:System.IO.Stream> should be the data within a .wav file. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName=".ctor"> @@ -203,15 +201,15 @@ <param name="soundLocation">The location of a .wav file to load.</param> <summary>Initializes a new instance of the <see cref="T:System.Media.SoundPlayer" /> class, and attaches the specified .wav file.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The string passed to the `soundLocation` parameter can be either a file path or a URL to a .wav file. If the path or URL is not valid, the <xref:System.Media.SoundPlayer> will still be constructed, but subsequent calls to a load or play method will fail. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The string passed to the `soundLocation` parameter can be either a file path or a URL to a .wav file. If the path or URL is not valid, the <xref:System.Media.SoundPlayer> will still be constructed, but subsequent calls to a load or play method will fail. + ]]></format> </remarks> <exception cref="T:System.UriFormatException">The URL value specified by <paramref name="soundLocation" /> cannot be resolved.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName=".ctor"> @@ -258,7 +256,7 @@ <summary>Initializes a new instance of the <see cref="T:System.Media.SoundPlayer" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.UriFormatException">The <see cref="P:System.Media.SoundPlayer.SoundLocation" /> specified in <paramref name="serializationInfo" /> cannot be resolved.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsLoadCompleted"> @@ -299,7 +297,7 @@ <value> <see langword="true" /> if a .wav file is loaded; <see langword="false" /> if a .wav file has not yet been loaded.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Load"> @@ -333,30 +331,30 @@ <Docs> <summary>Loads a sound synchronously.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Media.SoundPlayer.Load%2A> method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Media.SoundPlayer.Load%2A> method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. + > [!CAUTION] -> The <xref:System.Media.SoundPlayer.Load%2A> method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to load a sound asynchronously, which allows the calling thread to continue without interruption. - +> The <xref:System.Media.SoundPlayer.Load%2A> method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to load a sound asynchronously, which allows the calling thread to continue without interruption. + This method raises the <xref:System.Media.SoundPlayer.LoadCompleted> event when loading completes, even if the load was not successful. - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to attach a .wav file to an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to attach a .wav file to an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ServiceProcess.TimeoutException">The elapsed time during loading exceeds the time, in milliseconds, specified by <see cref="P:System.Media.SoundPlayer.LoadTimeout" />.</exception> <exception cref="T:System.IO.FileNotFoundException">The file specified by <see cref="P:System.Media.SoundPlayer.SoundLocation" /> cannot be found.</exception> <altmember cref="M:System.Media.SoundPlayer.LoadAsync" /> <altmember cref="E:System.Media.SoundPlayer.LoadCompleted" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="LoadAsync"> @@ -390,22 +388,22 @@ <Docs> <summary>Loads a .wav file from a stream or a Web resource using a new thread.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <xref:System.ArgumentException>, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <xref:System.Media.SoundPlayer.Load>. - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to asynchronously load a .wav file for use by an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.LoadAsync%2A> method to asynchronously load a .wav file for use by an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet3"::: @@ -416,8 +414,8 @@ This method stores in the task it returns all non-usage exceptions that the meth <exception cref="T:System.IO.FileNotFoundException">The file specified by <see cref="P:System.Media.SoundPlayer.SoundLocation" /> cannot be found.</exception> <altmember cref="M:System.Media.SoundPlayer.Load" /> <altmember cref="E:System.Media.SoundPlayer.LoadCompleted" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-load-a-sound-asynchronously-within-a-windows-form">How to: Load a Sound Asynchronously within a Windows Form</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-load-a-sound-asynchronously-within-a-windows-form">How to: Load a Sound Asynchronously within a Windows Form</related> </Docs> </Member> <Member MemberName="LoadCompleted"> @@ -451,26 +449,26 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Occurs when a .wav file has been successfully or unsuccessfully loaded.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.OnLoadCompleted%2A> event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.OnLoadCompleted%2A> event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.AsyncCompletedEventHandler" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="LoadTimeout"> @@ -510,14 +508,14 @@ This method stores in the task it returns all non-usage exceptions that the meth <summary>Gets or sets the time, in milliseconds, in which the .wav file must load.</summary> <value>The number of milliseconds to wait. The default is 10000 (10 seconds).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - After this time has expired, the loading is canceled and a <xref:System.ServiceProcess.TimeoutException> exception is thrown. - + <format type="text/markdown"><![CDATA[ + +## Remarks + After this time has expired, the loading is canceled and a <xref:System.ServiceProcess.TimeoutException> exception is thrown. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnLoadCompleted"> @@ -554,22 +552,22 @@ This method stores in the task it returns all non-usage exceptions that the meth <param name="e">An <see cref="T:System.ComponentModel.AsyncCompletedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Media.SoundPlayer.LoadCompleted" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Media.SoundPlayer.OnLoadCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Media.SoundPlayer.OnLoadCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Media.SoundPlayer.OnLoadCompleted(System.ComponentModel.AsyncCompletedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Media.SoundPlayer.OnLoadCompleted(System.ComponentModel.AsyncCompletedEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Media.SoundPlayer.LoadCompleted" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSoundLocationChanged"> @@ -606,22 +604,22 @@ This method stores in the task it returns all non-usage exceptions that the meth <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Media.SoundPlayer.SoundLocationChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Media.SoundPlayer.OnSoundLocationChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Media.SoundPlayer.OnSoundLocationChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Media.SoundPlayer.OnSoundLocationChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Media.SoundPlayer.OnSoundLocationChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="P:System.Media.SoundPlayer.SoundLocation" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnStreamChanged"> @@ -658,22 +656,22 @@ This method stores in the task it returns all non-usage exceptions that the meth <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Media.SoundPlayer.StreamChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Media.SoundPlayer.OnStreamChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Media.SoundPlayer.OnStreamChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Media.SoundPlayer.OnStreamChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Media.SoundPlayer.OnStreamChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="P:System.Media.SoundPlayer.Stream" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Play"> @@ -713,22 +711,22 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Plays the .wav file using a new thread, and loads the .wav file first if it has not been loaded.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Media.SoundPlayer.Play%2A> method plays the sound using a new thread. If you call <xref:System.Media.SoundPlayer.Play%2A> before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the <xref:System.Media.SoundPlayer.LoadAsync%2A> or <xref:System.Media.SoundPlayer.Load%2A> method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a <xref:System.IO.Stream> or URL, future calls to playback methods for the <xref:System.Media.SoundPlayer> will not need to reload the .wav file until the path for the sound changes. - - If the .wav file has not been specified or it fails to load, the <xref:System.Media.SoundPlayer.Play%2A> method will play the default beep sound. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.Play%2A> method to asynchronously play a .wav file. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Media.SoundPlayer.Play%2A> method plays the sound using a new thread. If you call <xref:System.Media.SoundPlayer.Play%2A> before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the <xref:System.Media.SoundPlayer.LoadAsync%2A> or <xref:System.Media.SoundPlayer.Load%2A> method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a <xref:System.IO.Stream> or URL, future calls to playback methods for the <xref:System.Media.SoundPlayer> will not need to reload the .wav file until the path for the sound changes. + + If the .wav file has not been specified or it fails to load, the <xref:System.Media.SoundPlayer.Play%2A> method will play the default beep sound. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.Play%2A> method to asynchronously play a .wav file. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet5"::: + ]]></format> </remarks> <exception cref="T:System.ServiceProcess.TimeoutException">The elapsed time during loading exceeds the time, in milliseconds, specified by <see cref="P:System.Media.SoundPlayer.LoadTimeout" />.</exception> @@ -736,7 +734,7 @@ This method stores in the task it returns all non-usage exceptions that the meth <exception cref="T:System.InvalidOperationException">The .wav header is corrupted; the file specified by <see cref="P:System.Media.SoundPlayer.SoundLocation" /> is not a PCM .wav file.</exception> <altmember cref="M:System.Media.SoundPlayer.PlayLooping" /> <altmember cref="M:System.Media.SoundPlayer.PlaySync" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="PlayLooping"> @@ -776,24 +774,24 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Plays and loops the .wav file using a new thread, and loads the .wav file first if it has not been loaded.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.PlayLooping%2A> method to repeatedly play a .wav file. The .wav will be played until the <xref:System.Media.SoundPlayer.Stop%2A> method is called. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.PlayLooping%2A> method to repeatedly play a .wav file. The .wav will be played until the <xref:System.Media.SoundPlayer.Stop%2A> method is called. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet6"::: + ]]></format> </remarks> <exception cref="T:System.ServiceProcess.TimeoutException">The elapsed time during loading exceeds the time, in milliseconds, specified by <see cref="P:System.Media.SoundPlayer.LoadTimeout" />.</exception> @@ -801,7 +799,7 @@ This method stores in the task it returns all non-usage exceptions that the meth <exception cref="T:System.InvalidOperationException">The .wav header is corrupted; the file specified by <see cref="P:System.Media.SoundPlayer.SoundLocation" /> is not a PCM .wav file.</exception> <altmember cref="M:System.Media.SoundPlayer.Play" /> <altmember cref="M:System.Media.SoundPlayer.PlaySync" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="PlaySync"> @@ -841,22 +839,22 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Plays the .wav file and loads the .wav file first if it has not been loaded.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Media.SoundPlayer.PlaySync%2A> method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the <xref:System.Media.SoundPlayer.LoadAsync%2A> or <xref:System.Media.SoundPlayer.Load%2A> method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a <xref:System.IO.Stream> or URL, future calls to playback methods for the <xref:System.Media.SoundPlayer> will not need to reload the .wav file until the path for the sound changes. - - If the .wav file has not been specified or it fails to load, the <xref:System.Media.SoundPlayer.PlaySync%2A> method will play the default beep sound. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.PlaySync%2A> method to synchronously play a .wav file. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Media.SoundPlayer.PlaySync%2A> method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the <xref:System.Media.SoundPlayer.LoadAsync%2A> or <xref:System.Media.SoundPlayer.Load%2A> method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a <xref:System.IO.Stream> or URL, future calls to playback methods for the <xref:System.Media.SoundPlayer> will not need to reload the .wav file until the path for the sound changes. + + If the .wav file has not been specified or it fails to load, the <xref:System.Media.SoundPlayer.PlaySync%2A> method will play the default beep sound. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.PlaySync%2A> method to synchronously play a .wav file. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/CPP/system.windows.forms.sound.playasync.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/PlaySync/system.windows.forms.sound.playasync.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/VB/system.windows.forms.sound.playasync.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/VB/system.windows.forms.sound.playasync.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ServiceProcess.TimeoutException">The elapsed time during loading exceeds the time, in milliseconds, specified by <see cref="P:System.Media.SoundPlayer.LoadTimeout" />.</exception> @@ -864,7 +862,7 @@ This method stores in the task it returns all non-usage exceptions that the meth <exception cref="T:System.InvalidOperationException">The .wav header is corrupted; the file specified by <see cref="P:System.Media.SoundPlayer.SoundLocation" /> is not a PCM .wav file.</exception> <altmember cref="M:System.Media.SoundPlayer.Play" /> <altmember cref="M:System.Media.SoundPlayer.PlayLooping" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="SoundLocation"> @@ -904,23 +902,23 @@ This method stores in the task it returns all non-usage exceptions that the meth <summary>Gets or sets the file path or URL of the .wav file to load.</summary> <value>The file path or URL from which to load a .wav file, or <see cref="F:System.String.Empty" /> if no file path is present. The default is <see cref="F:System.String.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is set to <xref:System.String.Empty?displayProperty=nameWithType> when the <xref:System.Media.SoundPlayer.Stream%2A> property is set to a <xref:System.IO.Stream>. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.SoundLocation%2A> property to assign the .wav file source to an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is set to <xref:System.String.Empty?displayProperty=nameWithType> when the <xref:System.Media.SoundPlayer.Stream%2A> property is set to a <xref:System.IO.Stream>. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.SoundLocation%2A> property to assign the .wav file source to an instance of the <xref:System.Media.SoundPlayer> class. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="SoundLocationChanged"> @@ -954,25 +952,25 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Occurs when a new audio source path for this <see cref="T:System.Media.SoundPlayer" /> has been set.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.OnSoundLocationChanged%2A> event handler to receive a notification when the <xref:System.Media.SoundPlayer> has been attached to a different .wav file. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.OnSoundLocationChanged%2A> event handler to receive a notification when the <xref:System.Media.SoundPlayer> has been attached to a different .wav file. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet9"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Stop"> @@ -1006,18 +1004,18 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Stops playback of the sound if playback is occurring.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.Stop%2A> method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SoundPlayer.Stop%2A> method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the <xref:System.Media.SoundPlayer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet7"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="Stream"> @@ -1052,15 +1050,15 @@ This method stores in the task it returns all non-usage exceptions that the meth <summary>Gets or sets the <see cref="T:System.IO.Stream" /> from which to load the .wav file.</summary> <value>A <see cref="T:System.IO.Stream" /> from which to load the .wav file, or <see langword="null" /> if no stream is available. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is set to `null` when the <xref:System.Media.SoundPlayer.SoundLocation%2A> property is set to a new and valid sound location. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is set to `null` when the <xref:System.Media.SoundPlayer.SoundLocation%2A> property is set to a new and valid sound location. + ]]></format> </remarks> <altmember cref="T:System.IO.Stream" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="StreamChanged"> @@ -1094,16 +1092,16 @@ This method stores in the task it returns all non-usage exceptions that the meth <Docs> <summary>Occurs when a new <see cref="T:System.IO.Stream" /> audio source for this <see cref="T:System.Media.SoundPlayer" /> has been set.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class-overview">SoundPlayer Class Overview (Windows Forms)</related> </Docs> </Member> <Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData"> @@ -1146,11 +1144,11 @@ This method stores in the task it returns all non-usage exceptions that the meth <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext" />) for this serialization.</param> <summary>For a description of this member, see the <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> method.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Media.SoundPlayer> instance is cast to an <xref:System.Runtime.Serialization.ISerializable> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Media.SoundPlayer> instance is cast to an <xref:System.Runtime.Serialization.ISerializable> interface. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Media/SystemSound.xml b/xml/System.Media/SystemSound.xml index 9d808bbae01..cc123412e32 100644 --- a/xml/System.Media/SystemSound.xml +++ b/xml/System.Media/SystemSound.xml @@ -28,20 +28,20 @@ <Docs> <summary>Represents a system sound type.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSounds" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> <Members> <Member MemberName="Play"> @@ -75,25 +75,25 @@ <Docs> <summary>Plays the system sound type.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Media.SystemSound.Play%2A> method plays the sound asynchronously. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Media.SystemSound.Play%2A> method plays the sound asynchronously. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSounds" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/System.Media/SystemSounds.xml b/xml/System.Media/SystemSounds.xml index 55ce7c95352..147a827a423 100644 --- a/xml/System.Media/SystemSounds.xml +++ b/xml/System.Media/SystemSounds.xml @@ -38,18 +38,18 @@ <Docs> <summary>Retrieves sounds associated with a set of Windows operating system sound-event types. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Media.SystemSounds> class provides methods for retrieving the sounds associated with a set of operating system sound-event types for the current user. The sounds associated with each type of operating system sound event can be configured in Windows Control Panel. - - <xref:System.Media.SystemSounds> provides static methods to access the sounds associated with the <xref:System.Media.SystemSounds.Asterisk%2A>, <xref:System.Media.SystemSounds.Beep%2A>, <xref:System.Media.SystemSounds.Exclamation%2A>, <xref:System.Media.SystemSounds.Hand%2A> and <xref:System.Media.SystemSounds.Question%2A> sound events. Each property returns a <xref:System.Media.SystemSound> that can be used to play the sound. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Media.SystemSounds> class provides methods for retrieving the sounds associated with a set of operating system sound-event types for the current user. The sounds associated with each type of operating system sound event can be configured in Windows Control Panel. + + <xref:System.Media.SystemSounds> provides static methods to access the sounds associated with the <xref:System.Media.SystemSounds.Asterisk%2A>, <xref:System.Media.SystemSounds.Beep%2A>, <xref:System.Media.SystemSounds.Exclamation%2A>, <xref:System.Media.SystemSounds.Hand%2A> and <xref:System.Media.SystemSounds.Question%2A> sound events. Each property returns a <xref:System.Media.SystemSound> that can be used to play the sound. + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> <Members> <Member MemberName="Asterisk"> @@ -83,20 +83,20 @@ <summary>Gets the sound associated with the <see langword="Asterisk" /> program event in the current Windows sound scheme.</summary> <value>A <see cref="T:System.Media.SystemSound" /> associated with the <see langword="Asterisk" /> program event in the current Windows sound scheme.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Asterisk%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> <Member MemberName="Beep"> @@ -133,20 +133,20 @@ <format type="text/markdown"><![CDATA[ On Windows Server 2022, the Microsoft\Windows\Multimedia\SystemSoundsService task in Task Scheduler is disabled. Both this task and the Windows Audio service need to be enabled for `SystemSounds.Beep.Play()` to function correctly. - + ## Examples - -The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Beep> property. - + +The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Beep> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> <Member MemberName="Exclamation"> @@ -180,20 +180,20 @@ The following code example demonstrates the use of the <xref:System.Media.System <summary>Gets the sound associated with the <see langword="Exclamation" /> program event in the current Windows sound scheme.</summary> <value>A <see cref="T:System.Media.SystemSound" /> associated with the <see langword="Exclamation" /> program event in the current Windows sound scheme.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Exclamation%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Exclamation%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> <Member MemberName="Hand"> @@ -227,20 +227,20 @@ The following code example demonstrates the use of the <xref:System.Media.System <summary>Gets the sound associated with the <see langword="Hand" /> program event in the current Windows sound scheme.</summary> <value>A <see cref="T:System.Media.SystemSound" /> associated with the <see langword="Hand" /> program event in the current Windows sound scheme.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Hand%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Hand%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> <Member MemberName="Question"> @@ -274,20 +274,20 @@ The following code example demonstrates the use of the <xref:System.Media.System <summary>Gets the sound associated with the <see langword="Question" /> program event in the current Windows sound scheme.</summary> <value>A <see cref="T:System.Media.SystemSound" /> associated with the <see langword="Question" /> program event in the current Windows sound scheme.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Question%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of the <xref:System.Media.SystemSounds.Question%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:System.Media.SystemSound" /> <altmember cref="T:System.Media.SoundPlayer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/soundplayer-class">SoundPlayer Class (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Data/RelativeSource.xml b/xml/System.Windows.Data/RelativeSource.xml index 2f1ab2ec0ac..12569221c39 100644 --- a/xml/System.Windows.Data/RelativeSource.xml +++ b/xml/System.Windows.Data/RelativeSource.xml @@ -33,27 +33,27 @@ <Docs> <summary>Implements a markup extension that describes the location of the binding source relative to the position of the binding target.</summary> <remarks> - <format type="text/markdown"><. - -## Examples - The following example shows a style trigger that creates a <xref:System.Windows.Controls.ToolTip> that reports a validation error message. Using the <xref:System.Windows.Data.Binding.RelativeSource%2A> property, the value of the setter binds to the error content of the current <xref:System.Windows.Controls.TextBox> (the <xref:System.Windows.Controls.TextBox> using the style). For more information on this example, see [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: - - The following example shows the <xref:System.Windows.Style> definition of a custom control called `NumericUpDown`. The <xref:System.Windows.Controls.TextBlock.Text%2A> property of the <xref:System.Windows.Controls.TextBlock> is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this <xref:System.Windows.Style> is applied to in this case. - + <format type="text/markdown"><. + +## Examples + The following example shows a style trigger that creates a <xref:System.Windows.Controls.ToolTip> that reports a validation error message. Using the <xref:System.Windows.Data.Binding.RelativeSource%2A> property, the value of the setter binds to the error content of the current <xref:System.Windows.Controls.TextBox> (the <xref:System.Windows.Controls.TextBox> using the style). For more information on this example, see [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: + + The following example shows the <xref:System.Windows.Style> definition of a custom control called `NumericUpDown`. The <xref:System.Windows.Controls.TextBlock.Text%2A> property of the <xref:System.Windows.Controls.TextBlock> is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this <xref:System.Windows.Style> is applied to in this case. + :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/DefaultStyleKey/themes/generic.xaml" id="Snippetrelativesource"::: - - The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. - + + The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Data.RelativeSource" /> @@ -150,18 +150,18 @@ <param name="ancestorLevel">The ordinal position of the desired ancestor among all ancestors of the given type.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Data.RelativeSource" /> class with an initial mode and additional tree-walking qualifiers for finding the desired relative source.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - + <format type="text/markdown"><![CDATA[ + ## Remarks `ancestorType` and `ancestorLevel` have no relevance if given as parameters for a `mode` other than <xref:System.Windows.Data.RelativeSourceMode.FindAncestor>. Do not use this signature for the other <xref:System.Windows.Data.RelativeSourceMode> values. - -## Examples - The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]></format> </remarks> </Docs> @@ -198,23 +198,23 @@ <summary>Gets or sets the level of ancestor to look for, in <see cref="F:System.Windows.Data.RelativeSourceMode.FindAncestor" /> mode. Use 1 to indicate the one nearest to the binding target element.</summary> <value>The ancestor level. Use 1 to indicate the one nearest to the binding target element.</value> <remarks> - <format type="text/markdown"><. - -## Examples - The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Data.RelativeSourceMode" /> @@ -253,23 +253,23 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Gets or sets the type of ancestor to look for.</summary> <value>The type of ancestor. The default value is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><. - -## Examples - The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second <xref:System.Windows.Controls.ItemsControl> encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Windows.Data.RelativeSource" /> is not in the <see cref="F:System.Windows.Data.RelativeSourceMode.FindAncestor" /> mode.</exception> @@ -315,15 +315,15 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Gets or sets a <see cref="T:System.Windows.Data.RelativeSourceMode" /> value that describes the location of the binding source relative to the position of the binding target.</summary> <value>One of the <see cref="T:System.Windows.Data.RelativeSourceMode" /> values. The default value is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">This property is immutable after initialization. Instead of changing the <see cref="P:System.Windows.Data.RelativeSource.Mode" /> on this instance, create a new <see cref="T:System.Windows.Data.RelativeSource" /> or use a different static instance.</exception> @@ -357,15 +357,15 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Gets a static value that is used to return a <see cref="T:System.Windows.Data.RelativeSource" /> constructed for the <see cref="F:System.Windows.Data.RelativeSourceMode.PreviousData" /> mode.</summary> <value>A static <see cref="T:System.Windows.Data.RelativeSource" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Data.RelativeSourceMode" /> @@ -402,11 +402,11 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Returns an object that should be set as the value on the target object's property for this markup extension. For <see cref="T:System.Windows.Data.RelativeSource" />, this is another <see cref="T:System.Windows.Data.RelativeSource" />, using the appropriate source for the specified mode.</summary> <returns>Another <see cref="T:System.Windows.Data.RelativeSource" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Data.RelativeSource> is simultaneously a markup extension implementation and a data object. When the extension returns itself, the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form so that the <xref:System.Windows.Data.RelativeSourceMode.FindAncestor> mode can be defined inline, with the two extra arguments for ancestor type and level that the other modes do not require. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Data.RelativeSource> is simultaneously a markup extension implementation and a data object. When the extension returns itself, the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form so that the <xref:System.Windows.Data.RelativeSourceMode.FindAncestor> mode can be defined inline, with the two extra arguments for ancestor type and level that the other modes do not require. + ]]></format> </remarks> </Docs> @@ -437,20 +437,20 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Gets a static value that is used to return a <see cref="T:System.Windows.Data.RelativeSource" /> constructed for the <see cref="F:System.Windows.Data.RelativeSourceMode.Self" /> mode.</summary> <value>A static <see cref="T:System.Windows.Data.RelativeSource" />.</value> <remarks> - <format type="text/markdown"><. - -## Examples - The following example shows a style trigger that creates a <xref:System.Windows.Controls.ToolTip> that reports a validation error message. The value of the setter binds to the error content of the current <xref:System.Windows.Controls.TextBox> (the <xref:System.Windows.Controls.TextBox> using the style) using the <xref:System.Windows.Data.Binding.RelativeSource%2A> property. See [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation) for more information on this example. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: - + +## Examples + The following example shows a style trigger that creates a <xref:System.Windows.Controls.ToolTip> that reports a validation error message. The value of the setter binds to the error content of the current <xref:System.Windows.Controls.TextBox> (the <xref:System.Windows.Controls.TextBox> using the style) using the <xref:System.Windows.Data.Binding.RelativeSource%2A> property. See [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation) for more information on this example. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Data.RelativeSourceMode" /> @@ -491,11 +491,11 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This `ShouldSerialize` method is provided because the <xref:System.Windows.Data.RelativeSource.AncestorLevel%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the <xref:System.Windows.Data.RelativeSource> or developing your own control incorporating the <xref:System.Windows.Data.RelativeSource>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This `ShouldSerialize` method is provided because the <xref:System.Windows.Data.RelativeSource.AncestorLevel%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the <xref:System.Windows.Data.RelativeSource> or developing your own control incorporating the <xref:System.Windows.Data.RelativeSource>. + ]]></format> </remarks> </Docs> @@ -534,13 +534,13 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> @@ -633,20 +633,20 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf <summary>Gets a static value that is used to return a <see cref="T:System.Windows.Data.RelativeSource" /> constructed for the <see cref="F:System.Windows.Data.RelativeSourceMode.TemplatedParent" /> mode.</summary> <value>A static <see cref="T:System.Windows.Data.RelativeSource" />.</value> <remarks> - <format type="text/markdown"><. - -## Examples - The following example shows the <xref:System.Windows.Style> definition of a custom control called `NumericUpDown`. The <xref:System.Windows.Controls.TextBlock.Text%2A> property of the <xref:System.Windows.Controls.TextBlock> is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this <xref:System.Windows.Style> is applied to in this case. - + +## Examples + The following example shows the <xref:System.Windows.Style> definition of a custom control called `NumericUpDown`. The <xref:System.Windows.Controls.TextBlock.Text%2A> property of the <xref:System.Windows.Controls.TextBlock> is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this <xref:System.Windows.Style> is applied to in this case. + :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/DefaultStyleKey/themes/generic.xaml" id="Snippetrelativesource"::: - + ]]></format> </remarks> <altmember cref="T:System.Windows.Data.RelativeSourceMode" /> diff --git a/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml b/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml index 765b5c24e70..d4ce4adeb5f 100644 --- a/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml +++ b/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml @@ -42,37 +42,37 @@ <Docs> <summary>Represents the horizontal and vertical line segments that are dynamically created in the user interface (UI) to assist in the design-time layout of controls in a container. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Design.Behavior.SnapLineType" /> @@ -89,11 +89,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You should only explicitly create snaplines to replace or supplement the default snapline behavior offered by the visual designer. To create a snapline, you should instance a snapline and then add it to the <xref:System.Windows.Forms.Design.ControlDesigner.SnapLines%2A> property of the <xref:System.Windows.Forms.Design.ControlDesigner> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You should only explicitly create snaplines to replace or supplement the default snapline behavior offered by the visual designer. To create a snapline, you should instance a snapline and then add it to the <xref:System.Windows.Forms.Design.ControlDesigner.SnapLines%2A> property of the <xref:System.Windows.Forms.Design.ControlDesigner> class. + ]]></format> </remarks> </Docs> @@ -136,11 +136,11 @@ <param name="offset">The position of the snapline, in pixels, relative to the upper-left origin of the owning control.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" /> class using the specified snapline type and offset.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property to `null` and the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property to <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority.Low>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property to `null` and the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property to <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority.Low>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -188,11 +188,11 @@ <param name="filter">A <see cref="T:System.String" /> used to specify a programmer-defined category of snaplines.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" /> class using the specified snapline type, offset, and filter name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property to <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority.Low>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property to <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority.Low>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -240,11 +240,11 @@ <param name="priority">The <see cref="T:System.Windows.Forms.Design.Behavior.SnapLinePriority" /> of the snapline.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" /> class using the specified snapline type, offset, and priority.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property to `null`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property to `null`. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -295,11 +295,11 @@ <param name="priority">The <see cref="T:System.Windows.Forms.Design.Behavior.SnapLinePriority" /> of the snapline.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" /> class using the specified snapline type, offset, filter name, and priority.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets all of the properties of a snapline to programmer-supplied values. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets all of the properties of a snapline to programmer-supplied values. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -341,11 +341,11 @@ <param name="adjustment">The number of pixels to change the snapline offset by.</param> <summary>Adjusts the <see cref="P:System.Windows.Forms.Design.Behavior.SnapLine.Offset" /> property of the snapline.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The offset of a snapline is the distance, in pixels, that the snapline is located from the associated control's upper-left origin. Although the offset can be set to any integer value, typically the snaplines retain the spatial relationships implied by their <xref:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType%2A> property value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The offset of a snapline is the distance, in pixels, that the snapline is located from the associated control's upper-left origin. Although the offset can be set to any integer value, typically the snaplines retain the spatial relationships implied by their <xref:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType%2A> property value. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.Offset" /> @@ -393,13 +393,13 @@ <summary>Gets the programmer-defined filter category associated with this snapline.</summary> <value>A <see cref="T:System.String" /> that defines the filter category. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property is used to define custom categories of snaplines. Only snaplines with the same filter name are able to snap to each other. This property can be used in custom control designers to expose different categories of snaplines depending upon the state of the control or the type of operation being performed. For example, round controls could offer a custom snapline with the filter value of "Center". - - This property is initialized during construction and cannot be changed thereafter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Filter%2A> property is used to define custom categories of snaplines. Only snaplines with the same filter name are able to snap to each other. This property can be used in custom control designers to expose different categories of snaplines depending upon the state of the control or the type of operation being performed. For example, round controls could offer a custom snapline with the filter value of "Center". + + This property is initialized during construction and cannot be changed thereafter. + ]]></format> </remarks> <altmember cref="Overload:System.Windows.Forms.Design.Behavior.SnapLine.#ctor" /> @@ -437,11 +437,11 @@ <value> <see langword="true" /> if the snapline is horizontal; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The following snapline types are horizontal: <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Top>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Bottom>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal>, and <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Baseline>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The following snapline types are horizontal: <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Top>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Bottom>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal>, and <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Baseline>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -478,11 +478,11 @@ <value> <see langword="true" /> if the snapline is vertical; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The following snapline types are vertical: <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Left>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Right>, and <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Vertical>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The following snapline types are vertical: <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Left>, <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Right>, and <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Vertical>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> @@ -524,13 +524,13 @@ <summary>Gets the number of pixels that the snapline is offset from the origin of the associated control.</summary> <value>The offset, in pixels, of the snapline.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The origin of a control is the upper-left point of the control. A single offset can describe the position of a snapline, because vertical snaplines may have only a nonzero x-axis offset, whereas horizontal snaplines may only have a nonzero y-axis offset. - - The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Offset%2A> property is initialized at construction time, but it can be changed thereafter with the <xref:System.Windows.Forms.Design.Behavior.SnapLine.AdjustOffset%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The origin of a control is the upper-left point of the control. A single offset can describe the position of a snapline, because vertical snaplines may have only a nonzero x-axis offset, whereas horizontal snaplines may only have a nonzero y-axis offset. + + The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Offset%2A> property is initialized at construction time, but it can be changed thereafter with the <xref:System.Windows.Forms.Design.Behavior.SnapLine.AdjustOffset%2A> method. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Design.Behavior.SnapLine.AdjustOffset(System.Int32)" /> @@ -572,15 +572,15 @@ <summary>Gets a value indicating the relative importance of the snapline.</summary> <value>A <see cref="T:System.Windows.Forms.Design.Behavior.SnapLinePriority" /> that represents the priority category of a snapline.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property establishes categories of importance for the snaplines associated with a control. - - The Windows Forms Designer uses this property to determine which snaplines to display during a control addition, resize, or move operation. For more information, see the <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority> enumeration. - - This property is initialized during construction and cannot be changed thereafter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.Design.Behavior.SnapLine.Priority%2A> property establishes categories of importance for the snaplines associated with a control. + + The Windows Forms Designer uses this property to determine which snaplines to display during a control addition, resize, or move operation. For more information, see the <xref:System.Windows.Forms.Design.Behavior.SnapLinePriority> enumeration. + + This property is initialized during construction and cannot be changed thereafter. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Design.Behavior.SnapLinePriority" /> @@ -663,13 +663,13 @@ <summary>Gets the type of a snapline, which indicates the general location and orientation.</summary> <value>A <see cref="T:System.Windows.Forms.Design.Behavior.SnapLineType" /> that represents the orientation and general location, relative to control edges, of a snapline.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Visual designers use the <xref:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType%2A> property to direct snap alignment operations. Typically only snaplines that are similarly oriented can snap to each other. For example, two snaplines of type <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal> can snap together, but a <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal> and a <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Vertical> snapline cannot. - - This property is initialized during construction and cannot be changed thereafter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Visual designers use the <xref:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType%2A> property to direct snap alignment operations. Typically only snaplines that are similarly oriented can snap to each other. For example, two snaplines of type <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal> can snap together, but a <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Horizontal> and a <xref:System.Windows.Forms.Design.Behavior.SnapLineType.Vertical> snapline cannot. + + This property is initialized during construction and cannot be changed thereafter. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Design.Behavior.SnapLineType" /> @@ -708,11 +708,11 @@ <summary>Returns a string representation of the current snapline.</summary> <returns>A <see cref="T:System.String" /> that represents the current <see cref="T:System.Windows.Forms.Design.Behavior.SnapLine" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method returns a string that contains details about the type, offset, priority, and filter values of the snapline. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method returns a string that contains details about the type, offset, priority, and filter values of the snapline. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Design.Behavior.SnapLine.SnapLineType" /> diff --git a/xml/System.Windows.Forms.Integration/ElementHost.xml b/xml/System.Windows.Forms.Integration/ElementHost.xml index f952d926503..ae621e2dae7 100644 --- a/xml/System.Windows.Forms.Integration/ElementHost.xml +++ b/xml/System.Windows.Forms.Integration/ElementHost.xml @@ -134,7 +134,7 @@ <see langword="true" /> if the control adjusts its size to closely fit its contents; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.Integration.WindowsFormsHost" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-property-overview">AutoSize Property Overview</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-property-overview">AutoSize Property Overview</related> </Docs> </Member> <Member MemberName="BackColorTransparent"> diff --git a/xml/System.Windows.Forms/Application.xml b/xml/System.Windows.Forms/Application.xml index e5dca371ae4..6403037a089 100644 --- a/xml/System.Windows.Forms/Application.xml +++ b/xml/System.Windows.Forms/Application.xml @@ -241,7 +241,7 @@ <Docs> <summary>Gets the default color mode (dark mode) for the application.</summary> <value>To be added.</value> - <remarks>This is the <see cref="P:System.Windows.Forms.Application.SystemColorMode" />; which either has been set by <see cref="M:System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode)" /> or its default value <see cref="F:System.Windows.Forms.SystemColorMode.Classic" />. + <remarks>This is the <see cref="P:System.Windows.Forms.Application.SystemColorMode" />; which either has been set by <see cref="M:System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode)" /> or its default value <see cref="F:System.Windows.Forms.SystemColorMode.Classic" />. If it has been set to <see cref="F:System.Windows.Forms.SystemColorMode.System" />, then the actual color mode is determined by the system settings (which can be retrieved by the static (shared in VB) <see cref="P:System.Windows.Forms.Application.SystemColorMode" /> property.</remarks> </Docs> </Member> @@ -491,7 +491,7 @@ ## Remarks When you run a Windows Form, it creates the new form, which then waits for events to handle. Each time the form handles an event, it processes all the code associated with that event. All other events wait in the queue. While your code handles the event, your application does not respond. For example, the window does not repaint if another window is dragged on top. - If you call <xref:System.Windows.Forms.Application.DoEvents%2A> in your code, your application can handle the other events. For example, if you have a form that adds data to a <xref:System.Windows.Forms.ListBox> and add <xref:System.Windows.Forms.Application.DoEvents%2A> to your code, your form repaints when another window is dragged over it. If you remove <xref:System.Windows.Forms.Application.DoEvents%2A> from your code, your form will not repaint until the click event handler of the button is finished executing. For more information on messaging, see [User Input in Windows Forms](/dotnet/framework/winforms/user-input-in-windows-forms). + If you call <xref:System.Windows.Forms.Application.DoEvents%2A> in your code, your application can handle the other events. For example, if you have a form that adds data to a <xref:System.Windows.Forms.ListBox> and add <xref:System.Windows.Forms.Application.DoEvents%2A> to your code, your form repaints when another window is dragged over it. If you remove <xref:System.Windows.Forms.Application.DoEvents%2A> from your code, your form will not repaint until the click event handler of the button is finished executing. For more information on messaging, see [User Input in Windows Forms](/dotnet/desktop/winforms/user-input-in-windows-forms). Unlike Visual Basic 6.0, the <xref:System.Windows.Forms.Application.DoEvents%2A> method does not call the <xref:System.Threading.Thread.Sleep%2A?displayProperty=nameWithType> method. @@ -1797,12 +1797,12 @@ <summary>Sets the default color mode (dark mode) for the application.</summary> <remarks> <para> - You should use this method to set the default color mode (dark mode) for the application. Set it before creating any UI elements to ensure that the correct color mode - is used. You can set it to dark mode (<see cref="F:System.Windows.Forms.SystemColorMode.Dark" />), light mode (<see cref="F:System.Windows.Forms.SystemColorMode.Classic" />) + You should use this method to set the default color mode (dark mode) for the application. Set it before creating any UI elements to ensure that the correct color mode + is used. You can set it to dark mode (<see cref="F:System.Windows.Forms.SystemColorMode.Dark" />), light mode (<see cref="F:System.Windows.Forms.SystemColorMode.Classic" />) or to the system setting (<see cref="F:System.Windows.Forms.SystemColorMode.System" />). </para> <para> - If you set it to <see cref="F:System.Windows.Forms.SystemColorMode.System" />, the actual color mode is determined by the Windows system settings. If the system setting is changed, + If you set it to <see cref="F:System.Windows.Forms.SystemColorMode.System" />, the actual color mode is determined by the Windows system settings. If the system setting is changed, the application will not automatically adapt to the new setting. </para> <para> diff --git a/xml/System.Windows.Forms/AutoSizeMode.xml b/xml/System.Windows.Forms/AutoSizeMode.xml index c5b76db3d8b..195fd6c77f3 100644 --- a/xml/System.Windows.Forms/AutoSizeMode.xml +++ b/xml/System.Windows.Forms/AutoSizeMode.xml @@ -22,25 +22,25 @@ <Docs> <summary>Specifies how a control will behave when its <see cref="P:System.Windows.Forms.Control.AutoSize" /> property is enabled.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the GrowAndShrink value produces the same behavior that you get for controls with the <xref:System.Windows.Forms.Control.AutoSize%2A> property enabled but which have no - - `AutoSizeMode` property. The <xref:System.Windows.Forms.Control.MinimumSize%2A> and <xref:System.Windows.Forms.Control.MaximumSize%2A> properties are respected, but the current value of the <xref:System.Windows.Forms.Control.Size%2A> property is ignored. - - - -## Examples - The following code example shows a form created using code that automatically resizes to fit its contents. When ran, the form will display a <xref:System.Windows.Forms.Label>, a <xref:System.Windows.Forms.TextBox> for entering a URL, and a <xref:System.Windows.Forms.Button> for displaying that URL inside of the user's default Web browser. The code example uses a <xref:System.Windows.Forms.FlowLayoutPanel> to lay out the contained controls one after the other, and sets the <xref:System.Windows.Forms.Control.AutoSize%2A> and <xref:System.Windows.Forms.AutoSizeMode> to grow and shrink to fit the contents of its form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the GrowAndShrink value produces the same behavior that you get for controls with the <xref:System.Windows.Forms.Control.AutoSize%2A> property enabled but which have no + + `AutoSizeMode` property. The <xref:System.Windows.Forms.Control.MinimumSize%2A> and <xref:System.Windows.Forms.Control.MaximumSize%2A> properties are respected, but the current value of the <xref:System.Windows.Forms.Control.Size%2A> property is ignored. + + + +## Examples + The following code example shows a form created using code that automatically resizes to fit its contents. When ran, the form will display a <xref:System.Windows.Forms.Label>, a <xref:System.Windows.Forms.TextBox> for entering a URL, and a <xref:System.Windows.Forms.Button> for displaying that URL inside of the user's default Web browser. The code example uses a <xref:System.Windows.Forms.FlowLayoutPanel> to lay out the contained controls one after the other, and sets the <xref:System.Windows.Forms.Control.AutoSize%2A> and <xref:System.Windows.Forms.AutoSizeMode> to grow and shrink to fit the contents of its form. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoSizeMode/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Form.AutoSize/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Form.AutoSize/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.AutoSize" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-property-overview">AutoSize Property Overview</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-property-overview">AutoSize Property Overview</related> </Docs> <Members> <Member MemberName="GrowAndShrink"> diff --git a/xml/System.Windows.Forms/AutoValidate.xml b/xml/System.Windows.Forms/AutoValidate.xml index 4a1247198d4..e5b92ed4123 100644 --- a/xml/System.Windows.Forms/AutoValidate.xml +++ b/xml/System.Windows.Forms/AutoValidate.xml @@ -22,21 +22,21 @@ <Docs> <summary>Determines how a control validates its data when it loses user input focus.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + <format type="text/markdown"><. + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ContainerControl.ValidateChildren" /> diff --git a/xml/System.Windows.Forms/BindingNavigator.xml b/xml/System.Windows.Forms/BindingNavigator.xml index 69ea74e245b..053f29e3962 100644 --- a/xml/System.Windows.Forms/BindingNavigator.xml +++ b/xml/System.Windows.Forms/BindingNavigator.xml @@ -94,7 +94,7 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.BindingSource" /> - <related type="Article" href="/dotnet/framework/winforms/controls/bindingnavigator-control-windows-forms">BindingNavigator Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/bindingnavigator-control-windows-forms">BindingNavigator Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -459,7 +459,7 @@ ## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.BindingNavigator> control to move through a data set. The set is contained in a <xref:System.Data.DataView>, which is bound to a <xref:System.Windows.Forms.TextBox> control with a <xref:System.Windows.Forms.BindingSource> component. This code example is part of a larger example provided in [How to: Move Through a DataSet with the Windows Forms BindingNavigator Control](/dotnet/framework/winforms/controls/move-through-a-dataset-with-wf-bindingnavigator-control). + The following code example demonstrates how to use a <xref:System.Windows.Forms.BindingNavigator> control to move through a data set. The set is contained in a <xref:System.Data.DataView>, which is bound to a <xref:System.Windows.Forms.TextBox> control with a <xref:System.Windows.Forms.BindingSource> component. This code example is part of a larger example provided in [How to: Move Through a DataSet with the Windows Forms BindingNavigator Control](/dotnet/desktop/winforms/controls/move-through-a-dataset-with-wf-bindingnavigator-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingNavigator/Overview/form1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataNavigator/VB/form1.vb" id="Snippet1"::: diff --git a/xml/System.Windows.Forms/BindingSource.xml b/xml/System.Windows.Forms/BindingSource.xml index 0813575867e..5dc2dd08414 100644 --- a/xml/System.Windows.Forms/BindingSource.xml +++ b/xml/System.Windows.Forms/BindingSource.xml @@ -90,7 +90,7 @@ <format type="text/markdown">< and [How to: Handle Errors and Exceptions that Occur with Databinding](/dotnet/framework/winforms/controls/how-to-handle-errors-and-exceptions-that-occur-with-databinding). Navigation and updating of the data source is accomplished through methods such as <xref:System.Windows.Forms.BindingSource.MoveNext%2A>, <xref:System.Windows.Forms.BindingSource.MoveLast%2A>, and <xref:System.Windows.Forms.BindingSource.Remove%2A>. Operations such as sorting and filtering are handled through the <xref:System.Windows.Forms.BindingSource.Sort%2A> and <xref:System.Windows.Forms.BindingSource.Filter%2A> properties. For more information on using sorting and filtering with the <xref:System.Windows.Forms.BindingSource>, see [How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component](/dotnet/framework/winforms/controls/sort-and-filter-ado-net-data-with-wf-bindingsource-component). + The <xref:System.Windows.Forms.BindingSource> component serves many purposes. First, it simplifies binding controls on a form to data by providing currency management, change notification, and other services between Windows Forms controls and data sources. This is accomplished by attaching the <xref:System.Windows.Forms.BindingSource> component to your data source using the <xref:System.Windows.Forms.BindingSource.DataSource%2A> property. For complex binding scenarios you can optionally set the <xref:System.Windows.Forms.BindingSource.DataMember%2A> property to a specific column or list in the data source. You then bind controls to the <xref:System.Windows.Forms.BindingSource>. All further interaction with the data is accomplished with calls to the <xref:System.Windows.Forms.BindingSource> component. For examples on how the <xref:System.Windows.Forms.BindingSource> can simplify the binding process, see [How to: Bind Windows Forms Controls to DBNull Database Values](/dotnet/desktop/winforms/controls/how-to-bind-windows-forms-controls-to-dbnull-database-values) and [How to: Handle Errors and Exceptions that Occur with Databinding](/dotnet/desktop/winforms/controls/how-to-handle-errors-and-exceptions-that-occur-with-databinding). Navigation and updating of the data source is accomplished through methods such as <xref:System.Windows.Forms.BindingSource.MoveNext%2A>, <xref:System.Windows.Forms.BindingSource.MoveLast%2A>, and <xref:System.Windows.Forms.BindingSource.Remove%2A>. Operations such as sorting and filtering are handled through the <xref:System.Windows.Forms.BindingSource.Sort%2A> and <xref:System.Windows.Forms.BindingSource.Filter%2A> properties. For more information on using sorting and filtering with the <xref:System.Windows.Forms.BindingSource>, see [How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component](/dotnet/desktop/winforms/controls/sort-and-filter-ado-net-data-with-wf-bindingsource-component). In addition, the <xref:System.Windows.Forms.BindingSource> component can act as a strongly typed data source. Typically the type of the underlying data source is fixed through one of the following mechanisms: @@ -98,7 +98,7 @@ - Set the <xref:System.Windows.Forms.BindingSource.DataSource%2A> property to a list, single object, or type. - Both of these mechanisms create a strongly-typed list. For more information on how to use the <xref:System.Windows.Forms.BindingSource> to bind to a type, see [How to: Bind a Windows Forms Control to a Type](/dotnet/framework/winforms/controls/how-to-bind-a-windows-forms-control-to-a-type). You can also use the <xref:System.Windows.Forms.BindingSource> to bind your controls to a factory object. For more information on how to do this, see [How to: Bind a Windows Forms Control to a Factory Object](/dotnet/framework/winforms/controls/how-to-bind-a-windows-forms-control-to-a-factory-object). + Both of these mechanisms create a strongly-typed list. For more information on how to use the <xref:System.Windows.Forms.BindingSource> to bind to a type, see [How to: Bind a Windows Forms Control to a Type](/dotnet/desktop/winforms/controls/how-to-bind-a-windows-forms-control-to-a-type). You can also use the <xref:System.Windows.Forms.BindingSource> to bind your controls to a factory object. For more information on how to do this, see [How to: Bind a Windows Forms Control to a Factory Object](/dotnet/desktop/winforms/controls/how-to-bind-a-windows-forms-control-to-a-factory-object). > [!NOTE] > Because a <xref:System.Windows.Forms.BindingSource> handles both simple and complex data sources, terminology is problematic. Within this class documentation, the term *list* refers to a data collection within the hosted data source, and *item* denotes a single element. When discussing functionality associated with complex data sources, the equivalent terms *table* and *row* are used. @@ -129,7 +129,7 @@ <altmember cref="T:System.Collections.IList" /> <altmember cref="T:System.ComponentModel.IBindingList" /> <altmember cref="T:System.ComponentModel.IEditableObject" /> - <related type="Article" href="/dotnet/framework/winforms/controls/bindingsource-component">BindingSource Component</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/bindingsource-component">BindingSource Component</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -355,7 +355,7 @@ ## Examples - The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. New items are added to the list by the <xref:System.Windows.Forms.BindingSource.AddingNew> event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/framework/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). + The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. New items are added to the list by the <xref:System.Windows.Forms.BindingSource.AddingNew> event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/desktop/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.AddingNew/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AddingNewEventArgs/Overview/form1.cs" id="Snippet8"::: @@ -419,7 +419,7 @@ ## Examples - The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. New items are added to the list by the <xref:System.Windows.Forms.BindingSource.AddingNew> event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/framework/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). + The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. New items are added to the list by the <xref:System.Windows.Forms.BindingSource.AddingNew> event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/desktop/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.AddingNew/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AddingNewEventArgs/Overview/form1.cs" id="Snippet7"::: @@ -1417,7 +1417,7 @@ ## Examples - The following code example assigns a list of customers to the <xref:System.Windows.Forms.BindingSource.DataSource%2A> of a <xref:System.Windows.Forms.BindingSource> component. This code example is part of a larger example provided at [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/framework/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). + The following code example assigns a list of customers to the <xref:System.Windows.Forms.BindingSource.DataSource%2A> of a <xref:System.Windows.Forms.BindingSource> component. This code example is part of a larger example provided at [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/desktop/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetItem/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/DataSource/form1.cs" id="Snippet6"::: @@ -3511,7 +3511,7 @@ ## Examples - The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind an array list, which does not provide change notification. An item is removed from the list, and the bound controls are notified of the change by calling the <xref:System.Windows.Forms.BindingSource.ResetBindings%2A> method. This code example is part of a larger example provided in [How to: Reflect Data Source Updates in a Windows Forms Control with the BindingSource](/dotnet/framework/winforms/controls/reflect-data-source-updates-in-a-wf-control-with-the-bindingsource). + The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind an array list, which does not provide change notification. An item is removed from the list, and the bound controls are notified of the change by calling the <xref:System.Windows.Forms.BindingSource.ResetBindings%2A> method. This code example is part of a larger example provided in [How to: Reflect Data Source Updates in a Windows Forms Control with the BindingSource](/dotnet/desktop/winforms/controls/reflect-data-source-updates-in-a-wf-control-with-the-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetBindings/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/ResetBindings/form1.cs" id="Snippet3"::: @@ -3599,7 +3599,7 @@ ## Examples - The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. The list does not raise change notifications, so the <xref:System.Windows.Forms.BindingSource.ResetItem%2A> method on the <xref:System.Windows.Forms.BindingSource> is used to raise the <xref:System.Windows.Forms.BindingSource.ListChanged> event. This code example is part of a larger example provided in [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/framework/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). + The following code example uses a <xref:System.Windows.Forms.BindingSource> component to bind a list to a <xref:System.Windows.Forms.DataGridView> control. The list does not raise change notifications, so the <xref:System.Windows.Forms.BindingSource.ResetItem%2A> method on the <xref:System.Windows.Forms.BindingSource> is used to raise the <xref:System.Windows.Forms.BindingSource.ListChanged> event. This code example is part of a larger example provided in [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/desktop/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetItem/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/DataSource/form1.cs" id="Snippet7"::: diff --git a/xml/System.Windows.Forms/ButtonRenderer.xml b/xml/System.Windows.Forms/ButtonRenderer.xml index b8ff7e694b5..d9a95eda918 100644 --- a/xml/System.Windows.Forms/ButtonRenderer.xml +++ b/xml/System.Windows.Forms/ButtonRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a button control with or without visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ButtonRenderer.DrawButton%2A> method to draw a button. When the button is clicked, the control draws a smaller button inside the bounds of the original button, and the control uses the <xref:System.Windows.Forms.ButtonRenderer.DrawParentBackground%2A> method to paint over the rest of the original button. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ButtonRenderer.DrawButton%2A> method to draw a button. When the button is clicked, the control draws a smaller button inside the bounds of the original button, and the control uses the <xref:System.Windows.Forms.ButtonRenderer.DrawParentBackground%2A> method to paint over the rest of the original button. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> @@ -101,11 +101,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -147,11 +147,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -197,11 +197,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds, with the specified image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -261,20 +261,20 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds, with the specified text, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ButtonRenderer.DrawButton%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.PushButtonState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ButtonRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ButtonRenderer.DrawButton%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.PushButtonState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ButtonRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -330,11 +330,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds, with the specified text and text formatting, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -405,11 +405,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds, with the specified text and image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawButton(System.Drawing.Graphics,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.PushButtonState)" /> @@ -476,11 +476,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.PushButtonState" /> values that specifies the visual state of the button.</param> <summary>Draws a button control in the specified state and bounds; with the specified text, text formatting, and image; and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the button with the current visual style. Otherwise, it will draw the button with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -518,15 +518,15 @@ <param name="childControl">The control whose parent's background will be drawn.</param> <summary>Draws the background of a control's parent in the specified area.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example uses the <xref:System.Windows.Forms.ButtonRenderer.DrawParentBackground%2A> method to paint over an area of a custom control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ButtonRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example uses the <xref:System.Windows.Forms.ButtonRenderer.DrawParentBackground%2A> method to paint over an area of a custom control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ButtonRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> </Docs> @@ -601,11 +601,11 @@ <value> <see langword="true" /> if the application state is used to determine rendering style; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.ButtonRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.ButtonRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/CheckBox.xml b/xml/System.Windows.Forms/CheckBox.xml index 628bf1a7764..06a23479865 100644 --- a/xml/System.Windows.Forms/CheckBox.xml +++ b/xml/System.Windows.Forms/CheckBox.xml @@ -58,40 +58,40 @@ <Docs> <summary>Represents a Windows <see cref="T:System.Windows.Forms.CheckBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use a <xref:System.Windows.Forms.CheckBox> to give the user an option, such as true/false or yes/no. The <xref:System.Windows.Forms.CheckBox> control can display an image or text or both. - - <xref:System.Windows.Forms.CheckBox> and <xref:System.Windows.Forms.RadioButton> controls have a similar function: they allow the user to choose from a list of options. <xref:System.Windows.Forms.CheckBox> controls let the user pick a combination of options. In contrast, <xref:System.Windows.Forms.RadioButton> controls allow a user to choose from mutually exclusive options. - - The <xref:System.Windows.Forms.CheckBox.Appearance%2A> property determines whether the <xref:System.Windows.Forms.CheckBox> appears as a typical <xref:System.Windows.Forms.CheckBox> or as a button. - - The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property determines whether the control supports two or three states. Use the <xref:System.Windows.Forms.CheckBox.Checked%2A> property to get or set the value of a two-state <xref:System.Windows.Forms.CheckBox> control and use the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property to get or set the value of a three-state <xref:System.Windows.Forms.CheckBox> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use a <xref:System.Windows.Forms.CheckBox> to give the user an option, such as true/false or yes/no. The <xref:System.Windows.Forms.CheckBox> control can display an image or text or both. + + <xref:System.Windows.Forms.CheckBox> and <xref:System.Windows.Forms.RadioButton> controls have a similar function: they allow the user to choose from a list of options. <xref:System.Windows.Forms.CheckBox> controls let the user pick a combination of options. In contrast, <xref:System.Windows.Forms.RadioButton> controls allow a user to choose from mutually exclusive options. + + The <xref:System.Windows.Forms.CheckBox.Appearance%2A> property determines whether the <xref:System.Windows.Forms.CheckBox> appears as a typical <xref:System.Windows.Forms.CheckBox> or as a button. + + The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property determines whether the control supports two or three states. Use the <xref:System.Windows.Forms.CheckBox.Checked%2A> property to get or set the value of a two-state <xref:System.Windows.Forms.CheckBox> control and use the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property to get or set the value of a three-state <xref:System.Windows.Forms.CheckBox> control. + > [!NOTE] -> If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `true`, the <xref:System.Windows.Forms.CheckBox.Checked%2A> property will return `true` for either a checked or indeterminate state. - - The <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property determines the style and appearance of the control. If the <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.System?displayProperty=nameWithType>, the user's operating system determines the appearance of the control. - +> If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `true`, the <xref:System.Windows.Forms.CheckBox.Checked%2A> property will return `true` for either a checked or indeterminate state. + + The <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property determines the style and appearance of the control. If the <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.System?displayProperty=nameWithType>, the user's operating system determines the appearance of the control. + > [!NOTE] -> When the <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.System?displayProperty=nameWithType>, the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> property is ignored and the control is displayed using the <xref:System.Drawing.ContentAlignment.MiddleLeft?displayProperty=nameWithType> or <xref:System.Drawing.ContentAlignment.MiddleRight?displayProperty=nameWithType> alignment. If the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> property is set to one of the right alignments, the control is displayed using the <xref:System.Drawing.ContentAlignment.MiddleRight?displayProperty=nameWithType> alignment; otherwise, it is displayed using the <xref:System.Drawing.ContentAlignment.MiddleLeft?displayProperty=nameWithType> alignment. - - The following describes an indeterminate state: You have a <xref:System.Windows.Forms.CheckBox> that determines if the selected text in a <xref:System.Windows.Forms.RichTextBox> is bold. When you select text you can click the <xref:System.Windows.Forms.CheckBox> to bold the selection. Likewise, when you select some text, the <xref:System.Windows.Forms.CheckBox> displays whether the selected text is bold. If your selected text contains text that is bold and normal, the <xref:System.Windows.Forms.CheckBox> will have an indeterminate state. - - - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. - +> When the <xref:System.Windows.Forms.ButtonBase.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.System?displayProperty=nameWithType>, the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> property is ignored and the control is displayed using the <xref:System.Drawing.ContentAlignment.MiddleLeft?displayProperty=nameWithType> or <xref:System.Drawing.ContentAlignment.MiddleRight?displayProperty=nameWithType> alignment. If the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> property is set to one of the right alignments, the control is displayed using the <xref:System.Drawing.ContentAlignment.MiddleRight?displayProperty=nameWithType> alignment; otherwise, it is displayed using the <xref:System.Drawing.ContentAlignment.MiddleLeft?displayProperty=nameWithType> alignment. + + The following describes an indeterminate state: You have a <xref:System.Windows.Forms.CheckBox> that determines if the selected text in a <xref:System.Windows.Forms.RichTextBox> is bold. When you select text you can click the <xref:System.Windows.Forms.CheckBox> to bold the selection. Likewise, when you select some text, the <xref:System.Windows.Forms.CheckBox> displays whether the selected text is bold. If your selected text contains text that is bold and normal, the <xref:System.Windows.Forms.CheckBox> will have an indeterminate state. + + + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ButtonBase" /> - <related type="Article" href="/dotnet/framework/winforms/controls/checkbox-control-windows-forms">CheckBox Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/checkbox-control-windows-forms">CheckBox Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -117,20 +117,20 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.CheckBox" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, when a new <xref:System.Windows.Forms.CheckBox> is instantiated, <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> is set to `true`, <xref:System.Windows.Forms.CheckBox.Checked%2A> is set to `false`, and <xref:System.Windows.Forms.CheckBox.Appearance%2A> is set to <xref:System.Windows.Forms.Appearance.Normal>. - - - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, when a new <xref:System.Windows.Forms.CheckBox> is instantiated, <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> is set to `true`, <xref:System.Windows.Forms.CheckBox.Checked%2A> is set to `false`, and <xref:System.Windows.Forms.CheckBox.Appearance%2A> is set to <xref:System.Windows.Forms.Appearance.Normal>. + + + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.CheckBox" /> @@ -177,20 +177,20 @@ <summary>Gets or sets the value that determines the appearance of a <see cref="T:System.Windows.Forms.CheckBox" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.Appearance" /> values. The default value is <see cref="F:System.Windows.Forms.Appearance.Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.CheckBox.Appearance%2A> value is set to <xref:System.Windows.Forms.Appearance.Normal>, the <xref:System.Windows.Forms.CheckBox> has a typical appearance. If the value is set to `Button`, the <xref:System.Windows.Forms.CheckBox> appears like a toggle button, which can be toggled to an up or down state. - - - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.CheckBox.Appearance%2A> value is set to <xref:System.Windows.Forms.Appearance.Normal>, the <xref:System.Windows.Forms.CheckBox> has a typical appearance. If the value is set to `Button`, the <xref:System.Windows.Forms.CheckBox> appears like a toggle button, which can be toggled to an up or down state. + + + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.Appearance" /> values.</exception> @@ -230,21 +230,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.CheckBox.Appearance" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.AppearanceChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.AppearanceChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.AppearanceChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.AppearanceChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet139"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet139"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet139"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.CheckBox.Appearance" /> @@ -292,20 +292,20 @@ <value> <see langword="true" /> if the <see cref="P:System.Windows.Forms.CheckBox.Checked" /> value or <see cref="P:System.Windows.Forms.CheckBox.CheckState" /> value and the appearance of the control are automatically changed on the <see cref="E:System.Windows.Forms.Control.Click" /> event; otherwise, <see langword="false" />. The default value is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> is set to false, you will need to add code to update the <xref:System.Windows.Forms.CheckBox.Checked%2A> or <xref:System.Windows.Forms.CheckBox.CheckState%2A> values in the <xref:System.Windows.Forms.Control.Click> event handler. - - - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> is set to false, you will need to add code to update the <xref:System.Windows.Forms.CheckBox.Checked%2A> or <xref:System.Windows.Forms.CheckBox.CheckState%2A> values in the <xref:System.Windows.Forms.Control.Click> event handler. + + + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.CheckBox>, gives it the appearance of a toggle button, sets <xref:System.Windows.Forms.CheckBox.AutoCheck%2A> to `false`, and adds it to a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -355,15 +355,15 @@ <summary>Gets or sets the horizontal and vertical alignment of the check mark on a <see cref="T:System.Windows.Forms.CheckBox" /> control.</summary> <value>One of the <see cref="T:System.Drawing.ContentAlignment" /> values. The default value is <see langword="MiddleLeft" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Drawing.ContentAlignment" /> enumeration values.</exception> @@ -419,22 +419,22 @@ <Docs> <summary>Gets or set a value indicating whether the <see cref="T:System.Windows.Forms.CheckBox" /> is in the checked state.</summary> <value> - <see langword="true" /> if the <see cref="T:System.Windows.Forms.CheckBox" /> is in the checked state; otherwise, <see langword="false" />. The default value is <see langword="false" />. - + <see langword="true" /> if the <see cref="T:System.Windows.Forms.CheckBox" /> is in the checked state; otherwise, <see langword="false" />. The default value is <see langword="false" />. + Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property is set to <see langword="true" />, the <see cref="P:System.Windows.Forms.CheckBox.Checked" /> property will return <see langword="true" /> for either a <see langword="Checked" /> or <see langword="Indeterminate" /><see cref="P:System.Windows.Forms.CheckBox.CheckState" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks When the value is `true`, the <xref:System.Windows.Forms.CheckBox> portion of the control displays a check mark. If the <xref:System.Windows.Forms.CheckBox.Appearance%2A> property is set to `Button`, the control will appear sunken when <xref:System.Windows.Forms.CheckBox.Checked%2A> is `true` and raised like a standard button when `false`. - -## Examples - The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between a <xref:System.Drawing.ContentAlignment> value of `MiddleRight` and `MiddleLeft`. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. - + +## Examples + The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between a <xref:System.Drawing.ContentAlignment> value of `MiddleRight` and `MiddleLeft`. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.CheckBox.ThreeState" /> @@ -474,21 +474,21 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.CheckBox.Checked" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.CheckedChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.CheckedChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.CheckedChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.CheckedChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet140"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet140"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet140"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.CheckBox.Checked" /> @@ -543,28 +543,28 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <summary>Gets or sets the state of the <see cref="T:System.Windows.Forms.CheckBox" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.CheckState" /> enumeration values. The default value is <see langword="Unchecked" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `false`, the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property value can only be set to `CheckState.Indeterminate` in code and not by user interaction. - - The following table describes the <xref:System.Windows.Forms.Appearance?displayProperty=nameWithType> of the <xref:System.Windows.Forms.CheckBox> control in its different states for the `Normal` and `Button` style control <xref:System.Windows.Forms.CheckBox.Appearance%2A?displayProperty=nameWithType>. - -|CheckState|Appearance.Normal|Appearance.Button| -|----------------|-----------------------|-----------------------| -|`Checked`|The <xref:System.Windows.Forms.CheckBox> displays a check mark.|The control appears sunken.| -|`Unchecked`|The <xref:System.Windows.Forms.CheckBox> is empty.|The control appears raised.| -|`Indeterminate`|The <xref:System.Windows.Forms.CheckBox> displays a check mark and is shaded.|The control appears flat.| - - - -## Examples - The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment?displayProperty=nameWithType>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `false`, the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property value can only be set to `CheckState.Indeterminate` in code and not by user interaction. + + The following table describes the <xref:System.Windows.Forms.Appearance?displayProperty=nameWithType> of the <xref:System.Windows.Forms.CheckBox> control in its different states for the `Normal` and `Button` style control <xref:System.Windows.Forms.CheckBox.Appearance%2A?displayProperty=nameWithType>. + +|CheckState|Appearance.Normal|Appearance.Button| +|----------------|-----------------------|-----------------------| +|`Checked`|The <xref:System.Windows.Forms.CheckBox> displays a check mark.|The control appears sunken.| +|`Unchecked`|The <xref:System.Windows.Forms.CheckBox> is empty.|The control appears raised.| +|`Indeterminate`|The <xref:System.Windows.Forms.CheckBox> displays a check mark and is shaded.|The control appears flat.| + + + +## Examples + The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment?displayProperty=nameWithType>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This example requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.CheckState" /> enumeration values.</exception> @@ -605,21 +605,21 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.CheckBox.CheckState" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.CheckStateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.CheckStateChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckBox.CheckStateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckBox> named `CheckBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckBox.CheckStateChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet141"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet141"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet141"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.CheckBox.CheckState" /> @@ -653,14 +653,14 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <summary>Creates a new accessibility object for the <see cref="T:System.Windows.Forms.CheckBox" /> control.</summary> <returns>A new <see cref="T:System.Windows.Forms.CheckBox.CheckBoxAccessibleObject" /> for the control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.CheckBox.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.CheckBox.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -695,15 +695,15 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <summary>Gets the required creation parameters when the control handle is created.</summary> <value>A <see cref="T:System.Windows.Forms.CreateParams" /> that contains the required creation parameters when the handle to the control is created.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example extends the <xref:System.Windows.Forms.Control.CreateParams%2A> property of a <xref:System.Windows.Forms.Button> derived class. The <xref:System.Windows.Forms.CreateParams.Style%2A?displayProperty=nameWithType> property is changed, which causes the button to display an <xref:System.Drawing.Icon> rather than an <xref:System.Drawing.Image>. This example requires that you have a class that inherits from the <xref:System.Windows.Forms.Button> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example extends the <xref:System.Windows.Forms.Control.CreateParams%2A> property of a <xref:System.Windows.Forms.Button> derived class. The <xref:System.Windows.Forms.CreateParams.Style%2A?displayProperty=nameWithType> property is changed, which causes the button to display an <xref:System.Drawing.Icon> rather than an <xref:System.Drawing.Image>. This example requires that you have a class that inherits from the <xref:System.Windows.Forms.Button> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CreateParams/CPP/createparams.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CreateParams/createparams.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3"::: + ]]></format> </remarks> </Docs> @@ -778,13 +778,13 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <Docs> <summary>Occurs when the user double-clicks the <see cref="T:System.Windows.Forms.CheckBox" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.ControlStyles.StandardClick> and <xref:System.Windows.Forms.ControlStyles.StandardDoubleClick> enumerations are set to false for the <xref:System.Windows.Forms.CheckBox> control, and the <xref:System.Windows.Forms.CheckBox.DoubleClick> event is not raised. - - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.ControlStyles.StandardClick> and <xref:System.Windows.Forms.ControlStyles.StandardDoubleClick> enumerations are set to false for the <xref:System.Windows.Forms.CheckBox> control, and the <xref:System.Windows.Forms.CheckBox.DoubleClick> event is not raised. + + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -829,13 +829,13 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <Docs> <summary>Occurs when the user double-clicks the <see cref="T:System.Windows.Forms.CheckBox" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.ControlStyles.StandardClick?displayProperty=nameWithType> and <xref:System.Windows.Forms.ControlStyles.StandardDoubleClick?displayProperty=nameWithType> style bits are set to `false` for the <xref:System.Windows.Forms.CheckBox> control, and the <xref:System.Windows.Forms.CheckBox.MouseDoubleClick> event is not raised. - - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.ControlStyles.StandardClick?displayProperty=nameWithType> and <xref:System.Windows.Forms.ControlStyles.StandardDoubleClick?displayProperty=nameWithType> style bits are set to `false` for the <xref:System.Windows.Forms.CheckBox> control, and the <xref:System.Windows.Forms.CheckBox.MouseDoubleClick> event is not raised. + + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -870,13 +870,13 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckBox.AppearanceChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckBox.OnAppearanceChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckBox.OnAppearanceChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -915,13 +915,13 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckBox.CheckedChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckBox.OnCheckedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckBox.OnCheckedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -960,13 +960,13 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckBox.CheckStateChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckBox.OnCheckStateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckBox.OnCheckStateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1005,15 +1005,15 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Click" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckBox.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckBox.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1149,30 +1149,30 @@ Note: If the <see cref="P:System.Windows.Forms.CheckBox.ThreeState" /> property <returns> <see langword="true" /> if the character was processed as a mnemonic by the control; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is called to give a control the opportunity to process a mnemonic character. The method should determine whether the control is in a state to process mnemonics and if whether the given character represents a mnemonic. If so, the method should perform the action associated with the mnemonic and return `true`. If not, the method should return `false`. Implementations of this method often use the <xref:System.Windows.Forms.Control.IsMnemonic%2A> method to determine whether the given character matches a mnemonic in the control's text. - - For example: - -```csharp -if (CanSelect && IsMnemonic(charCode, MyControl.Text) { - // Perform action associated with mnemonic. - } -``` - - This default implementation of the <xref:System.Windows.Forms.Control.ProcessMnemonic%2A> method simply returns `false` to indicate that the control has no mnemonic. - - - -## Examples - The following code example demonstrates an extension of the button class that overrides the <xref:System.Windows.Forms.Control.ProcessMnemonic%2A> method to exhibit custom behavior. The example also demonstrates the use of the <xref:System.Windows.Forms.Control.CanSelect%2A> and <xref:System.Windows.Forms.Control.IsMnemonic%2A> properties. To run this example, paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is called to give a control the opportunity to process a mnemonic character. The method should determine whether the control is in a state to process mnemonics and if whether the given character represents a mnemonic. If so, the method should perform the action associated with the mnemonic and return `true`. If not, the method should return `false`. Implementations of this method often use the <xref:System.Windows.Forms.Control.IsMnemonic%2A> method to determine whether the given character matches a mnemonic in the control's text. + + For example: + +```csharp +if (CanSelect && IsMnemonic(charCode, MyControl.Text) { + // Perform action associated with mnemonic. + } +``` + + This default implementation of the <xref:System.Windows.Forms.Control.ProcessMnemonic%2A> method simply returns `false` to indicate that the control has no mnemonic. + + + +## Examples + The following code example demonstrates an extension of the button class that overrides the <xref:System.Windows.Forms.Control.ProcessMnemonic%2A> method to exhibit custom behavior. The example also demonstrates the use of the <xref:System.Windows.Forms.Control.CanSelect%2A> and <xref:System.Windows.Forms.Control.IsMnemonic%2A> properties. To run this example, paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/ProcessMnemonic/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1290,20 +1290,20 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) { <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.CheckBox" /> is able to display three check states; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `false`, the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property value can only be set to the `Indeterminate` value of <xref:System.Windows.Forms.CheckState?displayProperty=nameWithType> in code and not by user interaction. - - - -## Examples - The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment?displayProperty=nameWithType>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This code requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property is set to `false`, the <xref:System.Windows.Forms.CheckBox.CheckState%2A> property value can only be set to the `Indeterminate` value of <xref:System.Windows.Forms.CheckState?displayProperty=nameWithType> in code and not by user interaction. + + + +## Examples + The following code example displays the values of three properties in a label. The <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property alternates between `true` and `false` with alternating clicks of the control and the <xref:System.Windows.Forms.CheckBox.CheckAlign%2A> alternates between the `MiddleRight` and `MiddleLeft` values of <xref:System.Drawing.ContentAlignment?displayProperty=nameWithType>. This example shows how the property values change as the <xref:System.Windows.Forms.CheckBox.ThreeState%2A> property changes and the control is checked. This code requires that a <xref:System.Windows.Forms.CheckBox>, <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Button> have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the <xref:System.Drawing?displayProperty=nameWithType> namespace. This code should be called in the <xref:System.Windows.Forms.Control.Click> event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/CheckBoxRenderer.xml b/xml/System.Windows.Forms/CheckBoxRenderer.xml index 63fac80f4a5..51ba9a8406f 100644 --- a/xml/System.Windows.Forms/CheckBoxRenderer.xml +++ b/xml/System.Windows.Forms/CheckBoxRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a check box control with or without visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to write a custom control that uses the <xref:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox%2A> method to draw a check box that responds to mouse clicks. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to write a custom control that uses the <xref:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox%2A> method to draw a check box that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> @@ -101,11 +101,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.CheckBoxState" /> values that specifies the visual state of the check box.</param> <summary>Draws a check box control in the specified state and location.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.CheckBoxState)" /> @@ -167,11 +167,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.CheckBoxState" /> values that specifies the visual state of the check box.</param> <summary>Draws a check box control in the specified state and location, with the specified text, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.CheckBoxState)" /> @@ -229,20 +229,20 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.CheckBoxState" /> values that specifies the visual state of the check box.</param> <summary>Draws a check box control in the specified state and location, with the specified text and text formatting, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox%28System.Drawing.Graphics%2CSystem.Drawing.Point%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.TextFormatFlags%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.CheckBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a check box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.CheckBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox%28System.Drawing.Graphics%2CSystem.Drawing.Point%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.TextFormatFlags%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.CheckBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a check box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.CheckBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.CheckBoxState)" /> @@ -315,11 +315,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.CheckBoxState" /> values that specifies the visual state of the check box.</param> <summary>Draws a check box control in the specified state and location, with the specified text and image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.CheckBoxRenderer.DrawCheckBox(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.CheckBoxState)" /> @@ -388,11 +388,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.CheckBoxState" /> values that specifies the visual state of the check box.</param> <summary>Draws a check box control in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the check box with the current visual style. Otherwise, it will draw the check box with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -465,20 +465,20 @@ <summary>Returns the size of the check box glyph.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that represents the size of the check box glyph.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the check box glyph is determined by the current visual style of the operating system. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.CheckBoxRenderer.GetGlyphSize%2A> method to determine the bounds of the check box text. This code example is part of a larger example provided for the <xref:System.Windows.Forms.CheckBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the check box glyph is determined by the current visual style of the operating system. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.CheckBoxRenderer.GetGlyphSize%2A> method to determine the bounds of the check box text. This code example is part of a larger example provided for the <xref:System.Windows.Forms.CheckBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -554,11 +554,11 @@ <value> <see langword="true" /> if the application state is used to determine rendering style; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.CheckBoxRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.CheckBoxRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.CheckBoxRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.CheckBoxRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.CheckBoxRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.CheckBoxRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. + ]]></format> </remarks> <inheritdoc cref="P:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState" /> diff --git a/xml/System.Windows.Forms/CheckedListBox.xml b/xml/System.Windows.Forms/CheckedListBox.xml index 809d3892e22..a721ef416b1 100644 --- a/xml/System.Windows.Forms/CheckedListBox.xml +++ b/xml/System.Windows.Forms/CheckedListBox.xml @@ -43,69 +43,69 @@ <Docs> <summary>Displays a <see cref="T:System.Windows.Forms.ListBox" /> in which a check box is displayed to the left of each item.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This control presents a list of items that the user can navigate by using the keyboard or the scrollbar on the right side of the control. The user can place a check mark by one or more items and the checked items can be navigated with the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection> and <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>. - - To add objects to the list at run time, assign an array of object references with the <xref:System.Windows.Forms.ListBox.ObjectCollection.AddRange%2A> method. The list then displays the default string value for each object. You can add individual items to the list with the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection.Add%2A> method. - - The <xref:System.Windows.Forms.CheckedListBox> object supports three states through the <xref:System.Windows.Forms.CheckState> enumeration: <xref:System.Windows.Forms.CheckState.Checked>, <xref:System.Windows.Forms.CheckState.Indeterminate>, and <xref:System.Windows.Forms.CheckState.Unchecked>. You must set the state of <xref:System.Windows.Forms.CheckState.Indeterminate> in the code because the user interface for a <xref:System.Windows.Forms.CheckedListBox> does not provide a mechanism to do so. - - If <xref:System.Windows.Forms.ListBox.UseTabStops%2A> is `true`, the <xref:System.Windows.Forms.CheckedListBox> will recognize and expand tab characters in an item's text, creating columns. These tab stops are preset and cannot be changed. To use custom tab stops, set <xref:System.Windows.Forms.ListBox.UseTabStops%2A> to `false`, set <xref:System.Windows.Forms.ListBox.UseCustomTabOffsets%2A> to `true`, and add the custom values to the <xref:System.Windows.Forms.ListBox.CustomTabOffsets%2A> collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This control presents a list of items that the user can navigate by using the keyboard or the scrollbar on the right side of the control. The user can place a check mark by one or more items and the checked items can be navigated with the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection> and <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>. + + To add objects to the list at run time, assign an array of object references with the <xref:System.Windows.Forms.ListBox.ObjectCollection.AddRange%2A> method. The list then displays the default string value for each object. You can add individual items to the list with the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection.Add%2A> method. + + The <xref:System.Windows.Forms.CheckedListBox> object supports three states through the <xref:System.Windows.Forms.CheckState> enumeration: <xref:System.Windows.Forms.CheckState.Checked>, <xref:System.Windows.Forms.CheckState.Indeterminate>, and <xref:System.Windows.Forms.CheckState.Unchecked>. You must set the state of <xref:System.Windows.Forms.CheckState.Indeterminate> in the code because the user interface for a <xref:System.Windows.Forms.CheckedListBox> does not provide a mechanism to do so. + + If <xref:System.Windows.Forms.ListBox.UseTabStops%2A> is `true`, the <xref:System.Windows.Forms.CheckedListBox> will recognize and expand tab characters in an item's text, creating columns. These tab stops are preset and cannot be changed. To use custom tab stops, set <xref:System.Windows.Forms.ListBox.UseTabStops%2A> to `false`, set <xref:System.Windows.Forms.ListBox.UseCustomTabOffsets%2A> to `true`, and add the custom values to the <xref:System.Windows.Forms.ListBox.CustomTabOffsets%2A> collection. + > [!NOTE] -> If the <xref:System.Windows.Forms.CheckedListBox.UseCompatibleTextRendering%2A> property is `false`, the <xref:System.Windows.Forms.ListBox.CustomTabOffsets%2A> property will be ignored and replaced with standard tab offsets. - - The <xref:System.Windows.Forms.CheckedListBox> class supports the following three indexed collections: - -|Collection|Encapsulating Class| -|----------------|-------------------------| -|All items contained in the <xref:System.Windows.Forms.CheckedListBox> control.|<xref:System.Windows.Forms.CheckedListBox.ObjectCollection>| -|Checked items (including items in an indeterminate state), which is a subset of the items contained in the <xref:System.Windows.Forms.CheckedListBox> control.|<xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>| -|Checked indexes, which is a subset of the indexes into the items collection. These indexes specify items in a checked or indeterminate state.|<xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>| - - The following three tables are examples of the three indexed collections that the <xref:System.Windows.Forms.CheckedListBox> class supports. - - The first table provides an example of the indexed collection of items in the control (all items contained in the control). - -|Index|Item|Check State| -|-----------|----------|-----------------| -|0|Object 1|<xref:System.Windows.Forms.CheckState.Unchecked>| -|1|Object 2|<xref:System.Windows.Forms.CheckState.Checked>| -|2|Object 3|<xref:System.Windows.Forms.CheckState.Unchecked>| -|3|Object 4|<xref:System.Windows.Forms.CheckState.Indeterminate>| -|4|Object 5|<xref:System.Windows.Forms.CheckState.Checked>| - - The second table provides an example of the indexed collection of the checked items. - -|Index|Item| -|-----------|----------| -|0|Object 2| -|1|Object 4| -|2|Object 5| - - The third table provides an example of the indexed collection of indexes of checked items. - -|Index|Index of Item| -|-----------|-------------------| -|0|1| -|1|3| -|2|4| - - - -## Examples - The following example illustrates how you can use the methods, properties, and collections of a <xref:System.Windows.Forms.CheckedListBox>. This is a complete sample ready to run once you have copied it to your project. You can check and uncheck items, use the text box to add items and once you have clicked the save button, clear the checked items. - +> If the <xref:System.Windows.Forms.CheckedListBox.UseCompatibleTextRendering%2A> property is `false`, the <xref:System.Windows.Forms.ListBox.CustomTabOffsets%2A> property will be ignored and replaced with standard tab offsets. + + The <xref:System.Windows.Forms.CheckedListBox> class supports the following three indexed collections: + +|Collection|Encapsulating Class| +|----------------|-------------------------| +|All items contained in the <xref:System.Windows.Forms.CheckedListBox> control.|<xref:System.Windows.Forms.CheckedListBox.ObjectCollection>| +|Checked items (including items in an indeterminate state), which is a subset of the items contained in the <xref:System.Windows.Forms.CheckedListBox> control.|<xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>| +|Checked indexes, which is a subset of the indexes into the items collection. These indexes specify items in a checked or indeterminate state.|<xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>| + + The following three tables are examples of the three indexed collections that the <xref:System.Windows.Forms.CheckedListBox> class supports. + + The first table provides an example of the indexed collection of items in the control (all items contained in the control). + +|Index|Item|Check State| +|-----------|----------|-----------------| +|0|Object 1|<xref:System.Windows.Forms.CheckState.Unchecked>| +|1|Object 2|<xref:System.Windows.Forms.CheckState.Checked>| +|2|Object 3|<xref:System.Windows.Forms.CheckState.Unchecked>| +|3|Object 4|<xref:System.Windows.Forms.CheckState.Indeterminate>| +|4|Object 5|<xref:System.Windows.Forms.CheckState.Checked>| + + The second table provides an example of the indexed collection of the checked items. + +|Index|Item| +|-----------|----------| +|0|Object 2| +|1|Object 4| +|2|Object 5| + + The third table provides an example of the indexed collection of indexes of checked items. + +|Index|Index of Item| +|-----------|-------------------| +|0|1| +|1|3| +|2|4| + + + +## Examples + The following example illustrates how you can use the methods, properties, and collections of a <xref:System.Windows.Forms.CheckedListBox>. This is a complete sample ready to run once you have copied it to your project. You can check and uncheck items, use the text box to add items and once you have clicked the save button, clear the checked items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckedListBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckedListBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckedListBox Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListBox" /> - <related type="Article" href="/dotnet/framework/winforms/controls/checkedlistbox-control-windows-forms">CheckedListBox Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/checkedlistbox-control-windows-forms">CheckedListBox Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -131,11 +131,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.CheckedListBox" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, <xref:System.Windows.Forms.CheckedListBox> uses <xref:System.Windows.Forms.Control.SetStyle%2A> and the `ResizeRedraw` value of <xref:System.Windows.Forms.ControlStyles> to specify that the control is redrawn when resized. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, <xref:System.Windows.Forms.CheckedListBox> uses <xref:System.Windows.Forms.Control.SetStyle%2A> and the `ResizeRedraw` value of <xref:System.Windows.Forms.ControlStyles> to specify that the control is redrawn when resized. + ]]></format> </remarks> </Docs> @@ -181,22 +181,22 @@ <summary>Collection of checked indexes in this <see cref="T:System.Windows.Forms.CheckedListBox" />.</summary> <value>The <see cref="T:System.Windows.Forms.CheckedListBox.CheckedIndexCollection" /> collection for the <see cref="T:System.Windows.Forms.CheckedListBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The collection of checked indexes is a subset of the indexes into the collection of all items in the <xref:System.Windows.Forms.CheckedListBox> control. These indexes specify items in a checked or indeterminate state. - - - -## Examples - The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. - - The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The collection of checked indexes is a subset of the indexes into the collection of all items in the <xref:System.Windows.Forms.CheckedListBox> control. These indexes specify items in a checked or indeterminate state. + + + +## Examples + The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. + + The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.CheckedListBox.CheckedIndexCollection" /> @@ -243,38 +243,38 @@ <summary>Collection of checked items in this <see cref="T:System.Windows.Forms.CheckedListBox" />.</summary> <value>The <see cref="T:System.Windows.Forms.CheckedListBox.CheckedItemCollection" /> collection for the <see cref="T:System.Windows.Forms.CheckedListBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The collection is a subset of the objects in the <xref:System.Windows.Forms.CheckedListBox.Items%2A> collection, representing only those items whose <xref:System.Windows.Forms.CheckState?displayProperty=nameWithType> is `Checked` or `Indeterminate`. The indexes in this collection are in ascending order. - - - -## Examples - The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. - - The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. - - To run this example, perform the following steps: - -1. Create a new Windows Forms application. - -2. Add a <xref:System.Windows.Forms.CheckedListBox> and a <xref:System.Windows.Forms.Button> to the form. - -3. Name the button `WhatIsChecked`, add a handler for its <xref:System.Windows.Forms.Control.Click> event, and copy in the code from the body of the following handler. - -4. Add some items to the <xref:System.Windows.Forms.CheckedListBox>. - -5. Run the example and check some of the check boxes in the list box. - -6. Click the button. - - You will see a series of message boxes that indicate which items were checked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The collection is a subset of the objects in the <xref:System.Windows.Forms.CheckedListBox.Items%2A> collection, representing only those items whose <xref:System.Windows.Forms.CheckState?displayProperty=nameWithType> is `Checked` or `Indeterminate`. The indexes in this collection are in ascending order. + + + +## Examples + The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. + + The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. + + To run this example, perform the following steps: + +1. Create a new Windows Forms application. + +2. Add a <xref:System.Windows.Forms.CheckedListBox> and a <xref:System.Windows.Forms.Button> to the form. + +3. Name the button `WhatIsChecked`, add a handler for its <xref:System.Windows.Forms.Control.Click> event, and copy in the code from the body of the following handler. + +4. Add some items to the <xref:System.Windows.Forms.CheckedListBox>. + +5. Run the example and check some of the check boxes in the list box. + +6. Click the button. + + You will see a series of message boxes that indicate which items were checked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.CheckedListBox.CheckedItemCollection" /> @@ -322,22 +322,22 @@ <value> <see langword="true" /> if the check mark is applied immediately; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A> indicates whether the check box should be toggled whenever an item is selected. The default behavior is to change the selection on the first click, and then have the user click again to apply the check mark. In some instances, however, you might prefer have the item checked as soon as it is clicked. - - - -## Examples - The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. - - To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A> indicates whether the check box should be toggled whenever an item is selected. The default behavior is to change the selection on the first click, and then have the user click again to apply the check mark. In some instances, however, you might prefer have the item checked as soon as it is clicked. + + + +## Examples + The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. + + To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -391,23 +391,23 @@ <Docs> <summary>Occurs when the user clicks the <see cref="T:System.Windows.Forms.CheckedListBox" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.CheckedListBox.Click> event passes an <xref:System.EventArgs> to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (such as the button, number of clicks, wheel rotation, or location), use the <xref:System.Windows.Forms.Control.MouseDown> and <xref:System.Windows.Forms.Control.MouseUp> events, which pass a <xref:System.Windows.Forms.MouseEventArgs> to the event handler. - - A double-click is determined by the mouse settings of the user's operating system. The user can adjust the amount of time that can pass between clicks during a double-click of a mouse button. The <xref:System.Windows.Forms.CheckedListBox.Click> event is raised every time the user double-clicks a control. For example, if you have event-handling methods for the <xref:System.Windows.Forms.CheckedListBox.Click> and <xref:System.Windows.Forms.Control.DoubleClick> events of a form, the events are raised when the form is double-clicked and both event-handling methods are called. If the user double-clicks a control that does not support the <xref:System.Windows.Forms.Control.DoubleClick> event, the <xref:System.Windows.Forms.CheckedListBox.Click> event might be raised twice. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.Click> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.Click> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.CheckedListBox.Click> event passes an <xref:System.EventArgs> to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (such as the button, number of clicks, wheel rotation, or location), use the <xref:System.Windows.Forms.Control.MouseDown> and <xref:System.Windows.Forms.Control.MouseUp> events, which pass a <xref:System.Windows.Forms.MouseEventArgs> to the event handler. + + A double-click is determined by the mouse settings of the user's operating system. The user can adjust the amount of time that can pass between clicks during a double-click of a mouse button. The <xref:System.Windows.Forms.CheckedListBox.Click> event is raised every time the user double-clicks a control. For example, if you have event-handling methods for the <xref:System.Windows.Forms.CheckedListBox.Click> and <xref:System.Windows.Forms.Control.DoubleClick> events of a form, the events are raised when the form is double-clicked and both event-handling methods are called. If the user double-clicks a control that does not support the <xref:System.Windows.Forms.Control.DoubleClick> event, the <xref:System.Windows.Forms.CheckedListBox.Click> event might be raised twice. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.Click> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.Click> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet157"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet157"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet157"::: + ]]></format> </remarks> </Docs> @@ -440,14 +440,14 @@ <summary>Creates a new accessibility object for the <see cref="T:System.Windows.Forms.CheckedListBox" /> control.</summary> <returns>A new <see cref="T:System.Windows.Forms.AccessibleObject" /> for the control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.CheckedListBox.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.CheckedListBox.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -513,21 +513,21 @@ <summary>Gets the required creation parameters when the control handle is created.</summary> <value>A <see cref="T:System.Windows.Forms.CreateParams" /> that contains the required parameters.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be overridden and used to adjust the properties of your derived control. Properties such as the <xref:System.Windows.Forms.CreateParams.Caption%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.CreateParams.Width%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.CreateParams.Height%2A?displayProperty=nameWithType> should be set by the corresponding properties in your control such as <xref:System.Windows.Forms.Control.Text%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.Control.Width%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.Control.Height%2A?displayProperty=nameWithType>. The <xref:System.Windows.Forms.CreateParams> should only be extended when you are wrapping a standard Windows control class or to set styles not provided by the Windows Forms namespace. For more information about creating control parameters, see the `CreateWindow` and `CreateWindowEx` functions and the `CREATESTRUCT` structure documentation in the Windows Platform SDK reference at <https://learn.microsoft.com>. - - - -## Examples - The following code example extends the <xref:System.Windows.Forms.Control.CreateParams%2A> property of a <xref:System.Windows.Forms.Button> derived class. The <xref:System.Windows.Forms.CreateParams.Style%2A?displayProperty=nameWithType> property is changed, which causes the button to display an <xref:System.Drawing.Icon> rather than an <xref:System.Drawing.Image>. This example requires that you have a class that inherits from the <xref:System.Windows.Forms.Button> class. - + + + +## Examples + The following code example extends the <xref:System.Windows.Forms.Control.CreateParams%2A> property of a <xref:System.Windows.Forms.Button> derived class. The <xref:System.Windows.Forms.CreateParams.Style%2A?displayProperty=nameWithType> property is changed, which causes the button to display an <xref:System.Drawing.Icon> rather than an <xref:System.Drawing.Image>. This example requires that you have a class that inherits from the <xref:System.Windows.Forms.Button> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CreateParams/CPP/createparams.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CreateParams/createparams.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -659,24 +659,24 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets or sets a string that specifies a property of the objects contained in the list box whose contents you want to display.</summary> <value>A string that specifies the name of a property of the objects contained in the list box. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default the <xref:System.Windows.Forms.CheckedListBox> displays the default string for the items it contains. However, the <xref:System.Windows.Forms.CheckedListBox> can display diverse types of objects and you may want to change the displayed string by specifying the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> property. If the specified property does not exist, or the value of the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> property is an empty string (""), the results of the object's <xref:System.Windows.Forms.ListBox.ToString%2A> method are displayed instead. - - If the new value of the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> cannot be set, the previous value is maintained. - - - -## Examples - The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. - - To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default the <xref:System.Windows.Forms.CheckedListBox> displays the default string for the items it contains. However, the <xref:System.Windows.Forms.CheckedListBox> can display diverse types of objects and you may want to change the displayed string by specifying the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> property. If the specified property does not exist, or the value of the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> property is an empty string (""), the results of the object's <xref:System.Windows.Forms.ListBox.ToString%2A> method are displayed instead. + + If the new value of the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> cannot be set, the previous value is maintained. + + + +## Examples + The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. + + To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -765,13 +765,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <Docs> <summary>Occurs when a visual aspect of an owner-drawn <see cref="T:System.Windows.Forms.CheckedListBox" /> changes. This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is used by an owner-drawn <xref:System.Windows.Forms.CheckedListBox>. The event is raised only when the <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> property is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawFixed?displayProperty=nameWithType> or <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable?displayProperty=nameWithType>. You can use this event to perform the tasks needed to draw items in the <xref:System.Windows.Forms.CheckedListBox>. If you have a variable-sized item (that is, <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable?displayProperty=nameWithType>), the <xref:System.Windows.Forms.CheckedListBox.MeasureItem> event is raised before the item is drawn. You can create an event handler for the <xref:System.Windows.Forms.CheckedListBox.MeasureItem> event to specify the size for the item that you are going to draw in your event handler for the <xref:System.Windows.Forms.CheckedListBox.DrawItem> event. - - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is used by an owner-drawn <xref:System.Windows.Forms.CheckedListBox>. The event is raised only when the <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> property is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawFixed?displayProperty=nameWithType> or <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable?displayProperty=nameWithType>. You can use this event to perform the tasks needed to draw items in the <xref:System.Windows.Forms.CheckedListBox>. If you have a variable-sized item (that is, <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable?displayProperty=nameWithType>), the <xref:System.Windows.Forms.CheckedListBox.MeasureItem> event is raised before the item is drawn. You can create an event handler for the <xref:System.Windows.Forms.CheckedListBox.MeasureItem> event to specify the size for the item that you are going to draw in your event handler for the <xref:System.Windows.Forms.CheckedListBox.DrawItem> event. + + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -821,11 +821,11 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets a value indicating the mode for drawing elements of the <see cref="T:System.Windows.Forms.CheckedListBox" />. This property is not relevant to this class.</summary> <value>Always a <see cref="T:System.Windows.Forms.DrawMode" /> of <see langword="Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -862,17 +862,17 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <returns> <see langword="true" /> if the item is checked; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.CheckedListBox.GetItemChecked%2A> returns `true` if the value of <xref:System.Windows.Forms.CheckState> is `Checked` or `Indeterminate` for the item. To determine the specific state the item is in, use the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.CheckedListBox.GetItemChecked%2A> returns `true` if the value of <xref:System.Windows.Forms.CheckState> is `Checked` or `Indeterminate` for the item. To determine the specific state the item is in, use the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method. + ]]></format> </remarks> - <exception cref="T:System.ArgumentException">The <paramref name="index" /> specified is less than zero. - - -or- - + <exception cref="T:System.ArgumentException">The <paramref name="index" /> specified is less than zero. + + -or- + The <paramref name="index" /> specified is greater than or equal to the count of items in the list.</exception> <altmember cref="M:System.Windows.Forms.CheckedListBox.GetItemCheckState(System.Int32)" /> <altmember cref="T:System.Windows.Forms.CheckState" /> @@ -909,28 +909,28 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Returns a value indicating the check state of the current item.</summary> <returns>One of the <see cref="T:System.Windows.Forms.CheckState" /> values.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method provides the ability to get the <xref:System.Windows.Forms.CheckState> value of an item, given the index. If you never set the check state of an item to `Indeterminate`, then use the <xref:System.Windows.Forms.CheckedListBox.GetItemChecked%2A> method. - - - -## Examples - The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to set the check state of an item. The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. - - The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method provides the ability to get the <xref:System.Windows.Forms.CheckState> value of an item, given the index. If you never set the check state of an item to `Indeterminate`, then use the <xref:System.Windows.Forms.CheckedListBox.GetItemChecked%2A> method. + + + +## Examples + The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to set the check state of an item. The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. + + The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> specified is less than zero. - - -or- - + <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> specified is less than zero. + + -or- + The <paramref name="index" /> specified is greater than or equal to the count of items in the list.</exception> <altmember cref="M:System.Windows.Forms.CheckedListBox.GetItemChecked(System.Int32)" /> <altmember cref="T:System.Windows.Forms.CheckState" /> @@ -969,21 +969,21 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <Docs> <summary>Occurs when the checked state of an item changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The check state is not updated until after the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event occurs. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The check state is not updated until after the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event occurs. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet156"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet156"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet156"::: + ]]></format> </remarks> </Docs> @@ -1033,13 +1033,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets the height of the item area.</summary> <value>The height, in pixels, of the item area.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This measurement is based on the font height plus a small margin to provide white space around the item. - - The extenders of characters such as "g" and "y" do not display properly when the font is changed to 9.75-point Arial. To correct this, derive a class from <xref:System.Windows.Forms.CheckedListBox> and override <xref:System.Windows.Forms.CheckedListBox.ItemHeight%2A> to return `base.ItemHeight+2`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This measurement is based on the font height plus a small margin to provide white space around the item. + + The extenders of characters such as "g" and "y" do not display properly when the font is changed to 9.75-point Arial. To correct this, derive a class from <xref:System.Windows.Forms.CheckedListBox> and override <xref:System.Windows.Forms.CheckedListBox.ItemHeight%2A> to return `base.ItemHeight+2`. + ]]></format> </remarks> </Docs> @@ -1101,22 +1101,22 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets the collection of items in this <see cref="T:System.Windows.Forms.CheckedListBox" />.</summary> <value>The <see cref="T:System.Windows.Forms.CheckedListBox.ObjectCollection" /> collection representing the items in the <see cref="T:System.Windows.Forms.CheckedListBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.CheckedListBox.Items%2A> property enables you to obtain a reference to the list of items that are currently stored in a <xref:System.Windows.Forms.CheckedListBox> control. With this reference, you can add items, remove items, and obtain a count of the items in the collection. For more information on the tasks that can be performed with the item collection, see the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> class reference topics. - - - -## Examples - The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example uses the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to retrieve the index of an item using the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method. The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. - - The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.CheckedListBox.Items%2A> property enables you to obtain a reference to the list of items that are currently stored in a <xref:System.Windows.Forms.CheckedListBox> control. With this reference, you can add items, remove items, and obtain a count of the items in the collection. For more information on the tasks that can be performed with the item collection, see the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> class reference topics. + + + +## Examples + The following example enumerates the checked items in the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection> to see what check state an item is in. The example uses the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to retrieve the index of an item using the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method. The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.CheckedIndices%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedIndexCollection>, and the <xref:System.Windows.Forms.CheckedListBox.CheckedItems%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.CheckedItemCollection>. + + The first loop uses the <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A> method to get the <xref:System.Windows.Forms.CheckState> of each checked item, given the index of the item. The second loop also uses <xref:System.Windows.Forms.CheckedListBox.GetItemCheckState%2A>, but uses the <xref:System.Windows.Forms.ListBox.ObjectCollection.IndexOf%2A?displayProperty=nameWithType> method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.CheckedListBox.CheckedItems" /> @@ -1164,15 +1164,15 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <Docs> <summary>Occurs when an owner-drawn <see cref="T:System.Windows.Forms.ListBox" /> is created and the sizes of the list items are determined. This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can create an event handler for this event to specify the size of an item before it is drawn in the <xref:System.Windows.Forms.CheckedListBox.DrawItem> event. The event is raised only when the <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> property is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable>. - - The maximum height of a <xref:System.Windows.Forms.ListBox> item is 255 pixels. - - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can create an event handler for this event to specify the size of an item before it is drawn in the <xref:System.Windows.Forms.CheckedListBox.DrawItem> event. The event is raised only when the <xref:System.Windows.Forms.CheckedListBox.DrawMode%2A> property is set to <xref:System.Windows.Forms.DrawMode.OwnerDrawVariable>. + + The maximum height of a <xref:System.Windows.Forms.ListBox> item is 255 pixels. + + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1217,21 +1217,21 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <Docs> <summary>Occurs when the user clicks the <see cref="T:System.Windows.Forms.CheckedListBox" /> control with the mouse.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.MouseClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.MouseClick> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.CheckedListBox.MouseClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.CheckedListBox.MouseClick> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet158"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet158"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet158"::: + ]]></format> </remarks> </Docs> @@ -1299,15 +1299,15 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckedListBox.Click" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1345,13 +1345,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">The <see cref="T:System.Windows.Forms.DrawItemEventArgs" /> object with the details.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckedListBox.DrawItem" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnDrawItem%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnDrawItem%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1389,13 +1389,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1433,13 +1433,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.HandleCreated" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnHandleCreated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnHandleCreated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1477,13 +1477,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="ice">An <see cref="T:System.Windows.Forms.ItemCheckEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckedListBox.ItemCheck" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnItemCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnItemCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1521,15 +1521,15 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">The <see cref="T:System.Windows.Forms.KeyPressEventArgs" /> that was raised.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyPress" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnKeyPress%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnKeyPress%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1567,13 +1567,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">A <see cref="T:System.Windows.Forms.MeasureItemEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.CheckedListBox.MeasureItem" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnMeasureItem%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnMeasureItem%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1611,13 +1611,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ListBox.SelectedIndexChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.CheckedListBox.OnSelectedIndexChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.CheckedListBox.OnSelectedIndexChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1669,13 +1669,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets or sets padding within the <see cref="T:System.Windows.Forms.CheckedListBox" />. This property is not relevant to this class.</summary> <value>A <see cref="T:System.Windows.Forms.Padding" /> representing the control's internal spacing characteristics.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Controls receive default values for <xref:System.Windows.Forms.Control.Padding%2A> that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications. - - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Controls receive default values for <xref:System.Windows.Forms.Control.Padding%2A> that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications. + + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1735,22 +1735,22 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets or sets a value specifying the selection mode.</summary> <value>Either the <see langword="One" /> or <see langword="None" /> value of <see cref="T:System.Windows.Forms.SelectionMode" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A> property determines whether one item in the list box can be selected or no items can be selected. For <xref:System.Windows.Forms.CheckedListBox> objects, multiple selection is not supported. You can set the mode to one item or no items. - - - -## Examples - The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A> to allow one item in the list to be selected. - - To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A> property determines whether one item in the list box can be selected or no items can be selected. For <xref:System.Windows.Forms.CheckedListBox> objects, multiple selection is not supported. You can set the mode to one item or no items. + + + +## Examples + The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A> to allow one item in the list to be selected. + + To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">An attempt was made to assign a value that is not a <see cref="T:System.Windows.Forms.SelectionMode" /> value of <see langword="One" /> or <see langword="None" />.</exception> @@ -1791,28 +1791,28 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <see langword="true" /> to set the item as checked; otherwise, <see langword="false" />.</param> <summary>Sets <see cref="T:System.Windows.Forms.CheckState" /> for the item at the specified index to <see langword="Checked" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a value of `true` is passed, this method sets the <xref:System.Windows.Forms.CheckState> value to `Checked`. A value of `false` sets <xref:System.Windows.Forms.CheckState> to `Unchecked`. - - - -## Examples - The following example enumerates the items in the <xref:System.Windows.Forms.CheckedListBox> and checks every other item in the list. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> and <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> methods to set the check state of an item. For every other item that is to be checked, <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> is called to set the <xref:System.Windows.Forms.CheckState> to `Indeterminate`, while <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> is called on the other item to set the checked state to `Checked`. - - The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to get the <xref:System.Windows.Forms.ListBox.ObjectCollection.Count%2A> of items. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a value of `true` is passed, this method sets the <xref:System.Windows.Forms.CheckState> value to `Checked`. A value of `false` sets <xref:System.Windows.Forms.CheckState> to `Unchecked`. + + + +## Examples + The following example enumerates the items in the <xref:System.Windows.Forms.CheckedListBox> and checks every other item in the list. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> and <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> methods to set the check state of an item. For every other item that is to be checked, <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> is called to set the <xref:System.Windows.Forms.CheckState> to `Indeterminate`, while <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> is called on the other item to set the checked state to `Checked`. + + The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to get the <xref:System.Windows.Forms.ListBox.ObjectCollection.Count%2A> of items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentException">The index specified is less than zero. - - -or- - + <exception cref="T:System.ArgumentException">The index specified is less than zero. + + -or- + The index is greater than the count of items in the list.</exception> </Docs> </Member> @@ -1848,30 +1848,30 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="value">One of the <see cref="T:System.Windows.Forms.CheckState" /> values.</param> <summary>Sets the check state of the item at the specified index.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> method raises the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. - - Items whose <xref:System.Windows.Forms.CheckState> is set to `Indeterminate` appear with a check mark in the check box, but the box is grayed to indicate the indeterminate status of the checked item. - - - -## Examples - The following example enumerates the items in the <xref:System.Windows.Forms.CheckedListBox> and checks every other item in the list. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> and <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> methods to set the check state of an item. For every other item that is to be checked, <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> is called to set the <xref:System.Windows.Forms.CheckState> to `Indeterminate`, while <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> is called on the other item to set the checked state to `Checked`. - - The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to get the <xref:System.Windows.Forms.ListBox.ObjectCollection.Count%2A> of items. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> method raises the <xref:System.Windows.Forms.CheckedListBox.ItemCheck> event. + + Items whose <xref:System.Windows.Forms.CheckState> is set to `Indeterminate` appear with a check mark in the check box, but the box is grayed to indicate the indeterminate status of the checked item. + + + +## Examples + The following example enumerates the items in the <xref:System.Windows.Forms.CheckedListBox> and checks every other item in the list. The example demonstrates using the <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> and <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> methods to set the check state of an item. For every other item that is to be checked, <xref:System.Windows.Forms.CheckedListBox.SetItemCheckState%2A> is called to set the <xref:System.Windows.Forms.CheckState> to `Indeterminate`, while <xref:System.Windows.Forms.CheckedListBox.SetItemChecked%2A> is called on the other item to set the checked state to `Checked`. + + The example also demonstrates using the <xref:System.Windows.Forms.CheckedListBox.Items%2A> property to get the <xref:System.Windows.Forms.CheckedListBox.ObjectCollection> to get the <xref:System.Windows.Forms.ListBox.ObjectCollection.Count%2A> of items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> specified is less than zero. - - -or- - + <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> specified is less than zero. + + -or- + The <paramref name="index" /> is greater than or equal to the count of items in the list.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The <paramref name="value" /> is not one of the <see cref="T:System.Windows.Forms.CheckState" /> values.</exception> <altmember cref="T:System.Windows.Forms.CheckState" /> @@ -1911,17 +1911,17 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <value> <see langword="true" /> if the check box has a flat appearance; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. - - To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates initializing a <xref:System.Windows.Forms.CheckedListBox> control by setting the <xref:System.Windows.Forms.CheckedListBox.CheckOnClick%2A>, <xref:System.Windows.Forms.CheckedListBox.SelectionMode%2A>, and <xref:System.Windows.Forms.CheckedListBox.ThreeDCheckBoxes%2A> properties. The example populates the <xref:System.Windows.Forms.CheckedListBox> with controls and sets the <xref:System.Windows.Forms.CheckedListBox.DisplayMember%2A> to the <xref:System.Windows.Forms.Control.Name%2A?displayProperty=nameWithType> property of the control. + + To run the example, paste the following code in a form containing a <xref:System.Windows.Forms.CheckedListBox> named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ButtonState" /> @@ -1960,13 +1960,13 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <value> <see langword="true" /> if the <see cref="T:System.Drawing.Graphics" /> class should be used to perform text rendering for compatibility with versions 1.0 and 1.1. of the .NET Framework; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `UseCompatibleTextRendering` property is intended to provide visual compatibility between Windows Forms controls that render text using the <xref:System.Windows.Forms.TextRenderer> class and .NET Framework 1.0 and .NET Framework 1.1 applications that perform custom text rendering using the <xref:System.Drawing.Graphics> class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. - - The GDI based <xref:System.Windows.Forms.TextRenderer> class was introduced in the .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of the .NET Framework, the GDI+ based <xref:System.Drawing.Graphics> class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the <xref:System.Drawing.Graphics> class to render text, this could cause the text for controls that use <xref:System.Windows.Forms.TextRenderer> to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true` for a specific control. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A?displayProperty=nameWithType> method with a parameter of `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `UseCompatibleTextRendering` property is intended to provide visual compatibility between Windows Forms controls that render text using the <xref:System.Windows.Forms.TextRenderer> class and .NET Framework 1.0 and .NET Framework 1.1 applications that perform custom text rendering using the <xref:System.Drawing.Graphics> class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. + + The GDI based <xref:System.Windows.Forms.TextRenderer> class was introduced in the .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of the .NET Framework, the GDI+ based <xref:System.Drawing.Graphics> class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the <xref:System.Drawing.Graphics> class to render text, this could cause the text for controls that use <xref:System.Windows.Forms.TextRenderer> to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true` for a specific control. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A?displayProperty=nameWithType> method with a parameter of `true`. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(System.Boolean)" /> @@ -2010,15 +2010,15 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <summary>Gets or sets a string that specifies the property of the data source from which to draw the value.</summary> <value>A string that specifies the property of the data source from which to draw the value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Specify the contents of the <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property in cases where you bind data. - - You can clear the <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property by setting the property to an empty string ("") or `null`. - - Setting a new <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property raises the <xref:System.Windows.Forms.CheckedListBox.ValueMemberChanged> and <xref:System.Windows.Forms.ListControl.SelectedValueChanged> events. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Specify the contents of the <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property in cases where you bind data. + + You can clear the <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property by setting the property to an empty string ("") or `null`. + + Setting a new <xref:System.Windows.Forms.CheckedListBox.ValueMember%2A> property raises the <xref:System.Windows.Forms.CheckedListBox.ValueMemberChanged> and <xref:System.Windows.Forms.ListControl.SelectedValueChanged> events. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The specified property cannot be found on the object specified by the <see cref="P:System.Windows.Forms.CheckedListBox.DataSource" /> property.</exception> @@ -2129,16 +2129,16 @@ The <xref:System.Windows.Forms.Control.CreateParams%2A> property should not be o <param name="m">The Windows <see cref="T:System.Windows.Forms.Message" /> to process.</param> <summary>Processes Windows messages.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples + <format type="text/markdown"><![CDATA[ + +## Examples + +The following code example demonstrates overriding the <xref:System.Windows.Forms.Control.WndProc%2A> method to handle operating system messages identified in the <xref:System.Windows.Forms.Message> structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at <https://learn.microsoft.com> to understand the available <xref:System.Windows.Forms.Message.Msg%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.Message.LParam%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.Message.WParam%2A?displayProperty=nameWithType> values. Actual constant values can be found in the Windows.h header file included in the Platform SDK (Core SDK section) download, which is also available at <https://learn.microsoft.com>. -The following code example demonstrates overriding the <xref:System.Windows.Forms.Control.WndProc%2A> method to handle operating system messages identified in the <xref:System.Windows.Forms.Message> structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at <https://learn.microsoft.com> to understand the available <xref:System.Windows.Forms.Message.Msg%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.Message.LParam%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.Message.WParam%2A?displayProperty=nameWithType> values. Actual constant values can be found in the Windows.h header file included in the Platform SDK (Core SDK section) download, which is also available at <https://learn.microsoft.com>. - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox/WndProc/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/Clipboard.xml b/xml/System.Windows.Forms/Clipboard.xml index 69bb3d691ca..3cd4ed3ba5c 100644 --- a/xml/System.Windows.Forms/Clipboard.xml +++ b/xml/System.Windows.Forms/Clipboard.xml @@ -34,48 +34,48 @@ <Docs> <summary>Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - For a list of predefined formats to use with the <xref:System.Windows.Forms.Clipboard> class, see the <xref:System.Windows.Forms.DataFormats> class. - - Call <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to put data on the Clipboard, replacing its current contents. To place a persistent copy of the data on the Clipboard, set the `copy` parameter to `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + For a list of predefined formats to use with the <xref:System.Windows.Forms.Clipboard> class, see the <xref:System.Windows.Forms.DataFormats> class. + + Call <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to put data on the Clipboard, replacing its current contents. To place a persistent copy of the data on the Clipboard, set the `copy` parameter to `true`. + > [!NOTE] -> To place data on the Clipboard in multiple formats, use the <xref:System.Windows.Forms.DataObject> class or an <xref:System.Windows.Forms.IDataObject> implementation. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. - - Call <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the Clipboard. The data is returned as an object that implements the <xref:System.Windows.Forms.IDataObject> interface. Use the methods specified by <xref:System.Windows.Forms.IDataObject> and fields in <xref:System.Windows.Forms.DataFormats> to extract the data from the object. If you do not know the format of the data you retrieved, call the <xref:System.Windows.Forms.IDataObject.GetFormats%2A> method of the <xref:System.Windows.Forms.IDataObject> interface to get a list of all formats that data is stored in. Then call the <xref:System.Windows.Forms.IDataObject.GetData%2A> method of the <xref:System.Windows.Forms.IDataObject> interface, and specify a format that your application can use. - - In .NET Framework 2.0, the <xref:System.Windows.Forms.Clipboard> class provides additional methods that make it easier to work with the system Clipboard. Call the <xref:System.Windows.Forms.Clipboard.Clear%2A> method to remove all data from the Clipboard. To add data of a particular format to the Clipboard, replacing the existing data, call the appropriate `Set`*Format* method, such as <xref:System.Windows.Forms.Clipboard.SetText%2A>, or call the <xref:System.Windows.Forms.Clipboard.SetData%2A> method to specify the format. To retrieve data of a particular format from the Clipboard, first call the appropriate `Contains`*Format* method (such as <xref:System.Windows.Forms.Clipboard.ContainsText%2A>) method to determine whether the Clipboard contains data in that format, and then call the appropriate `Get`*Format* method (such as <xref:System.Windows.Forms.Clipboard.GetText%2A>) to retrieve the data if the Clipboard contains it. To specify the format in these operations, call the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> and <xref:System.Windows.Forms.Clipboard.GetData%2A> methods instead. - +> To place data on the Clipboard in multiple formats, use the <xref:System.Windows.Forms.DataObject> class or an <xref:System.Windows.Forms.IDataObject> implementation. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. + + Call <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the Clipboard. The data is returned as an object that implements the <xref:System.Windows.Forms.IDataObject> interface. Use the methods specified by <xref:System.Windows.Forms.IDataObject> and fields in <xref:System.Windows.Forms.DataFormats> to extract the data from the object. If you do not know the format of the data you retrieved, call the <xref:System.Windows.Forms.IDataObject.GetFormats%2A> method of the <xref:System.Windows.Forms.IDataObject> interface to get a list of all formats that data is stored in. Then call the <xref:System.Windows.Forms.IDataObject.GetData%2A> method of the <xref:System.Windows.Forms.IDataObject> interface, and specify a format that your application can use. + + In .NET Framework 2.0, the <xref:System.Windows.Forms.Clipboard> class provides additional methods that make it easier to work with the system Clipboard. Call the <xref:System.Windows.Forms.Clipboard.Clear%2A> method to remove all data from the Clipboard. To add data of a particular format to the Clipboard, replacing the existing data, call the appropriate `Set`*Format* method, such as <xref:System.Windows.Forms.Clipboard.SetText%2A>, or call the <xref:System.Windows.Forms.Clipboard.SetData%2A> method to specify the format. To retrieve data of a particular format from the Clipboard, first call the appropriate `Contains`*Format* method (such as <xref:System.Windows.Forms.Clipboard.ContainsText%2A>) method to determine whether the Clipboard contains data in that format, and then call the appropriate `Get`*Format* method (such as <xref:System.Windows.Forms.Clipboard.GetText%2A>) to retrieve the data if the Clipboard contains it. To specify the format in these operations, call the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> and <xref:System.Windows.Forms.Clipboard.GetData%2A> methods instead. + > [!NOTE] -> All Windows-based applications share the system Clipboard, so the contents are subject to change when you switch to another application. -> -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to a Clipboard method, the method will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. If your target application requires a very specific data format, the headers added to the data in the serialization process may prevent the application from recognizing your data. To preserve your data format, add your data as a <xref:System.Byte> array to a <xref:System.IO.MemoryStream> and pass the <xref:System.IO.MemoryStream> to the <xref:System.Windows.Forms.DataObject.SetData%2A> method. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. -> +> All Windows-based applications share the system Clipboard, so the contents are subject to change when you switch to another application. +> +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to a Clipboard method, the method will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. If your target application requires a very specific data format, the headers added to the data in the serialization process may prevent the application from recognizing your data. To preserve your data format, add your data as a <xref:System.Byte> array to a <xref:System.IO.MemoryStream> and pass the <xref:System.IO.MemoryStream> to the <xref:System.Windows.Forms.DataObject.SetData%2A> method. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. +> > Special considerations may be necessary when using the metafile format with the Clipboard. Due to a limitation in the current implementation of the <xref:System.Windows.Forms.DataObject> class, the metafile format used by the .NET Framework may not be recognized by applications that use an older metafile format. In this case, you must interoperate with the Win32 Clipboard application programming interfaces (APIs). - - - -## Examples - The following code example uses <xref:System.Windows.Forms.Clipboard> methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on the form. - - The `button1_Click` method calls <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to take selected text from the text box and place it on the system Clipboard. - - The `button2_Click` method calls <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the system Clipboard. The code uses <xref:System.Windows.Forms.IDataObject> and <xref:System.Windows.Forms.DataFormats> to extract the data returned and displays the data in `textBox2`. - + + + +## Examples + The following code example uses <xref:System.Windows.Forms.Clipboard> methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on the form. + + The `button1_Click` method calls <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to take selected text from the text box and place it on the system Clipboard. + + The `button2_Click` method calls <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the system Clipboard. The code uses <xref:System.Windows.Forms.IDataObject> and <xref:System.Windows.Forms.DataFormats> to extract the data returned and displays the data in `textBox2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataObject" /> <altmember cref="T:System.Windows.Forms.DataFormats" /> <altmember cref="T:System.Windows.Forms.IDataObject" /> - <related type="Article" href="/dotnet/framework/winforms/additional-security-considerations-in-windows-forms">Additional Security Considerations in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/additional-security-considerations-in-windows-forms">Additional Security Considerations in Windows Forms</related> </Docs> <Members> <Member MemberName="Clear"> @@ -104,22 +104,22 @@ <Docs> <summary>Removes all data from the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Because the Clipboard is shared by multiple processes, calling this method may have an impact on those processes. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Because the Clipboard is shared by multiple processes, calling this method may have an impact on those processes. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -154,22 +154,22 @@ <returns> <see langword="true" /> if there is audio data on the Clipboard; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following code example demonstrates the use of this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -211,26 +211,26 @@ <returns> <see langword="true" /> if there is data on the Clipboard that is in the specified <paramref name="format" /> or can be converted to that format; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataFormats> class contains pre-defined format names that you can use with this method. - - Use this method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetData%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataFormats> class contains pre-defined format names that you can use with this method. + + Use this method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetData%2A> method. + > [!NOTE] -> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -268,24 +268,24 @@ <returns> <see langword="true" /> if there is a file drop list on the Clipboard; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A file drop list is a collection of strings containing path information for files. - - Use this method to determine whether the Clipboard contains a file drop list before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetFileDropList%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A file drop list is a collection of strings containing path information for files. + + Use this method to determine whether the Clipboard contains a file drop list before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetFileDropList%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -323,22 +323,22 @@ <returns> <see langword="true" /> if there is image data on the Clipboard; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to determine whether the Clipboard contains image data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetImage%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to determine whether the Clipboard contains image data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetImage%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -388,24 +388,24 @@ <returns> <see langword="true" /> if there is text data on the Clipboard; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method checks for the presence of data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method checks for the presence of data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. - - Use this method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method checks for the presence of data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method checks for the presence of data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. + + Use this method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method that is similar to this overload. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -448,22 +448,22 @@ <returns> <see langword="true" /> if there is text data on the Clipboard in the value specified for <paramref name="format" />; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -503,24 +503,24 @@ <summary>Retrieves an audio stream from the Clipboard.</summary> <returns>A <see cref="T:System.IO.Stream" /> containing audio data or <see langword="null" /> if the Clipboard does not contain any data in the <see cref="F:System.Windows.Forms.DataFormats.WaveAudio" /> format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with this method. - - Use the <xref:System.Windows.Forms.Clipboard.SetAudio%2A> method to add audio data to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with this method. + + Use the <xref:System.Windows.Forms.Clipboard.SetAudio%2A> method to add audio data to the Clipboard. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -568,28 +568,28 @@ <summary>Retrieves data from the Clipboard in the specified format.</summary> <returns>An <see cref="T:System.Object" /> representing the Clipboard data or <see langword="null" /> if the Clipboard does not contain any data that is in the specified <paramref name="format" /> or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with this method. - - If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with automatic conversion set to `false`, this method returns `null`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with this method. + + If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with automatic conversion set to `false`, this method returns `null`. + > [!NOTE] -> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - Use the <xref:System.Windows.Forms.Clipboard.SetData%2A> method to add data to the Clipboard in a particular format. - - - -## Examples - The following example demonstrates this member. - +> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + Use the <xref:System.Windows.Forms.Clipboard.SetData%2A> method to add data to the Clipboard in a particular format. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -629,29 +629,29 @@ <summary>Retrieves the data that is currently on the system Clipboard.</summary> <returns>An <see cref="T:System.Windows.Forms.IDataObject" /> that represents the data currently on the Clipboard, or <see langword="null" /> if there is no data on the Clipboard.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Because the data type of the object returned from the Clipboard can vary, this method returns the data in an <xref:System.Windows.Forms.IDataObject>. Then you can use methods of the <xref:System.Windows.Forms.IDataObject> interface to extract the data in its proper data type. - - This method attempts to get the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Because the data type of the object returned from the Clipboard can vary, this method returns the data in an <xref:System.Windows.Forms.IDataObject>. Then you can use methods of the <xref:System.Windows.Forms.IDataObject> interface to extract the data in its proper data type. + + This method attempts to get the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following code example uses <xref:System.Windows.Forms.Clipboard> methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been placed on the form. - - The `button1_Click` method calls <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to take selected text from the text box and place it on the system Clipboard. - - The `button2_Click` method calls <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the system Clipboard. The code uses <xref:System.Windows.Forms.IDataObject> and <xref:System.Windows.Forms.DataFormats> to extract the data returned. The data is displayed in `textBox2`. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following code example uses <xref:System.Windows.Forms.Clipboard> methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been placed on the form. + + The `button1_Click` method calls <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to take selected text from the text box and place it on the system Clipboard. + + The `button2_Click` method calls <xref:System.Windows.Forms.Clipboard.GetDataObject%2A> to retrieve data from the system Clipboard. The code uses <xref:System.Windows.Forms.IDataObject> and <xref:System.Windows.Forms.DataFormats> to extract the data returned. The data is displayed in `textBox2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">Data could not be retrieved from the Clipboard. This typically occurs when the Clipboard is being used by another process.</exception> @@ -689,28 +689,28 @@ <summary>Retrieves a collection of file names from the Clipboard.</summary> <returns>A <see cref="T:System.Collections.Specialized.StringCollection" /> containing file names or <see langword="null" /> if the Clipboard does not contain any data that is in the <see cref="F:System.Windows.Forms.DataFormats.FileDrop" /> format or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A file drop list is a collection of strings containing path information for files. - - A file drop list is stored on the Clipboard as a <xref:System.String> array. This method converts this array to a <xref:System.Collections.Specialized.StringCollection> and returns the collection. - - Use the <xref:System.Windows.Forms.Clipboard.ContainsFileDropList%2A> method to determine whether the Clipboard contains a file drop list before retrieving it with this method. - - Use the <xref:System.Windows.Forms.Clipboard.SetFileDropList%2A> method to add a file drop list to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A file drop list is a collection of strings containing path information for files. + + A file drop list is stored on the Clipboard as a <xref:System.String> array. This method converts this array to a <xref:System.Collections.Specialized.StringCollection> and returns the collection. + + Use the <xref:System.Windows.Forms.Clipboard.ContainsFileDropList%2A> method to determine whether the Clipboard contains a file drop list before retrieving it with this method. + + Use the <xref:System.Windows.Forms.Clipboard.SetFileDropList%2A> method to add a file drop list to the Clipboard. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -749,24 +749,24 @@ <summary>Retrieves an image from the Clipboard.</summary> <returns>An <see cref="T:System.Drawing.Image" /> representing the Clipboard image data or <see langword="null" /> if the Clipboard does not contain any data that is in the <see cref="F:System.Windows.Forms.DataFormats.Bitmap" /> format or can be converted to that format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Clipboard.ContainsImage%2A> method to determine whether the Clipboard contains image data before retrieving it with this method. - - Use the <xref:System.Windows.Forms.Clipboard.SetImage%2A> method to add image data to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Clipboard.ContainsImage%2A> method to determine whether the Clipboard contains image data before retrieving it with this method. + + Use the <xref:System.Windows.Forms.Clipboard.SetImage%2A> method to add image data to the Clipboard. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -816,26 +816,26 @@ <summary>Retrieves text data from the Clipboard in the <see cref="F:System.Windows.Forms.TextDataFormat.Text" /> or <see cref="F:System.Windows.Forms.TextDataFormat.UnicodeText" /> format, depending on the operating system.</summary> <returns>The Clipboard text data or <see cref="F:System.String.Empty" /> if the Clipboard does not contain data in the <see cref="F:System.Windows.Forms.TextDataFormat.Text" /> or <see cref="F:System.Windows.Forms.TextDataFormat.UnicodeText" /> format, depending on the operating system.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method returns text data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method returns text data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. - - Use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with this method. - - Use the <xref:System.Windows.Forms.Clipboard.SetText%2A> method to add text data to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method returns text data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method returns text data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. + + Use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with this method. + + Use the <xref:System.Windows.Forms.Clipboard.SetText%2A> method to add text data to the Clipboard. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.GetText%2A> method that is similar to this overload. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.GetText%2A> method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -875,24 +875,24 @@ <summary>Retrieves text data from the Clipboard in the format indicated by the specified <see cref="T:System.Windows.Forms.TextDataFormat" /> value.</summary> <returns>The Clipboard text data or <see cref="F:System.String.Empty" /> if the Clipboard does not contain data in the specified format.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with this method. - - Use the <xref:System.Windows.Forms.Clipboard.SetText%2A> method to add text data to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with this method. + + Use the <xref:System.Windows.Forms.Clipboard.SetText%2A> method to add text data to the Clipboard. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -945,22 +945,22 @@ <param name="audioBytes">A <see cref="T:System.Byte" /> array containing the audio data.</param> <summary>Clears the Clipboard and then adds a <see cref="T:System.Byte" /> array in the <see cref="F:System.Windows.Forms.DataFormats.WaveAudio" /> format after converting it to a <see cref="T:System.IO.Stream" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve audio data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve audio data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.SetAudio%2A> method that is similar to this overload. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.SetAudio%2A> method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1001,22 +1001,22 @@ <param name="audioStream">A <see cref="T:System.IO.Stream" /> containing the audio data.</param> <summary>Clears the Clipboard and then adds a <see cref="T:System.IO.Stream" /> in the <see cref="F:System.Windows.Forms.DataFormats.WaveAudio" /> format.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve audio data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve audio data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsAudio%2A> method to determine whether the Clipboard contains audio data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetAudioStream%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1059,26 +1059,26 @@ <param name="data">An <see cref="T:System.Object" /> representing the data to add.</param> <summary>Clears the Clipboard and then adds data in the specified format.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not know the format of the target application, you can store data in multiple formats using this method. - - Data stored using this method can be converted to a compatible format when it is retrieved. - - To retrieve data from the Clipboard in a particular format, first use the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> method to determine whether the Clipboard contains data in that format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetData%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not know the format of the target application, you can store data in multiple formats using this method. + + Data stored using this method can be converted to a compatible format when it is retrieved. + + To retrieve data from the Clipboard in a particular format, first use the <xref:System.Windows.Forms.Clipboard.ContainsData%2A> method to determine whether the Clipboard contains data in that format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetData%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1176,27 +1176,27 @@ <param name="data">The data to place on the Clipboard.</param> <summary>Clears the Clipboard and then places nonpersistent data on it.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Data will be deleted from system Clipboard when the application exits. - - This method attempts to set the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Data will be deleted from system Clipboard when the application exits. + + This method attempts to set the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. + > [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following code example uses <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to place nonpersistent text data onto the system Clipboard. In the `button1_Click` method, the selected text is copied from `textBox1` and pasted on the Clipboard. In the `button2_Click` method, the information is retrieved from the Clipboard and displayed in `textBox2`. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on a form. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following code example uses <xref:System.Windows.Forms.Clipboard.SetDataObject%2A> to place nonpersistent text data onto the system Clipboard. In the `button1_Click` method, the selected text is copied from `textBox1` and pasted on the Clipboard. In the `button2_Click` method, the information is retrieved from the Clipboard and displayed in `textBox2`. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1247,33 +1247,33 @@ <see langword="true" /> if you want data to remain on the Clipboard after this application exits; otherwise, <see langword="false" />.</param> <summary>Clears the Clipboard and then places data on it and specifies whether the data should remain after the application exits.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the `copy` parameter is `false`, the data will be deleted from system Clipboard when the application exits. - - This method attempts to set the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the `copy` parameter is `false`, the data will be deleted from system Clipboard when the application exits. + + This method attempts to set the data ten times in 100-millisecond intervals, and throws an <xref:System.Runtime.InteropServices.ExternalException> if all attempts are unsuccessful. + > [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following method is run in an application. It places a persistent copy of the selected text data in the text box on the system Clipboard. This code assumes `button1`, `textBox1`, and `textBox2` have been created and placed on a form. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following method is run in an application. It places a persistent copy of the selected text data in the text box on the system Clipboard. This code assumes `button1`, `textBox1`, and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/SetDataObject/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet1"::: - - In a different application, the following method retrieves the text from the system Clipboard and pastes the text into `textBox2`. This code assumes `button2` and `textBox2` have been created and placed on a form. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet1"::: + + In a different application, the following method retrieves the text from the system Clipboard and pastes the text into `textBox2`. This code assumes `button2` and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/SetDataObject/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1321,28 +1321,28 @@ <param name="retryDelay">The number of milliseconds to pause between attempts.</param> <summary>Clears the Clipboard and then attempts to place data on it the specified number of times and with the specified delay between attempts, optionally leaving the data on the Clipboard after the application exits.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Adding data to the Clipboard can occasionally fail if the Clipboard is busy with another thread or application. This method is useful to work around this issue in environments with heavy Clipboard use. - - If the `copy` parameter is `false`, the data will be deleted from system Clipboard when the application exits. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Adding data to the Clipboard can occasionally fail if the Clipboard is busy with another thread or application. This method is useful to work around this issue in environments with heavy Clipboard use. + + If the `copy` parameter is `false`, the data will be deleted from system Clipboard when the application exits. + > [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. -> -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See <xref:System.Runtime.Serialization> for more information on serialization. +> +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + ]]></format> </remarks> <exception cref="T:System.Threading.ThreadStateException">The current thread is not in single-threaded apartment (STA) mode. Add the <see cref="T:System.STAThreadAttribute" /> to your application's <see langword="Main" /> method.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="data" /> is <see langword="null" />.</exception> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="retryTimes" /> is less than zero. - - -or- - + <paramref name="retryTimes" /> is less than zero. + + -or- + <paramref name="retryDelay" /> is less than zero.</exception> <exception cref="T:System.Runtime.InteropServices.ExternalException">Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process.</exception> <altmember cref="T:System.Windows.Forms.DataObject" /> @@ -1380,26 +1380,26 @@ <param name="filePaths">A <see cref="T:System.Collections.Specialized.StringCollection" /> containing the file names.</param> <summary>Clears the Clipboard and then adds a collection of file names in the <see cref="F:System.Windows.Forms.DataFormats.FileDrop" /> format.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A file drop list is a collection of strings containing path information for files. - - A file drop list is stored on the Clipboard as a <xref:System.String> array. This method converts `filePaths` to a <xref:System.String> array before adding it to the Clipboard. - - To retrieve a file drop list from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsFileDropList%2A> method to determine whether the Clipboard contains data in that format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetFileDropList%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A file drop list is a collection of strings containing path information for files. + + A file drop list is stored on the Clipboard as a <xref:System.String> array. This method converts `filePaths` to a <xref:System.String> array before adding it to the Clipboard. + + To retrieve a file drop list from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsFileDropList%2A> method to determine whether the Clipboard contains data in that format before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetFileDropList%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1407,12 +1407,12 @@ <exception cref="T:System.ArgumentNullException"> <paramref name="filePaths" /> is <see langword="null" />.</exception> <exception cref="T:System.ArgumentException"> - <paramref name="filePaths" /> does not contain any strings. - - -or- - - At least one of the strings in <paramref name="filePaths" /> is <see cref="F:System.String.Empty" />, contains only white space, contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />, is <see langword="null" />, contains a colon (:), or exceeds the system-defined maximum length. - + <paramref name="filePaths" /> does not contain any strings. + + -or- + + At least one of the strings in <paramref name="filePaths" /> is <see cref="F:System.String.Empty" />, contains only white space, contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />, is <see langword="null" />, contains a colon (:), or exceeds the system-defined maximum length. + See the <see cref="P:System.Exception.InnerException" /> property of the <see cref="T:System.ArgumentException" /> for more information.</exception> <altmember cref="F:System.Windows.Forms.DataFormats.FileDrop" /> <altmember cref="M:System.Windows.Forms.Clipboard.ContainsFileDropList" /> @@ -1448,22 +1448,22 @@ <param name="image">The <see cref="T:System.Drawing.Image" /> to add to the Clipboard.</param> <summary>Clears the Clipboard and then adds an <see cref="T:System.Drawing.Image" /> in the <see cref="F:System.Windows.Forms.DataFormats.Bitmap" /> format.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve image data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsImage%2A> method to determine whether the Clipboard contains image data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetImage%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve image data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsImage%2A> method to determine whether the Clipboard contains image data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetImage%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1516,24 +1516,24 @@ <param name="text">The text to add to the Clipboard.</param> <summary>Clears the Clipboard and then adds text data in the <see cref="F:System.Windows.Forms.TextDataFormat.Text" /> or <see cref="F:System.Windows.Forms.TextDataFormat.UnicodeText" /> format, depending on the operating system.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method adds text data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method adds text data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. - - To retrieve text data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method adds text data in the <xref:System.Windows.Forms.TextDataFormat.UnicodeText> format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method adds text data in the <xref:System.Windows.Forms.TextDataFormat.Text> format. + + To retrieve text data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.SetText%2A> method that is similar to this overload. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates an overload of the <xref:System.Windows.Forms.Clipboard.SetText%2A> method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> @@ -1576,22 +1576,22 @@ <param name="format">One of the <see cref="T:System.Windows.Forms.TextDataFormat" /> values.</param> <summary>Clears the Clipboard and then adds text data in the format indicated by the specified <see cref="T:System.Windows.Forms.TextDataFormat" /> value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve text data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve text data from the Clipboard, first use the <xref:System.Windows.Forms.Clipboard.ContainsText%2A> method to determine whether the Clipboard contains text data before retrieving it with the <xref:System.Windows.Forms.Clipboard.GetText%2A> method. + > [!NOTE] -> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. - - - -## Examples - The following example demonstrates this member. - +> The <xref:System.Windows.Forms.Clipboard> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]></format> </remarks> <exception cref="T:System.Runtime.InteropServices.ExternalException">The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</exception> diff --git a/xml/System.Windows.Forms/ComboBoxRenderer.xml b/xml/System.Windows.Forms/ComboBoxRenderer.xml index 32671c32f15..91e2ad656ea 100644 --- a/xml/System.Windows.Forms/ComboBoxRenderer.xml +++ b/xml/System.Windows.Forms/ComboBoxRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a combo box control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%2A> and <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> methods to draw a combo box that responds to mouse clicks. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%2A> and <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> methods to draw a combo box that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -90,30 +90,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the drop-down arrow.</param> <summary>Draws a drop-down arrow with the current visual style of the operating system.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a drop-down arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a drop-down arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -159,21 +159,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box in the specified state and bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -228,21 +228,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box in the specified state and bounds, with the specified text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -299,30 +299,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box in the specified state and bounds, with the specified text and text bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.VisualStyles.ComboBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a text box. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.VisualStyles.ComboBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a text box. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -373,21 +373,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box in the specified state and bounds, with the specified text and text formatting.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -440,21 +440,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ComboBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box in the specified state and bounds, with the specified text, text formatting, and text bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -485,20 +485,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%2A> or <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> methods will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.ComboBoxRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the <xref:System.Windows.Forms.ComboBoxRenderer.DrawTextBox%2A> or <xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A> methods will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.ComboBoxRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ComboBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/ContainerControl.xml b/xml/System.Windows.Forms/ContainerControl.xml index 0a3e0938411..235b7915db7 100644 --- a/xml/System.Windows.Forms/ContainerControl.xml +++ b/xml/System.Windows.Forms/ContainerControl.xml @@ -42,18 +42,18 @@ <Docs> <summary>Provides focus-management functionality for controls that can function as a container for other controls.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A <xref:System.Windows.Forms.ContainerControl> represents a control that can function as a container for other controls and provides focus management. Controls that inherit from this class can track the active control they contain, even when the focus moves somewhere within a different container. - - <xref:System.Windows.Forms.ContainerControl> objects provide a logical boundary for contained controls. The container control can capture the TAB key press and move focus to the next control in the collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A <xref:System.Windows.Forms.ContainerControl> represents a control that can function as a container for other controls and provides focus management. Controls that inherit from this class can track the active control they contain, even when the focus moves somewhere within a different container. + + <xref:System.Windows.Forms.ContainerControl> objects provide a logical boundary for contained controls. The container control can capture the TAB key press and move focus to the next control in the collection. + > [!NOTE] -> The container control does not receive focus; the focus is always set to the first child control in the collection of contained controls. - - You do not typically inherit directly from the <xref:System.Windows.Forms.ContainerControl> class. <xref:System.Windows.Forms.Form>, <xref:System.Windows.Forms.UserControl>, and <xref:System.Windows.Forms.UpDownBase> classes inherit from <xref:System.Windows.Forms.ContainerControl>. - +> The container control does not receive focus; the focus is always set to the first child control in the collection of contained controls. + + You do not typically inherit directly from the <xref:System.Windows.Forms.ContainerControl> class. <xref:System.Windows.Forms.Form>, <xref:System.Windows.Forms.UserControl>, and <xref:System.Windows.Forms.UpDownBase> classes inherit from <xref:System.Windows.Forms.ContainerControl>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Form" /> @@ -86,15 +86,15 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ContainerControl" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example inherits from the <xref:System.Windows.Forms.ScrollableControl> class and implements the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example inherits from the <xref:System.Windows.Forms.ScrollableControl> class and implements the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -156,22 +156,22 @@ <summary>Gets or sets the active control on the container control.</summary> <value>The <see cref="T:System.Windows.Forms.Control" /> that is currently active on the <see cref="T:System.Windows.Forms.ContainerControl" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ContainerControl.ActiveControl%2A> property activates or retrieves the active control on the container control. - - In order to receive a valid value from this property, the object that calls it must either contain or be contained in the control it is calling. If one form tries to call another form's <xref:System.Windows.Forms.ContainerControl.ActiveControl%2A> properties, it will receive an undefined value. In this case, you need to define your own communication mechanism between the forms to pass this data. - - - -## Examples - The following code example inherits from the <xref:System.Windows.Forms.ScrollableControl> class and implements the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ContainerControl.ActiveControl%2A> property activates or retrieves the active control on the container control. + + In order to receive a valid value from this property, the object that calls it must either contain or be contained in the control it is calling. If one form tries to call another form's <xref:System.Windows.Forms.ContainerControl.ActiveControl%2A> properties, it will receive an undefined value. In this case, you need to define your own communication mechanism between the forms to pass this data. + + + +## Examples + The following code example inherits from the <xref:System.Windows.Forms.ScrollableControl> class and implements the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The <see cref="T:System.Windows.Forms.Control" /> assigned could not be activated.</exception> @@ -271,13 +271,13 @@ <summary>Gets or sets the dimensions that the control was designed to.</summary> <value>A <see cref="T:System.Drawing.SizeF" /> containing the dots per inch (DPI) or <see cref="T:System.Drawing.Font" /> size that the control was designed to.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The width or height of the <see cref="T:System.Drawing.SizeF" /> value is less than 0 when setting this value.</exception> @@ -313,13 +313,13 @@ <summary>Gets the scaling factor between the current and design-time automatic scaling dimensions.</summary> <value>A <see cref="T:System.Drawing.SizeF" /> containing the scaling ratio between the current and design-time scaling automatic scaling dimensions.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ContainerControl.AutoScaleMode" /> @@ -376,13 +376,13 @@ <summary>Gets or sets the automatic scaling mode of the control.</summary> <value>An <see cref="T:System.Windows.Forms.AutoScaleMode" /> that represents the current scaling mode. The default is <see cref="F:System.Windows.Forms.AutoScaleMode.None" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">An <see cref="T:System.Windows.Forms.AutoScaleMode" /> value that is not valid was used to set this property.</exception> @@ -432,21 +432,21 @@ <summary>Gets or sets a value that indicates whether controls in this container will be automatically validated when the focus changes.</summary> <value>An <see cref="T:System.Windows.Forms.AutoValidate" /> enumerated value that indicates whether contained controls are implicitly validated on focus change. The default is <see cref="F:System.Windows.Forms.AutoValidate.Inherit" />.</value> <remarks> - <format type="text/markdown"><. - - Setting this property to a new value will raise the <xref:System.Windows.Forms.ContainerControl.AutoValidateChanged> event. - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + <format type="text/markdown"><. + + Setting this property to a new value will raise the <xref:System.Windows.Forms.ContainerControl.AutoValidateChanged> event. + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">An <see cref="T:System.Windows.Forms.AutoValidate" /> value that is not valid was used to set this property.</exception> @@ -495,18 +495,18 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.ContainerControl.AutoValidate" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> - - <xref:System.Windows.Forms.ContainerControl.OnAutoValidateChanged%2A> - + <format type="text/markdown"><. + + + +## Examples + <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> + + <xref:System.Windows.Forms.ContainerControl.OnAutoValidateChanged%2A> + ]]></format> </remarks> </Docs> @@ -579,13 +579,13 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - In the .NET Framework 2.0 and later, IME functionality is handled by the framework and native IME support for individual controls is disabled. - - A user control that derives from the <xref:System.Windows.Forms.ContainerControl> class can enable native IME support by overriding this property to return `true`. However, the application is then responsible for making sure that there are no conflicts between the native IME and the Windows Forms IME. This scenario is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + In the .NET Framework 2.0 and later, IME functionality is handled by the framework and native IME support for individual controls is disabled. + + A user control that derives from the <xref:System.Windows.Forms.ContainerControl> class can enable native IME support by overriding this property to return `true`. However, the application is then responsible for making sure that there are no conflicts between the native IME and the Windows Forms IME. This scenario is not supported. + ]]></format> </remarks> </Docs> @@ -655,21 +655,21 @@ <summary>Gets the current run-time dimensions of the screen.</summary> <value>A <see cref="T:System.Drawing.SizeF" /> containing the current dots per inch (DPI) or <see cref="T:System.Drawing.Font" /> size of the screen.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.Win32Exception">A Win32 device context could not be created for the current screen.</exception> @@ -742,13 +742,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ContainerControl.AutoValidateChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ContainerControl.OnAutoValidateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ContainerControl.OnAutoValidateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -825,15 +825,15 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ContainerControl.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ContainerControl.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1007,19 +1007,19 @@ <summary>Gets the form that the container control is assigned to.</summary> <value>The <see cref="T:System.Windows.Forms.Form" /> that the container control is assigned to. This property will return null if the control is hosted inside of Internet Explorer or in another hosting context where there is no parent form.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example shows how to create two forms: `Form1` and `Form2`. Set the <xref:System.Windows.Forms.Form.IsMdiContainer%2A> property of `Form1` to `true` and make it the <xref:System.Windows.Forms.Form.MdiParent%2A> of `Form2`. Next, create a button, `button1`, on each form. When the button on the parent form is clicked, the event handler displays the child form. When the button on the child form is clicked, the event handler displays the <xref:System.Windows.Forms.Control.Name%2A> property of its parent form. Use the following two code segments to overwrite `button1` event handlers in both forms. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example shows how to create two forms: `Form1` and `Form2`. Set the <xref:System.Windows.Forms.Form.IsMdiContainer%2A> property of `Form1` to `true` and make it the <xref:System.Windows.Forms.Form.MdiParent%2A> of `Form2`. Next, create a button, `button1`, on each form. When the button on the parent form is clicked, the event handler displays the child form. When the button on the child form is clicked, the event handler displays the <xref:System.Windows.Forms.Control.Name%2A> property of its parent form. Use the following two code segments to overwrite `button1` event handlers in both forms. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ParentForm2/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ParentForm/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form1.vb" id="Snippet1"::: + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ParentForm2/CPP/form2.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ParentForm/form2.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form2.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form2.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Form" /> @@ -1057,15 +1057,15 @@ <Docs> <summary>Performs scaling of the container control and its children.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Form.AutoScale" /> @@ -1258,11 +1258,11 @@ <returns> <see langword="true" /> if a control is selected; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A control with its <xref:System.Windows.Forms.Control.TabStop%2A> property set to `false` cannot be selected, so the next available control will be selected. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A control with its <xref:System.Windows.Forms.Control.TabStop%2A> property set to `false` cannot be selected, so the next available control will be selected. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.TabStop" /> @@ -1401,20 +1401,20 @@ <returns> <see langword="true" /> if the control is successfully activated; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `control` parameter must be a child of the container control. - - - -## Examples - The following code example demonstrates how to inherit from the <xref:System.Windows.Forms.ScrollableControl> class and implement the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `control` parameter must be a child of the container control. + + + +## Examples + The following code example demonstrates how to inherit from the <xref:System.Windows.Forms.ScrollableControl> class and implement the <xref:System.Windows.Forms.IContainerControl> interface. Implementation is added to the <xref:System.Windows.Forms.IContainerControl.ActiveControl%2A> property and the <xref:System.Windows.Forms.IContainerControl.ActivateControl%2A> method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ContainerControl.ActiveControl" /> @@ -1447,11 +1447,11 @@ <Docs> <summary>When overridden by a derived class, updates which button is the default button.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ContainerControl> class does not provide an implementation for the <xref:System.Windows.Forms.ContainerControl.UpdateDefaultButton%2A> method. Classes that inherit this method must implement <xref:System.Windows.Forms.ContainerControl.UpdateDefaultButton%2A> to update the default button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ContainerControl> class does not provide an implementation for the <xref:System.Windows.Forms.ContainerControl.UpdateDefaultButton%2A> method. Classes that inherit this method must implement <xref:System.Windows.Forms.ContainerControl.UpdateDefaultButton%2A> to update the default button. + ]]></format> </remarks> </Docs> @@ -1500,11 +1500,11 @@ <returns> <see langword="true" /> if validation is successful; otherwise, <see langword="false" />. If called from the <see cref="E:System.Windows.Forms.Control.Validating" /> or <see cref="E:System.Windows.Forms.Control.Validated" /> event handlers, this method will always return <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ContainerControl.Validate%2A> method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version always performs validation, regardless of the value of the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control's parent. Therefore use it to unconditionally force validation. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ContainerControl.Validate%2A> method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version always performs validation, regardless of the value of the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control's parent. Therefore use it to unconditionally force validation. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ContainerControl.ValidateChildren" /> @@ -1543,15 +1543,15 @@ <returns> <see langword="true" /> if validation is successful; otherwise, <see langword="false" />. If called from the <see cref="E:System.Windows.Forms.Control.Validating" /> or <see cref="E:System.Windows.Forms.Control.Validated" /> event handlers, this method will always return <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ContainerControl.Validate%2A> method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version performs validation based on the following conditions: - -- If the `checkAutoValidate` parameter is `true`, validation always occurs for child controls that are not validated. - -- If the `checkAutoValidate` parameter is `false`, validation occurs only if the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control's parent is enabled. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ContainerControl.Validate%2A> method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version performs validation based on the following conditions: + +- If the `checkAutoValidate` parameter is `true`, validation always occurs for child controls that are not validated. + +- If the `checkAutoValidate` parameter is `false`, validation occurs only if the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control's parent is enabled. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ContainerControl.AutoValidate" /> @@ -1611,23 +1611,23 @@ <returns> <see langword="true" /> if all of the children validated successfully; otherwise, <see langword="false" />. If called from the <see cref="E:System.Windows.Forms.Control.Validating" /> or <see cref="E:System.Windows.Forms.Control.Validated" /> event handlers, this method will always return <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will descend a control's hierarchy and examine each control to see if it supports validation. If the control can be selected by the user and its <xref:System.Windows.Forms.Control.CausesValidation%2A> property is `true`, <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will cause the <xref:System.Windows.Forms.Control.Validating> event to occur. If any of the controls cancel the <xref:System.Windows.Forms.Control.Validating> event, this method will return `false`; otherwise, it will return `true`. - - If a control is bound to a data source, and the <xref:System.Windows.Forms.Control.Validating> event occurs, it will cause the control to push its current data back to the data source. - - Calling <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> is equivalent to calling <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> with a <xref:System.Windows.Forms.ValidationConstraints> of <xref:System.Windows.Forms.ValidationConstraints.None>. - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will descend a control's hierarchy and examine each control to see if it supports validation. If the control can be selected by the user and its <xref:System.Windows.Forms.Control.CausesValidation%2A> property is `true`, <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will cause the <xref:System.Windows.Forms.Control.Validating> event to occur. If any of the controls cancel the <xref:System.Windows.Forms.Control.Validating> event, this method will return `false`; otherwise, it will return `true`. + + If a control is bound to a data source, and the <xref:System.Windows.Forms.Control.Validating> event occurs, it will cause the control to push its current data back to the data source. + + Calling <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> is equivalent to calling <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> with a <xref:System.Windows.Forms.ValidationConstraints> of <xref:System.Windows.Forms.ValidationConstraints.None>. + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1673,27 +1673,27 @@ <returns> <see langword="true" /> if all of the children validated successfully; otherwise, <see langword="false" />. If called from the <see cref="E:System.Windows.Forms.Control.Validating" /> or <see cref="E:System.Windows.Forms.Control.Validated" /> event handlers, this method will always return <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will examine all the children of the current control, causing the <xref:System.Windows.Forms.Control.Validating> event to occur on a control if it meets the criteria spelled out by <xref:System.Windows.Forms.ValidationConstraints>. - - You may use several <xref:System.Windows.Forms.ValidationConstraints> parameters at once by combining them with a bitwise OR operator. Combining parameters with a bitwise OR operator will result in a logical AND operation. For example, calling `ValidateChildren(ValidationConstraints.ImmediateChildren | ValidationConstraints.Enabled)` will only raise the <xref:System.Windows.Forms.Control.Validating> event on controls that are both immediate children of the container AND are enabled. - - Regardless of which parameters you specify for this method, a control must have its <xref:System.Windows.Forms.Control.CausesValidation%2A> property set to `true` in order for its <xref:System.Windows.Forms.Control.Validating> event to occur. You should also set the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control or of the control's container to `false` if you want validation to happen only when you call <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A>, and not when the user shifts focus from the control. - - If a control is bound to a data source, and the <xref:System.Windows.Forms.Control.Validating> event occurs, it will cause the control to push its current data back to the data source. - - You cannot achieve the opposite effect of a <xref:System.Windows.Forms.ValidationConstraints> parameter by applying a bitwise negation operator. For example, if you supply the negative value of the <xref:System.Windows.Forms.ValidationConstraints.Visible> field to <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A>, it will not validate all children that are not visible on the container. Supplying any negative parameter to <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will have no effect on the container or its children. - - - -## Examples - The following code example will only cause the <xref:System.Windows.Forms.Control.Validating> event to occur for immediate children of the form whose <xref:System.Windows.Forms.Control.Enabled%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will examine all the children of the current control, causing the <xref:System.Windows.Forms.Control.Validating> event to occur on a control if it meets the criteria spelled out by <xref:System.Windows.Forms.ValidationConstraints>. + + You may use several <xref:System.Windows.Forms.ValidationConstraints> parameters at once by combining them with a bitwise OR operator. Combining parameters with a bitwise OR operator will result in a logical AND operation. For example, calling `ValidateChildren(ValidationConstraints.ImmediateChildren | ValidationConstraints.Enabled)` will only raise the <xref:System.Windows.Forms.Control.Validating> event on controls that are both immediate children of the container AND are enabled. + + Regardless of which parameters you specify for this method, a control must have its <xref:System.Windows.Forms.Control.CausesValidation%2A> property set to `true` in order for its <xref:System.Windows.Forms.Control.Validating> event to occur. You should also set the <xref:System.Windows.Forms.ContainerControl.AutoValidate%2A> property of the control or of the control's container to `false` if you want validation to happen only when you call <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A>, and not when the user shifts focus from the control. + + If a control is bound to a data source, and the <xref:System.Windows.Forms.Control.Validating> event occurs, it will cause the control to push its current data back to the data source. + + You cannot achieve the opposite effect of a <xref:System.Windows.Forms.ValidationConstraints> parameter by applying a bitwise negation operator. For example, if you supply the negative value of the <xref:System.Windows.Forms.ValidationConstraints.Visible> field to <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A>, it will not validate all children that are not visible on the container. Supplying any negative parameter to <xref:System.Windows.Forms.ContainerControl.ValidateChildren%2A> will have no effect on the container or its children. + + + +## Examples + The following code example will only cause the <xref:System.Windows.Forms.Control.Validating> event to occur for immediate children of the form whose <xref:System.Windows.Forms.Control.Enabled%2A> property is `true`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ValidateChildren/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildrenWithConstraints/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildrenWithConstraints/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ContextMenuStrip.xml b/xml/System.Windows.Forms/ContextMenuStrip.xml index 652d1d9b1bb..35b6e395bd8 100644 --- a/xml/System.Windows.Forms/ContextMenuStrip.xml +++ b/xml/System.Windows.Forms/ContextMenuStrip.xml @@ -78,7 +78,7 @@ <altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin" /> <altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin" /> <altmember cref="P:System.Windows.Forms.Control.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/contextmenustrip-control">ContextMenuStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/contextmenustrip-control">ContextMenuStrip Control</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/Control.xml b/xml/System.Windows.Forms/Control.xml index 76b850351fd..0f84babdd1b 100644 --- a/xml/System.Windows.Forms/Control.xml +++ b/xml/System.Windows.Forms/Control.xml @@ -108,7 +108,7 @@ <format type="text/markdown"><. + To create your own control class, inherit from the <xref:System.Windows.Forms.UserControl>, <xref:System.Windows.Forms.Control> classes, or from the other Windows Forms provided controls. For more information about authoring custom controls, see [Developing Custom Windows Forms Controls with the .NET Framework](/dotnet/desktop/winforms/controls/developing-custom-windows-forms-controls). The <xref:System.Windows.Forms.Control> class implements very basic functionality required by classes that display information to the user. It handles user input through the keyboard and pointing devices. It handles message routing and security. It defines the bounds of a control (its position and size), although it does not implement painting. It provides a window handle (`hWnd`). @@ -129,7 +129,7 @@ To identify Windows Forms controls from a separate process, use a standard `SendMessage` call to pass the WM_GETCONTROLNAME message. WM_GETCONTROLNAME is independent of the language and Windows hierarchy. For more information, see the "Recommended Solution for Windows Forms" topic in [Automating Windows Forms](https://learn.microsoft.com/previous-versions/dotnet/articles/ms996405(v=msdn.10)). - Use the <xref:System.Windows.Forms.Control.InvokeRequired%2A> property to synchronize access to the control from multiple threads. For more information about multithreaded Windows Forms controls, see [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). + Use the <xref:System.Windows.Forms.Control.InvokeRequired%2A> property to synchronize access to the control from multiple threads. For more information about multithreaded Windows Forms controls, see [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/desktop/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). ]]></format> </remarks> @@ -2625,7 +2625,7 @@ The following table lists Windows Forms controls and which event (<xref:System.W Because client coordinates are relative to the upper-left corner of the client area of the control, the coordinates of the upper-left corner of the rectangle returned by this property are (0,0). You can use this property to obtain the size and coordinates of the client area of the control for tasks such as drawing on the surface of the control. - For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/framework/winforms/controls/rendering-a-windows-forms-control). + For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/desktop/winforms/controls/rendering-a-windows-forms-control). @@ -2694,10 +2694,10 @@ The following table lists Windows Forms controls and which event (<xref:System.W The <xref:System.Drawing.Size.Width%2A?displayProperty=nameWithType> and <xref:System.Drawing.Size.Height%2A?displayProperty=nameWithType> properties represent the width and height of the client area of the control. You can use this property to obtain the size of the client area of the control for tasks such as drawing on the surface of the control. - For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/framework/winforms/controls/rendering-a-windows-forms-control). + For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/desktop/winforms/controls/rendering-a-windows-forms-control). > [!NOTE] -> You cannot bind application settings to this property. For more information on application settings, see [Application Settings Overview](/dotnet/framework/winforms/advanced/application-settings-overview). +> You cannot bind application settings to this property. For more information on application settings, see [Application Settings Overview](/dotnet/desktop/winforms/advanced/application-settings-overview). @@ -9026,7 +9026,7 @@ MyControl.Font = New Font(MyControl.Font, _ > [!NOTE] > An exception might be thrown if the thread that should process the message is no longer active. - For more information about multithreaded Windows Forms controls, see [How to: Use a Background Thread to Search for Files](/dotnet/framework/winforms/controls/how-to-use-a-background-thread-to-search-for-files) and [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). + For more information about multithreaded Windows Forms controls, see [How to: Use a Background Thread to Search for Files](/dotnet/desktop/winforms/controls/how-to-use-a-background-thread-to-search-for-files) and [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/desktop/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). ]]></format> </remarks> @@ -16126,7 +16126,7 @@ MyControl.Font = New Font(MyControl.Font, _ ## Remarks The <xref:System.Windows.Forms.Control.Paint> event is raised when the control is redrawn. It passes an instance of <xref:System.Windows.Forms.PaintEventArgs> to the method(s) that handles the <xref:System.Windows.Forms.Control.Paint> event. - When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the <xref:System.Windows.Forms.Control.OnPaint%2A> method. For more information, see [Overriding the OnPaint Method](/dotnet/framework/winforms/controls/overriding-the-onpaint-method) and [Custom Control Painting and Rendering](/dotnet/framework/winforms/controls/custom-control-painting-and-rendering). + When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the <xref:System.Windows.Forms.Control.OnPaint%2A> method. For more information, see [Overriding the OnPaint Method](/dotnet/desktop/winforms/controls/overriding-the-onpaint-method) and [Custom Control Painting and Rendering](/dotnet/desktop/winforms/controls/custom-control-painting-and-rendering). For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -19968,7 +19968,7 @@ The following code example selects the specified <xref:System.Windows.Forms.Cont <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.Control.SetClientSizeCore(System.Int32,System.Int32)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.Control.SetClientSizeCore(System.Int32,System.Int32)" /> method so that the <see cref="P:System.Windows.Forms.Control.ClientSize" /> property is adjusted. - For more information about drawing on controls, see <see href="/dotnet/framework/winforms/controls/rendering-a-windows-forms-control">Rendering a Windows Forms Control</see>.</para> + For more information about drawing on controls, see <see href="/dotnet/desktop/winforms/controls/rendering-a-windows-forms-control">Rendering a Windows Forms Control</see>.</para> </block> <altmember cref="P:System.Windows.Forms.Control.ClientSize" /> </Docs> diff --git a/xml/System.Windows.Forms/DataGrid.xml b/xml/System.Windows.Forms/DataGrid.xml index adf9e2eb6ce..de02c14693b 100644 --- a/xml/System.Windows.Forms/DataGrid.xml +++ b/xml/System.Windows.Forms/DataGrid.xml @@ -71,115 +71,115 @@ </Attributes> <Docs> <summary>Displays ADO.NET data in a scrollable grid. - + This class is not available in .NET Core 3.1 and later versions. Use the <see cref="T:System.Windows.Forms.DataGridView" /> control instead, which replaces and extends the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary> <remarks> - <format type="text/markdown"><. - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AllowNew%2A> property to `false`. - - Data sources are further managed by <xref:System.Windows.Forms.BindingManagerBase> objects. For each table in a data source, a <xref:System.Windows.Forms.BindingManagerBase> can be returned from the form's <xref:System.Windows.Forms.BindingContext>. For example, you can determine the number of rows contained by a data source by returning the associated <xref:System.Windows.Forms.BindingManagerBase> object's <xref:System.Windows.Forms.BindingManagerBase.Count%2A> property. - - To validate data, use the underlying objects that represent data and their events. For example, if the data comes from a <xref:System.Data.DataTable> in a <xref:System.Data.DataSet>, use the <xref:System.Data.DataTable.ColumnChanging> and <xref:System.Data.DataTable.RowChanging> events. - + The <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> displays Web-like links to child tables. You can click on a link to navigate to the child table. When a child table is displayed, a back button appears in the caption that can be clicked to navigate back to the parent table. The data from the parent rows is displayed below the caption and above the column headers. You can hide the parent row information by clicking the button to the right of the back button. + + To display a table in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> at run time, use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties to a valid data source. The following data sources are valid: + +- A <xref:System.Data.DataTable> + +- A <xref:System.Data.DataView> + +- A <xref:System.Data.DataSet> + +- A <xref:System.Data.DataViewManager> + +- A single dimension array + +- Any component that implements the <xref:System.ComponentModel.IListSource> interface + +- Any component that implements the <xref:System.Collections.IList> interface + + For more information about the <xref:System.Data.DataSet> class, see [DataSets, DataTables, and DataViews](/dotnet/framework/data/adonet/dataset-datatable-dataview/). + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AllowNew%2A> property to `false`. + + Data sources are further managed by <xref:System.Windows.Forms.BindingManagerBase> objects. For each table in a data source, a <xref:System.Windows.Forms.BindingManagerBase> can be returned from the form's <xref:System.Windows.Forms.BindingContext>. For example, you can determine the number of rows contained by a data source by returning the associated <xref:System.Windows.Forms.BindingManagerBase> object's <xref:System.Windows.Forms.BindingManagerBase.Count%2A> property. + + To validate data, use the underlying objects that represent data and their events. For example, if the data comes from a <xref:System.Data.DataTable> in a <xref:System.Data.DataSet>, use the <xref:System.Data.DataTable.ColumnChanging> and <xref:System.Data.DataTable.RowChanging> events. + > [!NOTE] -> Because the number of columns can be customized (by adding or deleting members of the <xref:System.Windows.Forms.GridColumnStylesCollection>) and the rows can be sorted by column, the <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> property values cannot be guaranteed to correspond to <xref:System.Data.DataRow> and <xref:System.Data.DataColumn> indexes in a <xref:System.Data.DataTable>. Therefore you should avoid using those properties in the <xref:System.Windows.Forms.Control.Validating> event to validate data. - - To determine which cell is selected, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property. Change the value of any cell by using the <xref:System.Windows.Forms.DataGrid.Item%2A> property, which can take either the row and column indexes of the cell, or a single <xref:System.Windows.Forms.DataGridCell>. Monitor the <xref:System.Windows.Forms.DataGrid.CurrentCellChanged> event to detect when the user selects another cell. - - To determine which part of the control the user clicked, use the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in the <xref:System.Windows.Forms.Control.MouseDown> event. The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method returns a <xref:System.Windows.Forms.DataGrid.HitTestInfo> object, which contains the row and column of a clicked area. - - To manage the appearance of the control at run time, several properties for setting the color and caption attributes are available, including the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionFont%2A>, and so on. - - The appearance of the displayed grid (or grids) can be further modified by creating <xref:System.Windows.Forms.DataGridTableStyle> objects and adding them to the <xref:System.Windows.Forms.GridTableStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> containing three <xref:System.Data.DataTable> objects, you can add three <xref:System.Windows.Forms.DataGridTableStyle> objects to the collection, one for each table. To synchronize each <xref:System.Windows.Forms.DataGridTableStyle> object with a <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. For more information about binding to an array of objects, see the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property. - - To create a customized view of a table, create an instance of a <xref:System.Windows.Forms.DataGridTextBoxColumn> or <xref:System.Windows.Forms.DataGridBoolColumn> class and add the object to the <xref:System.Windows.Forms.GridTableStylesCollection> accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. Both classes inherit from <xref:System.Windows.Forms.DataGridColumnStyle>. For each column style, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a column that you want to show in the grid. To hide a column, set its <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to something other than a valid <xref:System.Data.DataColumn.ColumnName%2A>. - - To format the text of a column, set the <xref:System.Windows.Forms.DataGridTextBoxColumn.Format%2A> property of the <xref:System.Windows.Forms.DataGridTextBoxColumn> to one of the values found in [Formatting Types](/dotnet/standard/base-types/formatting-types) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). - - To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename[]` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example. - - You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name). - - For each <xref:System.Windows.Forms.DataGridTableStyle>, you can set color and caption attributes that override the settings for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. However, if those properties are not set, the settings for the control are used by default. The following properties can be overridden by <xref:System.Windows.Forms.DataGridTableStyle> properties: - -- <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.AlternatingBackColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.BackColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisible%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.ForeColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.GridLineColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.GridLineStyle%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.HeaderBackColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.HeaderFont%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.HeaderForeColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.LinkColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.PreferredColumnWidth%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.PreferredRowHeight%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.ReadOnly%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.RowHeadersVisible%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.RowHeaderWidth%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.SelectionBackColor%2A> - -- <xref:System.Windows.Forms.DataGridTableStyle.SelectionForeColor%2A> - - To customize the appearance of individual columns, add <xref:System.Windows.Forms.DataGridColumnStyle> objects to the <xref:System.Windows.Forms.GridColumnStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property of each <xref:System.Windows.Forms.DataGridTableStyle>. To synchronize each <xref:System.Windows.Forms.DataGridColumnStyle> with a <xref:System.Data.DataColumn> in the <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a <xref:System.Data.DataColumn>. When constructing a <xref:System.Windows.Forms.DataGridColumnStyle>, you can also set a formatting string that specifies how the column displays data. For example, you can specify that the column use a short-date format to display dates contained in the table. - +> Because the number of columns can be customized (by adding or deleting members of the <xref:System.Windows.Forms.GridColumnStylesCollection>) and the rows can be sorted by column, the <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> property values cannot be guaranteed to correspond to <xref:System.Data.DataRow> and <xref:System.Data.DataColumn> indexes in a <xref:System.Data.DataTable>. Therefore you should avoid using those properties in the <xref:System.Windows.Forms.Control.Validating> event to validate data. + + To determine which cell is selected, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property. Change the value of any cell by using the <xref:System.Windows.Forms.DataGrid.Item%2A> property, which can take either the row and column indexes of the cell, or a single <xref:System.Windows.Forms.DataGridCell>. Monitor the <xref:System.Windows.Forms.DataGrid.CurrentCellChanged> event to detect when the user selects another cell. + + To determine which part of the control the user clicked, use the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in the <xref:System.Windows.Forms.Control.MouseDown> event. The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method returns a <xref:System.Windows.Forms.DataGrid.HitTestInfo> object, which contains the row and column of a clicked area. + + To manage the appearance of the control at run time, several properties for setting the color and caption attributes are available, including the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A>, <xref:System.Windows.Forms.DataGrid.CaptionFont%2A>, and so on. + + The appearance of the displayed grid (or grids) can be further modified by creating <xref:System.Windows.Forms.DataGridTableStyle> objects and adding them to the <xref:System.Windows.Forms.GridTableStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> containing three <xref:System.Data.DataTable> objects, you can add three <xref:System.Windows.Forms.DataGridTableStyle> objects to the collection, one for each table. To synchronize each <xref:System.Windows.Forms.DataGridTableStyle> object with a <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. For more information about binding to an array of objects, see the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property. + + To create a customized view of a table, create an instance of a <xref:System.Windows.Forms.DataGridTextBoxColumn> or <xref:System.Windows.Forms.DataGridBoolColumn> class and add the object to the <xref:System.Windows.Forms.GridTableStylesCollection> accessed through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. Both classes inherit from <xref:System.Windows.Forms.DataGridColumnStyle>. For each column style, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a column that you want to show in the grid. To hide a column, set its <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to something other than a valid <xref:System.Data.DataColumn.ColumnName%2A>. + + To format the text of a column, set the <xref:System.Windows.Forms.DataGridTextBoxColumn.Format%2A> property of the <xref:System.Windows.Forms.DataGridTextBoxColumn> to one of the values found in [Formatting Types](/dotnet/standard/base-types/formatting-types) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). + + To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename[]` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example. + + You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name). + + For each <xref:System.Windows.Forms.DataGridTableStyle>, you can set color and caption attributes that override the settings for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. However, if those properties are not set, the settings for the control are used by default. The following properties can be overridden by <xref:System.Windows.Forms.DataGridTableStyle> properties: + +- <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.AlternatingBackColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.BackColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.ColumnHeadersVisible%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.ForeColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.GridLineColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.GridLineStyle%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.HeaderBackColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.HeaderFont%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.HeaderForeColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.LinkColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.PreferredColumnWidth%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.PreferredRowHeight%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.ReadOnly%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.RowHeadersVisible%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.RowHeaderWidth%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.SelectionBackColor%2A> + +- <xref:System.Windows.Forms.DataGridTableStyle.SelectionForeColor%2A> + + To customize the appearance of individual columns, add <xref:System.Windows.Forms.DataGridColumnStyle> objects to the <xref:System.Windows.Forms.GridColumnStylesCollection>, which is accessed through the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property of each <xref:System.Windows.Forms.DataGridTableStyle>. To synchronize each <xref:System.Windows.Forms.DataGridColumnStyle> with a <xref:System.Data.DataColumn> in the <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> to the <xref:System.Data.DataColumn.ColumnName%2A> of a <xref:System.Data.DataColumn>. When constructing a <xref:System.Windows.Forms.DataGridColumnStyle>, you can also set a formatting string that specifies how the column displays data. For example, you can specify that the column use a short-date format to display dates contained in the table. + > [!CAUTION] -> Always create <xref:System.Windows.Forms.DataGridColumnStyle> objects and add them to the <xref:System.Windows.Forms.GridColumnStylesCollection> before adding <xref:System.Windows.Forms.DataGridTableStyle> objects to the <xref:System.Windows.Forms.GridTableStylesCollection>. When you add an empty <xref:System.Windows.Forms.DataGridTableStyle> with a valid <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> value to the collection, <xref:System.Windows.Forms.DataGridColumnStyle> objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new <xref:System.Windows.Forms.DataGridColumnStyle> objects with duplicate <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> values to the <xref:System.Windows.Forms.GridColumnStylesCollection>. - +> Always create <xref:System.Windows.Forms.DataGridColumnStyle> objects and add them to the <xref:System.Windows.Forms.GridColumnStylesCollection> before adding <xref:System.Windows.Forms.DataGridTableStyle> objects to the <xref:System.Windows.Forms.GridTableStylesCollection>. When you add an empty <xref:System.Windows.Forms.DataGridTableStyle> with a valid <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> value to the collection, <xref:System.Windows.Forms.DataGridColumnStyle> objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new <xref:System.Windows.Forms.DataGridColumnStyle> objects with duplicate <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> values to the <xref:System.Windows.Forms.GridColumnStylesCollection>. + > [!NOTE] -> The <xref:System.Windows.Forms.DataGridView> control replaces and adds functionality to the <xref:System.Windows.Forms.DataGrid> control; however, the <xref:System.Windows.Forms.DataGrid> control is retained for both backward compatibility and future use, if you choose. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid Controls](/dotnet/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). - - - -## Examples - The following code example creates a Windows form, a <xref:System.Data.DataSet> containing two <xref:System.Data.DataTable> objects, and a <xref:System.Data.DataRelation> that relates the two tables. To display the data, a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control is then bound to the <xref:System.Data.DataSet> through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method. A button on the form changes the appearance of the grid by creating two <xref:System.Windows.Forms.DataGridTableStyle> objects and setting the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of each object to a <xref:System.Data.DataTable.TableName%2A> of one of the <xref:System.Data.DataTable> objects. The example also contains code in the <xref:System.Windows.Forms.Control.MouseUp> event that uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method to print the column, row, and part of the grid that has been clicked. - +> The <xref:System.Windows.Forms.DataGridView> control replaces and adds functionality to the <xref:System.Windows.Forms.DataGrid> control; however, the <xref:System.Windows.Forms.DataGrid> control is retained for both backward compatibility and future use, if you choose. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid Controls](/dotnet/desktop/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). + + + +## Examples + The following code example creates a Windows form, a <xref:System.Data.DataSet> containing two <xref:System.Data.DataTable> objects, and a <xref:System.Data.DataRelation> that relates the two tables. To display the data, a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control is then bound to the <xref:System.Data.DataSet> through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method. A button on the form changes the appearance of the grid by creating two <xref:System.Windows.Forms.DataGridTableStyle> objects and setting the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of each object to a <xref:System.Data.DataTable.TableName%2A> of one of the <xref:System.Data.DataTable> objects. The example also contains code in the <xref:System.Windows.Forms.Control.MouseUp> event that uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method to print the column, row, and part of the grid that has been clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Data.DataSet" /> @@ -207,18 +207,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGrid" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To populate a newly created <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property to a valid source, such as a <xref:System.Data.DataView>, <xref:System.Data.DataSet>, or <xref:System.Data.DataViewManager>. - - - -## Examples - The following code example creates a new <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> and uses the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataGrid Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + To populate a newly created <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property to a valid source, such as a <xref:System.Data.DataView>, <xref:System.Data.DataSet>, or <xref:System.Data.DataViewManager>. + + + +## Examples + The following code example creates a new <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> and uses the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataGrid Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Data.DataColumnCollection" /> @@ -258,20 +258,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if navigation is allowed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is set to `false`, links to child tables are not shown. - - - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property between the `true` and `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is set to `false`, links to child tables are not shown. + + + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property between the `true` and `false`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -297,20 +297,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.AllowNavigation" /> property has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property is set to `false`, then no links to child tables are shown. - - - -## Examples - The following code example resets the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property and raises the <xref:System.Windows.Forms.DataGrid.AllowNavigationChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property is set to `false`, then no links to child tables are shown. + + + +## Examples + The following code example resets the <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> property and raises the <xref:System.Windows.Forms.DataGrid.AllowNavigationChanged> event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -344,26 +344,26 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if columns can be sorted; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is overridden by the <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A?displayProperty=nameWithType> property if there is a <xref:System.Windows.Forms.DataGridTableStyle> currently in effect for the control. - - If sorting is allowed, clicking on a column header will sort the table data by that column. - - You can also sort using an expression for a <xref:System.Data.DataColumn>. See <xref:System.Data.DataColumn.Expression%2A> for details on creating a sort expression. - - If the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataView>, you can set a custom sort for the table using the <xref:System.Data.DataView> class's <xref:System.Data.DataView.Sort%2A> property. Similarly, if the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataViewManager>, each table in the <xref:System.Data.DataViewManager> can have a custom sort by setting the <xref:System.Data.DataViewManager.DataViewSettings%2A> class's <xref:System.Data.DataViewSetting.Sort%2A> property. - - - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowSorting%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is overridden by the <xref:System.Windows.Forms.DataGridTableStyle.AllowSorting%2A?displayProperty=nameWithType> property if there is a <xref:System.Windows.Forms.DataGridTableStyle> currently in effect for the control. + + If sorting is allowed, clicking on a column header will sort the table data by that column. + + You can also sort using an expression for a <xref:System.Data.DataColumn>. See <xref:System.Data.DataColumn.Expression%2A> for details on creating a sort expression. + + If the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataView>, you can set a custom sort for the table using the <xref:System.Data.DataView> class's <xref:System.Data.DataView.Sort%2A> property. Similarly, if the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is bound to a <xref:System.Data.DataViewManager>, each table in the <xref:System.Data.DataViewManager> can have a custom sort by setting the <xref:System.Data.DataViewManager.DataViewSettings%2A> class's <xref:System.Data.DataViewSetting.Sort%2A> property. + + + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.AllowSorting%2A> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowSorting/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Data.DataColumn.Expression" /> @@ -395,18 +395,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of odd-numbered rows of the grid.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the alternating background color. The default is the system color for windows (<see cref="P:System.Drawing.SystemColors.Window" />).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> to a <xref:System.Drawing.Color> value. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AlternatingBackColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> to a <xref:System.Drawing.Color> value. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AlternatingBackColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -432,20 +432,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see langword="Back" /> button on a child table is clicked.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `Back` button becomes visible when a child table is displayed. Clicking the button will cause the grid to display the parent table. - - - -## Examples - The following code example adds an event handler for the <xref:System.Windows.Forms.DataGrid.BackButtonClick> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `Back` button becomes visible when a child table is displayed. Clicking the button will cause the grid to display the parent table. + + + +## Examples + The following code example adds an event handler for the <xref:System.Windows.Forms.DataGrid.BackButtonClick> event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackButtonClick/mydatagrid_backgroundcolorchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.AllowNavigation" /> @@ -472,22 +472,22 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of even-numbered rows of the grid.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color of rows in the grid. The default is the system color for windows (<see cref="P:System.Drawing.SystemColors.Window" />).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Whereas the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property determines the color of rows in the grid, the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area, which is only visible when the grid is scrolled to the bottom, or if only a few rows are contained in the grid. - - By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows. - - - -## Examples - The following code example sets both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties to different values. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Whereas the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property determines the color of rows in the grid, the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area, which is only visible when the grid is scrolled to the bottom, or if only a few rows are contained in the grid. + + By default, both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> properties are set to the same color. Setting the <xref:System.Windows.Forms.DataGrid.BackColor%2A> property affects only even-numbered rows, while setting the <xref:System.Windows.Forms.DataGrid.AlternatingBackColor%2A> affects only odd-numbered rows. + + + +## Examples + The following code example sets both the <xref:System.Windows.Forms.DataGrid.BackColor%2A> and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties to different values. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.BackgroundColor" /> @@ -515,20 +515,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the color of the non-row area of the grid.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color of the grid's background. The default is the <see cref="P:System.Drawing.SystemColors.AppWorkspace" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area of the grid, which is only visible when no table is displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or if the grid is scrolled to the bottom, or if only a few rows are contained in the grid. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.BackColor%2A>, and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> determines the color of the nonrow area of the grid, which is only visible when no table is displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or if the grid is scrolled to the bottom, or if only a few rows are contained in the grid. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.BackColor%2A>, and <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> properties. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackgroundColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.BackColor" /> @@ -555,15 +555,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.BackgroundColor" /> has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example changes the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> property value from yellow to red and raises the <xref:System.Windows.Forms.DataGrid.BackgroundColorChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example changes the <xref:System.Windows.Forms.DataGrid.BackgroundColor%2A> property value from yellow to red and raises the <xref:System.Windows.Forms.DataGrid.BackgroundColorChanged> event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackButtonClick/mydatagrid_backgroundcolorchanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -633,11 +633,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.BackgroundImage" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.BackgroundImage%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.BackgroundImage%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -705,11 +705,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.BackgroundImageLayout" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.BackgroundImageLayout%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageLayoutChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.BackgroundImageLayout%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.BackgroundImageLayoutChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -746,20 +746,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the method is successful; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The grid will deny edit requests if the user already started typing into a cell. In that case, the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method will return `false`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method to test if editing is possible before changing a specified column and row. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The grid will deny edit requests if the user already started typing into a cell. In that case, the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method will return `false`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> method to test if editing is possible before changing a specified column and row. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BeginEdit/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.EndEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32,System.Boolean)" /> @@ -790,11 +790,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Begins the initialization of a <see cref="T:System.Windows.Forms.DataGrid" /> that is used on a form or used by another component. The initialization occurs at run time.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The Visual Studio design environment uses this method to start the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.EndInit%2A> method ends the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The Visual Studio design environment uses this method to start the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.EndInit%2A> method ends the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.EndInit" /> @@ -836,13 +836,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the grid's border style.</summary> <value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> enumeration values. The default is <see langword="FixedSingle" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the style of the grid's border. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BorderStyle Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the style of the grid's border. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BorderStyle Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -868,21 +868,21 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.BorderStyle" /> has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Possible values include `None`, `FixedSingle`, and `Fixed3D`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGrid> named `DataGrid1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Possible values include `None`, `FixedSingle`, and `Fixed3D`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGrid> named `DataGrid1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGrid.BorderStyleChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet194"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet194"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet194"::: + ]]></format> </remarks> </Docs> @@ -933,13 +933,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of the caption area.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the caption's background color. The default is <see cref="P:System.Drawing.SystemColors.ActiveCaption" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionBackColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionBackColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionBackColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CaptionForeColor" /> @@ -978,18 +978,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the font of the grid's caption.</summary> <value>A <see cref="T:System.Drawing.Font" /> that represents the caption's font.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A <xref:System.Drawing.Font> encapsulates a Windows font and provides the methods for manipulating that font. - - - -## Examples - The following code example sets the caption's font using a <xref:System.Drawing.Font> object. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionFont Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + A <xref:System.Drawing.Font> encapsulates a Windows font and provides the methods for manipulating that font. + + + +## Examples + The following code example sets the caption's font using a <xref:System.Drawing.Font> object. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionFont Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CaptionBackColor" /> @@ -1018,13 +1018,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the foreground color of the caption area.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the caption area. The default is <see cref="P:System.Drawing.SystemColors.ActiveCaptionText" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionForeColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.CaptionForeColor%2A> property of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionForeColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CaptionBackColor" /> @@ -1063,15 +1063,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the text of the grid's window caption.</summary> <value>A string to be displayed as the window caption of the grid. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the caption of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the caption of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionText/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CaptionVisible" /> @@ -1109,18 +1109,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if the caption is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> is `false`, the **Back** button, **ParentRow** button, and caption will not be seen. Because navigation is limited, links to child tables will also not be visible and <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> will be set to `None`. - - - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionVisible Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> is `false`, the **Back** button, **ParentRow** button, and caption will not be seen. Because navigation is limited, links to child tables will also not be visible and <xref:System.Windows.Forms.DataGrid.AllowNavigation%2A> will be set to `None`. + + + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.CaptionVisible%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionVisible Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1146,15 +1146,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.CaptionVisible" /> property has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionVisibleChanged/mydatagrid_captionvisiblechanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1190,18 +1190,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="row">The number of the row to collapse. If set to -1, all rows are collapsed.</param> <summary>Collapses child relations, if any exist for all rows, or for a specified row.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGrid.IsExpanded%2A> method to determine if a row is expanded. - - - -## Examples - The following code example collapses all rows in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Collapse Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGrid.IsExpanded%2A> method to determine if a row is expanded. + + + +## Examples + The following code example collapses all rows in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Collapse Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.IsExpanded(System.Int32)" /> @@ -1236,13 +1236,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if the column headers are visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.ColumnHeadersVisible%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ColumnHeadersVisible Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.ColumnHeadersVisible%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ColumnHeadersVisible Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridColumnStyle" /> @@ -1286,11 +1286,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that defines the location of the edited column.</param> <summary>Informs the <see cref="T:System.Windows.Forms.DataGrid" /> control when the user begins to edit the column at the specified location.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header. + ]]></format> </remarks> </Docs> @@ -1320,11 +1320,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="editingControl">The <see cref="T:System.Windows.Forms.Control" /> used to edit the column.</param> <summary>Informs the <see cref="T:System.Windows.Forms.DataGrid" /> control when the user begins to edit a column using the specified control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When called, the <xref:System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing%2A> method enables the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control to show a pencil in the row header. + ]]></format> </remarks> </Docs> @@ -1351,21 +1351,21 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Constructs a new instance of the accessibility object for this control.</summary> <returns>The <see cref="T:System.Windows.Forms.Control.ControlAccessibleObject" /> for this control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Derived classes should not call the base class's <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A> method. - - Only the following properties of the <xref:System.Windows.Forms.AccessibleObject> should be set: - -- <xref:System.Windows.Forms.AccessibleObject.Role%2A> - -- <xref:System.Windows.Forms.AccessibleObject.Description%2A> - -- <xref:System.Windows.Forms.AccessibleObject.Name%2A> - - All other properties are handled by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> itself. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Derived classes should not call the base class's <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A> method. + + Only the following properties of the <xref:System.Windows.Forms.AccessibleObject> should be set: + +- <xref:System.Windows.Forms.AccessibleObject.Role%2A> + +- <xref:System.Windows.Forms.AccessibleObject.Description%2A> + +- <xref:System.Windows.Forms.AccessibleObject.Name%2A> + + All other properties are handled by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> itself. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.AccessibleObject" /> @@ -1473,20 +1473,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets which cell has the focus. Not available at design time.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridCell" /> with the focus.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property will cause the grid to scroll and show the cell if it is not already visible. - - - -## Examples - The following code example shows how to set and get the current cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property will cause the grid to scroll and show the cell if it is not already visible. + + + +## Examples + The following code example shows how to set and get the current cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CurrentCell/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridCell" /> @@ -1514,20 +1514,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.CurrentCell" /> property has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To determine the current cell, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To determine the current cell, use the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionVisibleChanged/mydatagrid_captionvisiblechanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -1564,24 +1564,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets index of the row that currently has focus.</summary> <value>The zero-based index of the current row.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property to a value other than its current value scrolls the control so that the specified row is in view. - - The <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> will cause the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display the next set of records in the child table that are linked to the parent table. - - If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row. - - - -## Examples - The following code example returns the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property to a value other than its current value scrolls the control so that the specified row is in view. + + The <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A> will cause the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display the next set of records in the child table that are linked to the parent table. + + If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row. + + + +## Examples + The following code example returns the <xref:System.Windows.Forms.DataGrid.CurrentRowIndex%2A>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CurrentRowIndex/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.Exception">There is no <see cref="T:System.Windows.Forms.CurrencyManager" />.</exception> @@ -1653,11 +1653,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.Cursor" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.Cursor%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.CursorChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.Cursor%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.CursorChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -1706,27 +1706,27 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the specific list in a <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> for which the <see cref="T:System.Windows.Forms.DataGrid" /> control displays a grid.</summary> <value>A list in a <see cref="P:System.Windows.Forms.DataGrid.DataSource" />. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If a <xref:System.Windows.Forms.DataGrid.DataSource%2A> contains multiple sources of data, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to one of the sources. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify one of the tables to bind to. If the <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> contains only one <xref:System.Data.DataTable>, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the <xref:System.Data.DataTable.TableName%2A> of that <xref:System.Data.DataTable>. - - If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> that contains <xref:System.Data.DataRelation> objects, parent tables will appear with a plus sign (+) in each row header. Clicking the plus sign causes a node to appear that contains links to child tables. For example, if a <xref:System.Data.DataSet> contains two <xref:System.Data.DataTable> objects named `Customers` and `Orders`, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the `Customers` table causes the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display a parent table with a plus sign visible on each row header. If the <xref:System.Windows.Forms.DataGrid.DataMember%2A> is set to `Orders`, however, the row headers will be blank. - - If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataTable>, <xref:System.Data.DataView>, collection, or array, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property throws an exception. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If a <xref:System.Windows.Forms.DataGrid.DataSource%2A> contains multiple sources of data, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to one of the sources. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify one of the tables to bind to. If the <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> contains only one <xref:System.Data.DataTable>, you should set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the <xref:System.Data.DataTable.TableName%2A> of that <xref:System.Data.DataTable>. + + If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is set to a <xref:System.Data.DataSet> that contains <xref:System.Data.DataRelation> objects, parent tables will appear with a plus sign (+) in each row header. Clicking the plus sign causes a node to appear that contains links to child tables. For example, if a <xref:System.Data.DataSet> contains two <xref:System.Data.DataTable> objects named `Customers` and `Orders`, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to the `Customers` table causes the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to display a parent table with a plus sign visible on each row header. If the <xref:System.Windows.Forms.DataGrid.DataMember%2A> is set to `Orders`, however, the row headers will be blank. + + If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataTable>, <xref:System.Data.DataView>, collection, or array, setting the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property throws an exception. + > [!NOTE] -> At run time, you must use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to reset the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property. However, the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property alone can be reset at any time to a valid table name. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - +> At run time, you must use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to reset the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property. However, the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property alone can be reset at any time to a valid table name. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataMember/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.DataSource" /> @@ -1779,46 +1779,46 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the data source that the grid is displaying data for.</summary> <value>An object that functions as a data source.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - At run time, use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties. - - The following data sources are valid: - -- A <xref:System.Data.DataTable> - -- A <xref:System.Data.DataView> - -- A <xref:System.Data.DataSet> - -- A <xref:System.Data.DataViewManager> - -- Any component that implements the <xref:System.ComponentModel.IListSource> interface - -- Any component that implements the <xref:System.Collections.IList> interface - - See the <xref:System.Windows.Forms.Binding> class overview for more information on data sources. - - If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> reference contains more than one table, you must set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property a string that specifies the table to bind to. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify the table to bind to. - - Setting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> to an object that does not implement the <xref:System.Collections.IList> interface or an <xref:System.ComponentModel.IListSource> will cause the grid to throw an exception. - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AddNew%2A> property to `false`. - - To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example. - - You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name). - - - -## Examples - The following code example shows how to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A>, and when needed, the <xref:System.Windows.Forms.DataGrid.DataMember%2A>, to bind a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to both a <xref:System.Data.DataView> and a <xref:System.Data.DataSet>. The example also shows how to return data sources from the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + At run time, use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties. + + The following data sources are valid: + +- A <xref:System.Data.DataTable> + +- A <xref:System.Data.DataView> + +- A <xref:System.Data.DataSet> + +- A <xref:System.Data.DataViewManager> + +- Any component that implements the <xref:System.ComponentModel.IListSource> interface + +- Any component that implements the <xref:System.Collections.IList> interface + + See the <xref:System.Windows.Forms.Binding> class overview for more information on data sources. + + If the <xref:System.Windows.Forms.DataGrid.DataSource%2A> reference contains more than one table, you must set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> property a string that specifies the table to bind to. For example, if the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataSet> or <xref:System.Data.DataViewManager> that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify the table to bind to. + + Setting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> to an object that does not implement the <xref:System.Collections.IList> interface or an <xref:System.ComponentModel.IListSource> will cause the grid to throw an exception. + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AddNew%2A> property to `false`. + + To bind the <xref:System.Windows.Forms.DataGrid> to a strongly typed array of objects, the object type must contain public properties. To create a <xref:System.Windows.Forms.DataGridTableStyle> that displays the array, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A?displayProperty=nameWithType> property to `typename` where `typename` is replaced by the name of the object type. Also note that the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property is case-sensitive; the type name must be matched exactly. See the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> property for an example. + + You can also bind the <xref:System.Windows.Forms.DataGrid> to an <xref:System.Collections.ArrayList>. A feature of the <xref:System.Collections.ArrayList> is that it can contain objects of multiple types, but the <xref:System.Windows.Forms.DataGrid> can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a <xref:System.Windows.Forms.Control>, the second item could be a <xref:System.Windows.Forms.TextBox> (which inherits from <xref:System.Windows.Forms.Control>). If, on the other hand, the first item is a <xref:System.Windows.Forms.TextBox>, the second object cannot be a <xref:System.Windows.Forms.Control>. Further, the <xref:System.Collections.ArrayList> must have items in it when it is bound. An empty <xref:System.Collections.ArrayList> will result in an empty grid. In addition, the objects in the <xref:System.Collections.ArrayList> must contain public properties. When binding to an <xref:System.Collections.ArrayList>, set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to "ArrayList" (the type name). + + + +## Examples + The following code example shows how to set the <xref:System.Windows.Forms.DataGrid.DataSource%2A>, and when needed, the <xref:System.Windows.Forms.DataGrid.DataMember%2A>, to bind a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> to both a <xref:System.Data.DataView> and a <xref:System.Data.DataSet>. The example also shows how to return data sources from the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataSource/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.DataMember" /> @@ -1848,20 +1848,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> property value has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.DataSourceChanged> event occurs when the <xref:System.Windows.Forms.DataGrid.DataMember%2A> value changes, or when the <xref:System.Windows.Forms.BindingContext> of the <xref:System.Windows.Forms.DataGrid> changes. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.DataSourceChanged> event occurs when the <xref:System.Windows.Forms.DataGrid.DataMember%2A> value changes, or when the <xref:System.Windows.Forms.BindingContext> of the <xref:System.Windows.Forms.DataGrid> changes. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataSourceChanged/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.SetDataBinding(System.Object,System.String)" /> @@ -1917,18 +1917,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param> <summary>Disposes of the resources (other than memory) used by the <see cref="T:System.Windows.Forms.DataGrid" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Call <xref:System.Windows.Forms.DataGrid.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. The <xref:System.Windows.Forms.DataGrid.Dispose%2A> method leaves the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> in an unusable state. After calling <xref:System.Windows.Forms.DataGrid.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> so the memory it was occupying can be reclaimed by garbage collection. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.Dispose%2A> method to free resources. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Dispose Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + Call <xref:System.Windows.Forms.DataGrid.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. The <xref:System.Windows.Forms.DataGrid.Dispose%2A> method leaves the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> in an unusable state. After calling <xref:System.Windows.Forms.DataGrid.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> so the memory it was occupying can be reclaimed by garbage collection. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.Dispose%2A> method to free resources. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Dispose Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1967,20 +1967,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the editing operation ceases; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.EndEdit%2A> method returns `false` if the user is not editing (typing into) a cell. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> and <xref:System.Windows.Forms.DataGrid.EndEdit%2A> methods to edit a value in a grid displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.EndEdit%2A> method returns `false` if the user is not editing (typing into) a cell. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.BeginEdit%2A> and <xref:System.Windows.Forms.DataGrid.EndEdit%2A> methods to edit a value in a grid displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/EndEdit/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.BeginEdit(System.Windows.Forms.DataGridColumnStyle,System.Int32)" /> @@ -2011,11 +2011,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Ends the initialization of a <see cref="T:System.Windows.Forms.DataGrid" /> that is used on a form or used by another component. The initialization occurs at run time.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The Visual Studio design environment uses this method to end the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.BeginInit%2A> method starts the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The Visual Studio design environment uses this method to end the initialization of a component that is used on a form or used by another component. The <xref:System.Windows.Forms.DataGrid.BeginInit%2A> method starts the initialization. Using the <xref:System.Windows.Forms.DataGrid.BeginInit%2A> and <xref:System.Windows.Forms.DataGrid.EndInit%2A> methods prevents the control from being used before it is fully initialized. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.BeginInit" /> @@ -2052,13 +2052,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="row">The number of the row to expand. If set to -1, all rows are expanded.</param> <summary>Displays child relations, if any exist, for all rows or a specific row.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Expand Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Expand Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.Expand(System.Int32)" /> @@ -2096,20 +2096,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the index of the first visible column in a grid.</summary> <value>The index of a <see cref="T:System.Windows.Forms.DataGridColumnStyle" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A column is considered visible even if it is partially concealed. - - If a particular column is not visible, set the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property to the cell that should be visible. - - - -## Examples - The following code example scrolls the grid if the first visible column is greater than five. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.FirstVisibleColumn Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + A column is considered visible even if it is partially concealed. + + If a particular column is not visible, set the <xref:System.Windows.Forms.DataGrid.CurrentCell%2A> property to the cell that should be visible. + + + +## Examples + The following code example scrolls the grid if the first visible column is greater than five. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.FirstVisibleColumn Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CurrentCell" /> @@ -2144,15 +2144,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if the grid is displayed flat; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example examines the <xref:System.Windows.Forms.DataGrid.FlatMode%2A> property and notifies the user of its status. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example examines the <xref:System.Windows.Forms.DataGrid.FlatMode%2A> property and notifies the user of its status. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/FlatMode/mydatagridclass_flatmode_readonly.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2178,15 +2178,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.FlatMode" /> has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/FlatMode/mydatagridclass_flatmode_readonly.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.FlatMode" /> @@ -2213,15 +2213,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the foreground color (typically the color of the text) property of the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color. The default is <see cref="P:System.Drawing.SystemBrushes.WindowText" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -2261,15 +2261,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the <see cref="T:System.Drawing.Rectangle" /> of the cell specified by <see cref="T:System.Windows.Forms.DataGridCell" />.</summary> <returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCellBounds/source1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.GetCurrentCellBounds" /> @@ -2303,20 +2303,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the <see cref="T:System.Drawing.Rectangle" /> of the cell specified by row and column number.</summary> <returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve the cell bounds for the currently selected cell, use <xref:System.Windows.Forms.DataGrid.GetCurrentCellBounds%2A>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve the cell bounds for the currently selected cell, use <xref:System.Windows.Forms.DataGrid.GetCurrentCellBounds%2A>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A> method to return a <xref:System.Drawing.Rectangle> of a specified cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCellBounds/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.GetCurrentCellBounds" /> @@ -2346,20 +2346,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets a <see cref="T:System.Drawing.Rectangle" /> that specifies the four corners of the selected cell.</summary> <returns>A <see cref="T:System.Drawing.Rectangle" /> that defines the current cell's corners.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To retrieve the cell bounds for a cell other than the current cell, use <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A>. - - - -## Examples - The following code example gets the <xref:System.Drawing.Rectangle> of the selected cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To retrieve the cell bounds for a cell other than the current cell, use <xref:System.Windows.Forms.DataGrid.GetCellBounds%2A>. + + + +## Examples + The following code example gets the <xref:System.Drawing.Rectangle> of the selected cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCurrentCellBounds/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.GetCellBounds(System.Int32,System.Int32)" /> @@ -2441,20 +2441,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the color of the grid lines.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color of the grid lines. The default is the system color for controls (<see cref="P:System.Drawing.SystemColors.Control" />).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - No grid line is displayed if the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property is set to `DataGridLineStyle.None`. - - - -## Examples - The following code example sets the color of the grid's lines using a value passed to the method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + No grid line is displayed if the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property is set to `DataGridLineStyle.None`. + + + +## Examples + The following code example sets the color of the grid's lines using a value passed to the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GridLineColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value is not set.</exception> @@ -2493,13 +2493,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the line style of the grid.</summary> <value>One of the <see cref="T:System.Windows.Forms.DataGridLineStyle" /> values. The default is <see langword="Solid" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example changes the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property to show no lines. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineStyle Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example changes the <xref:System.Windows.Forms.DataGrid.GridLineStyle%2A> property to show no lines. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineStyle Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.GridLineColor" /> @@ -2556,13 +2556,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of all row and column headers.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of row and column headers. The default is the system color for controls, <see cref="P:System.Drawing.SystemColors.Control" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the background color of column headers using a value passed to the method. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderBackColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the background color of column headers using a value passed to the method. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderBackColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">While trying to set the property, a <see langword="Color.Empty" /> was passed.</exception> @@ -2592,11 +2592,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the font used for column headers.</summary> <value>The <see cref="T:System.Drawing.Font" /> that represents the header text.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -2623,13 +2623,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the foreground color of headers.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the grid's column headers, including the column header text and the plus/minus glyphs. The default is <see cref="P:System.Drawing.SystemColors.ControlText" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the foreground color of the grid's column headers. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderForeColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the foreground color of the grid's column headers. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HeaderForeColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.FlatMode" /> @@ -2671,20 +2671,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets information, such as row and column number of a clicked point on the grid, about the grid using a specific <see cref="T:System.Drawing.Point" />.</summary> <returns>A <see cref="T:System.Windows.Forms.DataGrid.HitTestInfo" /> that contains specific information about the grid.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration. - - The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in occurs when a user clicks on a grid. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest1 Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration. + + The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in occurs when a user clicks on a grid. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest1 Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.Control.MouseDown" /> @@ -2718,20 +2718,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets information, such as row and column number of a clicked point on the grid, using the x and y coordinate passed to the method.</summary> <returns>A <see cref="T:System.Windows.Forms.DataGrid.HitTestInfo" /> that contains information about the clicked part of the grid.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration. - - The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in an event that occurs when the user clicks in the grid. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.HitTestInfo>, in conjunction with the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method of the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control, is used to determine which part of a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control the user has clicked. The <xref:System.Windows.Forms.DataGrid.HitTestInfo> contains the row, column, and part of the grid that was clicked. Additionally, the <xref:System.Windows.Forms.DataGrid.HitTestInfo.Type%2A> property returns a <xref:System.Windows.Forms.DataGrid.HitTestType> enumeration. + + The <xref:System.Windows.Forms.DataGrid.HitTest%2A> method takes an x and y argument supplied by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control's <xref:System.Windows.Forms.Control.DragDrop>, <xref:System.Windows.Forms.Control.DragEnter>, <xref:System.Windows.Forms.Control.DragOver>, <xref:System.Windows.Forms.Control.MouseDown>, <xref:System.Windows.Forms.Control.MouseMove>, <xref:System.Windows.Forms.Control.MouseUp> and <xref:System.Windows.Forms.Control.MouseWheel> events. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGrid.HitTest%2A> method in an event that occurs when the user clicks in the grid. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.Control.MouseDown" /> @@ -2795,15 +2795,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the node is expanded; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example tests each row in the grid, and prints the row number of expanded rows. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example tests each row in the grid, and prints the row number of expanded rows. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsExpanded/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.IsExpanded Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.Collapse(System.Int32)" /> @@ -2836,20 +2836,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the row is selected; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method with the <xref:System.Windows.Forms.DataGrid.Select%2A>, <xref:System.Windows.Forms.DataGrid.UnSelect%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method with the <xref:System.Windows.Forms.DataGrid.Select%2A>, <xref:System.Windows.Forms.DataGrid.UnSelect%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> @@ -2889,20 +2889,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the value of a specified <see cref="T:System.Windows.Forms.DataGridCell" />.</summary> <value>The value, typed as <see cref="T:System.Object" />, of the cell.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this property changes the position of the <xref:System.Data.DataView> to the specified row. - - - -## Examples - The following code example sets and gets the value of a cell by declaring a <xref:System.Windows.Forms.DataGridCell> variable, setting its <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> values, then first changing, then returning, the value of the given cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this property changes the position of the <xref:System.Data.DataView> to the specified row. + + + +## Examples + The following code example sets and gets the value of a cell by declaring a <xref:System.Windows.Forms.DataGridCell> variable, setting its <xref:System.Windows.Forms.DataGridCell.RowNumber%2A> and <xref:System.Windows.Forms.DataGridCell.ColumnNumber%2A> values, then first changing, then returning, the value of the given cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Item/source1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this1 Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.CurrentCell" /> @@ -2937,24 +2937,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the value of the cell at the specified the row and column.</summary> <value>The value, typed as <see cref="T:System.Object" />, of the cell.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this property changes the position of the <xref:System.Data.DataView> to the specified row. - - - -## Examples - The following code example prints the value contained by the cell at the specified row and index. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this property changes the position of the <xref:System.Data.DataView> to the specified row. + + + +## Examples + The following code example prints the value contained by the cell at the specified row and index. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Item/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentOutOfRangeException">While getting or setting, the <paramref name="rowIndex" /> is out of range. - + <exception cref="T:System.ArgumentOutOfRangeException">While getting or setting, the <paramref name="rowIndex" /> is out of range. + While getting or setting, the <paramref name="columnIndex" /> is out of range.</exception> </Docs> </Member> @@ -2980,11 +2980,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the color of the text that you can click to navigate to a child table.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color of text that is clicked to navigate to a child table. The default is <see cref="P:System.Drawing.SystemColors.HotTrack" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.LinkColor" /> @@ -3087,20 +3087,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the user navigates to a new table.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGrid.Navigate> event to reset individual column properties, such as width, as appropriate to the table. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGrid.Navigate> event to reset individual column properties, such as width, as appropriate to the table. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -3127,18 +3127,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Navigates back to the table previously displayed in the grid.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the grid has no parent rows, no change occurs. - - - -## Examples - The following code example demonstrates the use of this member. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.NavigateBack Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the grid has no parent rows, no change occurs. + + + +## Examples + The following code example demonstrates the use of this member. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.NavigateBack Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -3170,14 +3170,14 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="relationName">The name of the child relation to navigate to.</param> <summary>Navigates to the table specified by row and relation name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example navigates to the specified row number, in the table specified by child relationship name. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example navigates to the specified row number, in the table specified by child relationship name. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/NavigateTo/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.NavigateTo Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.NavigateTo Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.NavigateBack" /> @@ -3263,13 +3263,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.BackColorChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnBackColorChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnBackColorChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3328,13 +3328,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.BindingContextChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnBindingContextChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnBindingContextChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3448,13 +3448,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGrid.DataSourceChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnDataSourceChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnDataSourceChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3539,13 +3539,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnFontChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnFontChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3577,13 +3577,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.ForeColorChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnForeColorChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnForeColorChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3615,13 +3615,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="M:System.Windows.Forms.Control.CreateHandle" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnHandleCreated%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnHandleCreated%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3653,13 +3653,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> containing the event data.</param> <summary>Raises the <see cref="M:System.Windows.Forms.Control.DestroyHandle" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnHandleDestroyed%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnHandleDestroyed%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3691,13 +3691,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="ke">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that provides data about the <see cref="M:System.Windows.Forms.Control.OnKeyDown(System.Windows.Forms.KeyEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnKeyDown%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnKeyDown%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3729,13 +3729,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="kpe">A <see cref="T:System.Windows.Forms.KeyPressEventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnKeyPress(System.Windows.Forms.KeyPressEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyPress" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnKeyPress%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnKeyPress%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3767,13 +3767,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="levent">A <see cref="T:System.Windows.Forms.LayoutEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Layout" /> event, which repositions controls and updates scroll bars.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnLayout%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnLayout%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3805,13 +3805,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Leave" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnLeave%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnLeave%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3843,20 +3843,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid.OnMouseDown/CPP/overridemousedown.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/OnMouseDown/overridemousedown.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid.OnMouseDown/VB/overridemousedown.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid.OnMouseDown/VB/overridemousedown.vb" id="Snippet1"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3888,11 +3888,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnMouseLeave(System.EventArgs)" /> event.</param> <summary>Creates the <see cref="E:System.Windows.Forms.Control.MouseLeave" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3924,11 +3924,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseMove" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3960,11 +3960,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseUp" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3996,11 +3996,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains data about the <see cref="M:System.Windows.Forms.Control.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseWheel" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -4059,11 +4059,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="pe">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> which contains data about the event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -4095,11 +4095,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="ebe">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains information about the control to paint.</param> <summary>Overrides <see cref="M:System.Windows.Forms.Control.OnPaintBackground(System.Windows.Forms.PaintEventArgs)" /> to prevent painting the background of the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Because the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is a complex control, this override is implemented to have no action. Therefore, calling this method will have no effect. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Because the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> is a complex control, this override is implemented to have no action. Therefore, calling this method will have no effect. + ]]></format> </remarks> </Docs> @@ -4129,13 +4129,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGrid.ParentRowsLabelStyleChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnParentRowsLabelStyleChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnParentRowsLabelStyleChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -4195,13 +4195,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGrid.ReadOnlyChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGrid.OnReadOnlyChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGrid.OnReadOnlyChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -4233,11 +4233,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Resize" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -4350,13 +4350,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of parent rows.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color of parent rows. The default is the <see cref="P:System.Drawing.SystemColors.Control" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.ParentRowsBackColor%2A> property to a new color. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsBackColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.ParentRowsBackColor%2A> property to a new color. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsBackColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -4383,13 +4383,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the foreground color of parent rows.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of parent rows. The default is the <see cref="P:System.Drawing.SystemColors.WindowText" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.ParentRowsForeColor%2A> property to a new color. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsForeColor Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.ParentRowsForeColor%2A> property to a new color. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsForeColor Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -4430,13 +4430,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the way parent row labels are displayed.</summary> <value>One of the <see cref="T:System.Windows.Forms.DataGridParentRowsLabelStyle" /> values. The default is <see langword="Both" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example cycles through the possible values for the <xref:System.Windows.Forms.DataGrid.ParentRowsLabelStyle%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsLabelStyle Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example cycles through the possible values for the <xref:System.Windows.Forms.DataGrid.ParentRowsLabelStyle%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsLabelStyle Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The enumerator was not valid.</exception> @@ -4467,15 +4467,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the label style of the parent row is changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/CPP/datagrid_parentrowslabelstylechanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ParentRowsLabelStyleChanged/datagrid_parentrowslabelstylechanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/VB/datagrid_parentrowslabelstylechanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/VB/datagrid_parentrowslabelstylechanged.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -4509,13 +4509,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if the parent rows are visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.ParentRowsVisible%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsVisible Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.ParentRowsVisible%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsVisible Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -4541,15 +4541,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.ParentRowsVisible" /> property value changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/CPP/datagrid_parentrowslabelstylechanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ParentRowsLabelStyleChanged/datagrid_parentrowslabelstylechanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/VB/datagrid_parentrowslabelstylechanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ParentRowsLabelStyleChanged/VB/datagrid_parentrowslabelstylechanged.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -4590,20 +4590,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the default width of the grid columns in pixels.</summary> <value>The default width (in pixels) of columns in the grid.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set this property before resetting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties (either separately, or through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method), or the property will have no effect. - - The property cannot be set to a value less than 0. - - - -## Examples - The following code example sets the default column widths to a value passed to the method. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredColumnWidth Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set this property before resetting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties (either separately, or through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method), or the property will have no effect. + + The property cannot be set to a value less than 0. + + + +## Examples + The following code example sets the default column widths to a value passed to the method. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredColumnWidth Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The property value is less than 0.</exception> @@ -4639,20 +4639,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the preferred row height for the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary> <value>The height of a row.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set this property before resetting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties (either separately, or through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method), or the property will have no effect. - - - -## Examples - The following code example first sets a new font, and sets the <xref:System.Windows.Forms.DataGrid.PreferredRowHeight%2A> to the same height as the new font. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set this property before resetting the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> properties (either separately, or through the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method), or the property will have no effect. + + + +## Examples + The following code example first sets a new font, and sets the <xref:System.Windows.Forms.DataGrid.PreferredRowHeight%2A> to the same height as the new font. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/PreferredRowHeight/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGridColumnStyle.GetPreferredHeight(System.Drawing.Graphics,System.Object)" /> @@ -4685,11 +4685,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" />, the key should be processed; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The method overrides the <xref:System.Windows.Forms.Control.ProcessDialogKey%2A> method to implement keyboard navigation of the grid. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The method overrides the <xref:System.Windows.Forms.Control.ProcessDialogKey%2A> method to implement keyboard navigation of the grid. + ]]></format> </remarks> </Docs> @@ -4749,11 +4749,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" />, if the key was consumed; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is called by a child control when the child control receives a keyboard message. The child control calls this method before generating any keyboard events for the message. If this method returns `true`, the child control considers the message consumed and does not generate any keyboard events. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is called by a child control when the child control receives a keyboard message. The child control calls this method before generating any keyboard events for the message. If this method returns `true`, the child control considers the message consumed and does not generate any keyboard events. + ]]></format> </remarks> </Docs> @@ -4816,22 +4816,22 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <value> <see langword="true" /> if the grid is in read-only mode; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - In read-only mode, the grid can be scrolled, nodes can be expanded or collapsed, and so on. However, no additions, edits, or deletes can take place. - - The <xref:System.Windows.Forms.DataGridColumnStyle> also has a <xref:System.Windows.Forms.DataGridColumnStyle.ReadOnly%2A> property that can be set to true to prevent data from being edited, on a column-by-column basis. - - The <xref:System.Windows.Forms.DataGrid.ReadOnly%2A> can be set to true if you want to prohibit the user from editing the data directly in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. For example, you might want to let users to see all columns in a table, but allow them to edit specific fields only through <xref:System.Windows.Forms.TextBox> controls on a different form. - - - -## Examples - The following code example toggles the <xref:System.Windows.Forms.DataGrid.ReadOnly%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ReadOnly Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + In read-only mode, the grid can be scrolled, nodes can be expanded or collapsed, and so on. However, no additions, edits, or deletes can take place. + + The <xref:System.Windows.Forms.DataGridColumnStyle> also has a <xref:System.Windows.Forms.DataGridColumnStyle.ReadOnly%2A> property that can be set to true to prevent data from being edited, on a column-by-column basis. + + The <xref:System.Windows.Forms.DataGrid.ReadOnly%2A> can be set to true if you want to prohibit the user from editing the data directly in the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. For example, you might want to let users to see all columns in a table, but allow them to edit specific fields only through <xref:System.Windows.Forms.TextBox> controls on a different form. + + + +## Examples + The following code example toggles the <xref:System.Windows.Forms.DataGrid.ReadOnly%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ReadOnly Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Data.DataColumn.ReadOnly" /> @@ -4858,15 +4858,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DataGrid.ReadOnly" /> property value changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/FlatMode/mydatagridclass_flatmode_readonly.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.ReadOnly" /> @@ -4894,20 +4894,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.AlternatingBackColor" /> property to its default color.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeAlternatingBackColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeAlternatingBackColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.AlternatingBackColor" /> @@ -4934,20 +4934,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.BackColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -4973,20 +4973,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.ForeColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.AlternatingBackColor" /> @@ -5019,20 +5019,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.GridLineColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeGridLineColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeGridLineColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5059,20 +5059,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.HeaderBackColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderBackColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderBackColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -5099,20 +5099,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.HeaderFont" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderFont%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderFont%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet3"::: + ]]></format> </remarks> </Docs> @@ -5139,20 +5139,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.HeaderForeColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderForeColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeHeaderForeColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5179,20 +5179,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.LinkColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5219,11 +5219,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.LinkHoverColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeLinkHoverColor%2A> method to determine whether the property value has changed from its default. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeLinkHoverColor%2A> method to determine whether the property value has changed from its default. + ]]></format> </remarks> </Docs> @@ -5250,11 +5250,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Turns off selection for all rows that are selected.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.Select%2A>, and <xref:System.Windows.Forms.DataGrid.UnSelect%2A> methods to manipulate the selection state of a particular row. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.Select%2A>, and <xref:System.Windows.Forms.DataGrid.UnSelect%2A> methods to manipulate the selection state of a particular row. + ]]></format> </remarks> </Docs> @@ -5281,20 +5281,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.SelectionBackColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeSelectionBackColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeSelectionBackColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5321,20 +5321,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Resets the <see cref="P:System.Windows.Forms.DataGrid.SelectionForeColor" /> property to its default value.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeSelectionForeColor%2A> method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. You can use the <xref:System.Windows.Forms.DataGrid.ShouldSerializeSelectionForeColor%2A> method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5429,15 +5429,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the width of row headers.</summary> <value>The width of row headers in the <see cref="T:System.Windows.Forms.DataGrid" />. The default is 35.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet6"::: + ]]></format> </remarks> </Docs> @@ -5463,15 +5463,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the user scrolls the <see cref="T:System.Windows.Forms.DataGrid" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionVisibleChanged/mydatagrid_captionvisiblechanged.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet3"::: + ]]></format> </remarks> </Docs> @@ -5501,20 +5501,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="row">The index of the row to select.</param> <summary>Selects a specified row.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.UnSelect%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.UnSelect%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet4"::: + ]]></format> </remarks> </Docs> @@ -5541,20 +5541,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or sets the background color of selected rows.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of selected rows. The default is the <see cref="P:System.Drawing.SystemBrushes.ActiveCaption" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5581,15 +5581,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets or set the foreground color of selected rows.</summary> <value>A <see cref="T:System.Drawing.Color" /> representing the foreground color of selected rows. The default is the <see cref="P:System.Drawing.SystemBrushes.ActiveCaptionText" /> color.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -5621,24 +5621,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="dataMember">The <see cref="P:System.Windows.Forms.DataGrid.DataMember" /> string that specifies the table to bind to within the object returned by the <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> property.</param> <summary>Sets the <see cref="P:System.Windows.Forms.DataGrid.DataSource" /> and <see cref="P:System.Windows.Forms.DataGrid.DataMember" /> properties at run time.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You must use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method at run time to reset the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property. - - See the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property for more details about setting a valid data source. - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AllowNew%2A> property to `false`. When the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataView> or <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to an empty string (""). - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> to a <xref:System.Data.DataSet>, and a <xref:System.Data.DataTable> in the <xref:System.Data.DataSet>, respectively. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You must use the <xref:System.Windows.Forms.DataGrid.SetDataBinding%2A> method at run time to reset the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property. + + See the <xref:System.Windows.Forms.DataGrid.DataSource%2A> property for more details about setting a valid data source. + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a <xref:System.Data.DataView> as the data source and setting the <xref:System.Data.DataView.AllowNew%2A> property to `false`. When the <xref:System.Windows.Forms.DataGrid.DataSource%2A> is a <xref:System.Data.DataView> or <xref:System.Data.DataTable>, set the <xref:System.Windows.Forms.DataGrid.DataMember%2A> to an empty string (""). + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGrid.DataSource%2A> and <xref:System.Windows.Forms.DataGrid.DataMember%2A> to a <xref:System.Data.DataSet>, and a <xref:System.Data.DataTable> in the <xref:System.Data.DataSet>, respectively. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/SetDataBinding/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">One or more of the arguments are invalid.</exception> @@ -5673,11 +5673,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5706,11 +5706,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5739,11 +5739,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has been changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5772,11 +5772,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has been changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5805,11 +5805,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5838,11 +5838,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5871,11 +5871,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5904,11 +5904,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -5937,11 +5937,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DataGrid.ResetLinkHoverColor" /> @@ -5971,11 +5971,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has been changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -6004,11 +6004,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has been changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method only if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>, or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -6037,11 +6037,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -6070,11 +6070,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -6103,11 +6103,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <returns> <see langword="true" /> if the property value has changed from its default; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You typically use this method if you are either creating a designer for the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> or creating your own control incorporating the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -6133,15 +6133,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the <see langword="ShowParentDetails" /> button is clicked.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ShowParentDetailsButtonClick/CPP/datagrid_showparentdetailsbuttonclick.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ShowParentDetailsButtonClick/datagrid_showparentdetailsbuttonclick.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ShowParentDetailsButtonClick/VB/datagrid_showparentdetailsbuttonclick.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ShowParentDetailsButtonClick/VB/datagrid_showparentdetailsbuttonclick.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -6234,35 +6234,35 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the collection of <see cref="T:System.Windows.Forms.DataGridTableStyle" /> objects for the grid.</summary> <value>A <see cref="T:System.Windows.Forms.GridTableStylesCollection" /> that represents the collection of <see cref="T:System.Windows.Forms.DataGridTableStyle" /> objects.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.GridTableStylesCollection> retrieved through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property to create customized views of each table displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - By default, the collection returned by <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property does not contain any <xref:System.Windows.Forms.DataGridTableStyle> objects. To create a set of customized views: - -1. Create a <xref:System.Windows.Forms.DataGridTableStyle>. - -2. Set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the grid table object to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. - -3. Add <xref:System.Windows.Forms.DataGridColumnStyle> objects, one for each grid column you want to show, to the <xref:System.Windows.Forms.GridColumnStylesCollection> returned by the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property. - -4. Set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> of each <xref:System.Windows.Forms.DataGridColumnStyle> to the <xref:System.Data.DataColumn.ColumnName%2A> of a <xref:System.Data.DataColumn>. - -5. Add the <xref:System.Windows.Forms.DataGridTableStyle> object to the collection returned by <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.GridTableStylesCollection> retrieved through the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property to create customized views of each table displayed by the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + By default, the collection returned by <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property does not contain any <xref:System.Windows.Forms.DataGridTableStyle> objects. To create a set of customized views: + +1. Create a <xref:System.Windows.Forms.DataGridTableStyle>. + +2. Set the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the grid table object to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. + +3. Add <xref:System.Windows.Forms.DataGridColumnStyle> objects, one for each grid column you want to show, to the <xref:System.Windows.Forms.GridColumnStylesCollection> returned by the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property. + +4. Set the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> of each <xref:System.Windows.Forms.DataGridColumnStyle> to the <xref:System.Data.DataColumn.ColumnName%2A> of a <xref:System.Data.DataColumn>. + +5. Add the <xref:System.Windows.Forms.DataGridTableStyle> object to the collection returned by <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. + > [!CAUTION] -> Always create <xref:System.Windows.Forms.DataGridColumnStyle> objects and add them to the <xref:System.Windows.Forms.GridColumnStylesCollection> before adding <xref:System.Windows.Forms.DataGridTableStyle> objects to the <xref:System.Windows.Forms.GridTableStylesCollection>. When you add an empty <xref:System.Windows.Forms.DataGridTableStyle> with a valid <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> value to the collection, <xref:System.Windows.Forms.DataGridColumnStyle> objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new <xref:System.Windows.Forms.DataGridColumnStyle> objects with duplicate <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> values to the <xref:System.Windows.Forms.GridColumnStylesCollection>. - - - -## Examples - The following code example creates one <xref:System.Windows.Forms.DataGridTableStyle> for each <xref:System.Data.DataTable> found in a <xref:System.Data.DataSet>, and sets the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. The <xref:System.Windows.Forms.DataGridTableStyle> is then added to the <xref:System.Windows.Forms.GridTableStylesCollection> returned by the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. The example also prints the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> of each <xref:System.Windows.Forms.DataGridColumnStyle> in the <xref:System.Windows.Forms.GridColumnStylesCollection> returned by the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property of each <xref:System.Windows.Forms.DataGridTableStyle> in the <xref:System.Windows.Forms.GridTableStylesCollection>. - +> Always create <xref:System.Windows.Forms.DataGridColumnStyle> objects and add them to the <xref:System.Windows.Forms.GridColumnStylesCollection> before adding <xref:System.Windows.Forms.DataGridTableStyle> objects to the <xref:System.Windows.Forms.GridTableStylesCollection>. When you add an empty <xref:System.Windows.Forms.DataGridTableStyle> with a valid <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> value to the collection, <xref:System.Windows.Forms.DataGridColumnStyle> objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new <xref:System.Windows.Forms.DataGridColumnStyle> objects with duplicate <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> values to the <xref:System.Windows.Forms.GridColumnStylesCollection>. + + + +## Examples + The following code example creates one <xref:System.Windows.Forms.DataGridTableStyle> for each <xref:System.Data.DataTable> found in a <xref:System.Data.DataSet>, and sets the <xref:System.Windows.Forms.DataGridTableStyle.MappingName%2A> of the <xref:System.Windows.Forms.DataGridTableStyle> to the <xref:System.Data.DataTable.TableName%2A> of the <xref:System.Data.DataTable>. The <xref:System.Windows.Forms.DataGridTableStyle> is then added to the <xref:System.Windows.Forms.GridTableStylesCollection> returned by the <xref:System.Windows.Forms.DataGrid.TableStyles%2A> property. The example also prints the <xref:System.Windows.Forms.DataGridColumnStyle.MappingName%2A> of each <xref:System.Windows.Forms.DataGridColumnStyle> in the <xref:System.Windows.Forms.GridColumnStylesCollection> returned by the <xref:System.Windows.Forms.DataGridTableStyle.GridColumnStyles%2A> property of each <xref:System.Windows.Forms.DataGridTableStyle> in the <xref:System.Windows.Forms.GridTableStylesCollection>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/TableStyles/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Data.DataColumn" /> @@ -6344,11 +6344,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DataGrid.Text" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGrid.Text%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.TextChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGrid.Text%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.DataGrid.TextChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -6378,20 +6378,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <param name="row">The index of the row to deselect.</param> <summary>Unselects a specified row.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.Select%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method with the <xref:System.Windows.Forms.DataGrid.IsSelected%2A>, <xref:System.Windows.Forms.DataGrid.Select%2A>, and <xref:System.Windows.Forms.DataGrid.ResetSelection%2A> methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_UnSelect/CPP/datagrid_unselect.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/UnSelect/datagrid_unselect.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_UnSelect/VB/datagrid_unselect.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_UnSelect/VB/datagrid_unselect.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -6463,18 +6463,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the number of visible columns.</summary> <value>The number of columns visible in the viewport. The viewport is the rectangular area through which the grid is visible. The size of the viewport depends on the size of the <see cref="T:System.Windows.Forms.DataGrid" /> control; if you allow users to resize the control, the viewport will also be affected.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The number of visible columns can change depending on their width. For example, if a default width for all columns is set, but the width of a new column is set twice as large, the number of visible columns can be reduced by at least one. - - - -## Examples - The following code example returns the number of visible columns. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleColumnCount Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + The number of visible columns can change depending on their width. For example, if a default width for all columns is set, but the width of a new column is set twice as large, the number of visible columns can be reduced by at least one. + + + +## Examples + The following code example returns the number of visible columns. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleColumnCount Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGrid.FirstVisibleColumn" /> @@ -6513,18 +6513,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the <xref:S <summary>Gets the number of rows visible.</summary> <value>The number of rows visible in the viewport. The viewport is the rectangular area through which the grid is visible. The size of the viewport depends on the size of the <see cref="T:System.Windows.Forms.DataGrid" /> control; if you allow users to resize the control, the viewport will also be affected.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The number of visible rows can be changed at run time if the user is allowed to resize the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - - -## Examples - The following code example returns the number of rows visible in a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleRowCount Example/VB/source.vb" id="Snippet1"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + The number of visible rows can be changed at run time if the user is allowed to resize the <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + + +## Examples + The following code example returns the number of rows visible in a <xref:System.Windows.Forms.DataGrid?displayProperty=nameWithType> control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleRowCount Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridTableStyle.RowHeadersVisible" /> diff --git a/xml/System.Windows.Forms/DataGridView.xml b/xml/System.Windows.Forms/DataGridView.xml index 6081c52b00b..558c67049a6 100644 --- a/xml/System.Windows.Forms/DataGridView.xml +++ b/xml/System.Windows.Forms/DataGridView.xml @@ -72,37 +72,37 @@ <format type="text/markdown"><. + The <xref:System.Windows.Forms.DataGridView> control provides a customizable table for displaying data. The <xref:System.Windows.Forms.DataGridView> class allows customization of cells, rows, columns, and borders through the use of properties such as <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.CellBorderStyle%2A>, and <xref:System.Windows.Forms.DataGridView.GridColor%2A>. For more information, see [Basic Formatting and Styling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/basic-formatting-and-styling-in-the-windows-forms-datagridview-control). You can use a <xref:System.Windows.Forms.DataGridView> control to display data with or without an underlying data source. Without specifying a data source, you can create columns and rows that contain data and add them directly to the <xref:System.Windows.Forms.DataGridView> using the <xref:System.Windows.Forms.DataGridView.Rows%2A> and <xref:System.Windows.Forms.DataGridView.Columns%2A> properties. You can also use the <xref:System.Windows.Forms.DataGridView.Rows%2A> collection to access <xref:System.Windows.Forms.DataGridViewRow> objects and the <xref:System.Windows.Forms.DataGridViewRow.Cells%2A?displayProperty=nameWithType> property to read or write cell values directly. The <xref:System.Windows.Forms.DataGridView.Item%2A> indexer also provides direct access to cells. - As an alternative to populating the control manually, you can set the <xref:System.Windows.Forms.DataGridView.DataSource%2A> and <xref:System.Windows.Forms.DataGridView.DataMember%2A> properties to bind the <xref:System.Windows.Forms.DataGridView> to a data source and automatically populate it with data. For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). + As an alternative to populating the control manually, you can set the <xref:System.Windows.Forms.DataGridView.DataSource%2A> and <xref:System.Windows.Forms.DataGridView.DataMember%2A> properties to bind the <xref:System.Windows.Forms.DataGridView> to a data source and automatically populate it with data. For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). - When working with very large amounts of data, you can set the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property to `true` to display a subset of the available data. Virtual mode requires the implementation of a data cache from which the <xref:System.Windows.Forms.DataGridView> control is populated. For more information, see [Data Display Modes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control). + When working with very large amounts of data, you can set the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property to `true` to display a subset of the available data. Virtual mode requires the implementation of a data cache from which the <xref:System.Windows.Forms.DataGridView> control is populated. For more information, see [Data Display Modes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control). - For additional information about the features available in the <xref:System.Windows.Forms.DataGridView> control, see [DataGridView Control](/dotnet/framework/winforms/controls/datagridview-control-windows-forms). The following table provides direct links to common tasks. + For additional information about the features available in the <xref:System.Windows.Forms.DataGridView> control, see [DataGridView Control](/dotnet/desktop/winforms/controls/datagridview-control-windows-forms). The following table provides direct links to common tasks. -- [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control) +- [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control) -- [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control) +- [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control) -- [How to: Set Font and Color Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-font-and-color-styles-in-the-windows-forms-datagridview-control) +- [How to: Set Font and Color Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-font-and-color-styles-in-the-windows-forms-datagridview-control) -- [How to: Change the Type of a Windows Forms DataGridView Column Using the Designer](/dotnet/framework/winforms/controls/change-the-type-of-a-wf-datagridview-column-using-the-designer) +- [How to: Change the Type of a Windows Forms DataGridView Column Using the Designer](/dotnet/desktop/winforms/controls/change-the-type-of-a-wf-datagridview-column-using-the-designer) -- [How to: Bind Data to the Windows Forms DataGridView Control Using the Designer](/dotnet/framework/winforms/controls/bind-data-to-the-datagrid-using-the-designer) +- [How to: Bind Data to the Windows Forms DataGridView Control Using the Designer](/dotnet/desktop/winforms/controls/bind-data-to-the-datagrid-using-the-designer) -- [How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer](/dotnet/framework/winforms/controls/default-cell-styles-datagridview) +- [How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer](/dotnet/desktop/winforms/controls/default-cell-styles-datagridview) -- [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control) +- [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control) -- [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control) +- [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control) -- [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control) +- [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control) -- [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) +- [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) -The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <xref:System.Windows.Forms.DataGrid> control. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid controls](/dotnet/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). +The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <xref:System.Windows.Forms.DataGrid> control. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid controls](/dotnet/desktop/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). > [!NOTE] > The <xref:System.Windows.Forms.DataGridView> control inherits both the <xref:System.Windows.Forms.Control.ContextMenu%2A> and <xref:System.Windows.Forms.Control.ContextMenuStrip%2A> properties from <xref:System.Windows.Forms.Control>, but supports only the <xref:System.Windows.Forms.Control.ContextMenuStrip%2A> property. Using the <xref:System.Windows.Forms.Control.ContextMenu%2A> property with the <xref:System.Windows.Forms.DataGridView> control has no effect. @@ -115,12 +115,12 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-overview-windows-forms">DataGridView Control Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/basic-formatting-and-styling-in-the-windows-forms-datagridview-control">Basic Formatting and Styling in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control">Displaying Data in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control">Data Display Modes in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls">Differences Between the Windows Forms DataGridView and DataGrid Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-overview-windows-forms">DataGridView Control Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/basic-formatting-and-styling-in-the-windows-forms-datagridview-control">Basic Formatting and Styling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control">Displaying Data in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control">Data Display Modes in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls">Differences Between the Windows Forms DataGridView and DataGrid Controls</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -172,7 +172,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AccessibilityNotifyCurrentCellChanged"> @@ -220,7 +220,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>Override this method when customizing the <see cref="T:System.Windows.Forms.DataGridView" /> control and modifying how and when the current cell changes. For example, if you create a custom row type that merges multiple cells into single cells and you modify the navigation accordingly, you can override this method to provide accessibility support for your changes.</para> </block> <altmember cref="T:System.Windows.Forms.AccessibleEvents" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AdjustColumnHeaderBorderStyle"> @@ -283,7 +283,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>Override this method if you want to customize the appearance of the border on column header cells.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AdjustedTopLeftHeaderBorderStyle"> @@ -346,7 +346,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>Override this property if you want to customize the appearance of the border on the upper-left header cell.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AdvancedCellBorderStyle"> @@ -396,7 +396,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AdvancedColumnHeadersBorderStyle"> @@ -446,7 +446,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AdvancedRowHeadersBorderStyle"> @@ -496,7 +496,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToAddRows"> @@ -545,7 +545,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToAddRowsChanged"> @@ -595,7 +595,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToDeleteRows"> @@ -644,7 +644,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToDeleteRowsChanged"> @@ -694,7 +694,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToOrderColumns"> @@ -746,7 +746,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToOrderColumnsChanged"> @@ -796,7 +796,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToResizeColumns"> @@ -837,7 +837,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks Use this property to prevent users from manually changing column widths. This is useful, for example, with display-only columns where data is loaded once and columns are resized at that time. - For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The <xref:System.Windows.Forms.DataGridView> control does not support double buffering. If <xref:System.Windows.Forms.Control.DoubleBuffered%2A> is set to `true` in a derived <xref:System.Windows.Forms.DataGridView> control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -850,7 +850,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToResizeColumnsChanged"> @@ -900,7 +900,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToResizeRows"> @@ -943,7 +943,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when a row is resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The <xref:System.Windows.Forms.DataGridView> control does not support double buffering. If <xref:System.Windows.Forms.Control.DoubleBuffered%2A> is set to `true` in a derived <xref:System.Windows.Forms.DataGridView> control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -956,7 +956,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AllowUserToResizeRowsChanged"> @@ -1006,7 +1006,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AlternatingRowsDefaultCellStyle"> @@ -1040,7 +1040,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. For cells in rows with odd index numbers, the styles specified through the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A> property override the styles specified through the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataGridView.RowsDefaultCellStyle%2A>, and are overridden by the styles specified through the <xref:System.Windows.Forms.DataGridViewRow.DefaultCellStyle%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.DataGridViewCell.Style%2A?displayProperty=nameWithType> properties. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a <xref:System.Windows.Forms.DataGridViewCellStyle> with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single <xref:System.Windows.Forms.DataGridViewCellStyle> to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -1053,8 +1053,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AlternatingRowsDefaultCellStyleChanged"> @@ -1107,8 +1107,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AreAllCellsSelected"> @@ -1158,8 +1158,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="P:System.Windows.Forms.DataGridViewBand.Visible" /> <altmember cref="P:System.Windows.Forms.DataGridView.SelectedCells" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoGenerateColumns"> @@ -1216,7 +1216,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x > Setting the <xref:System.Windows.Forms.DataGridView.DataSource%2A> in the Windows Forms Designer automatically sets the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property to `false` and generates code to add and bind a column for each property in the data source. The code that is generated at design-time is equivalent to the manually added code shown in the following example. It is not the same as the auto-generation of columns at run-time that occurs when the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property is set to `true`. ## Examples - The following code example demonstrates how to add columns manually and bind them to a data source when you set <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> to `false`. In this example, a <xref:System.Windows.Forms.DataGridView> control is bound to a list of `Task` business objects. Then, columns are added and are bound to `Task` properties through the <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A?displayProperty=nameWithType> property. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + The following code example demonstrates how to add columns manually and bind them to a data source when you set <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> to `false`. In this example, a <xref:System.Windows.Forms.DataGridView> control is bound to a list of `Task` business objects. Then, columns are added and are bound to `Task` properties through the <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A?displayProperty=nameWithType> property. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: @@ -1227,7 +1227,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.DataMember" /> <altmember cref="M:System.ComponentModel.ICustomTypeDescriptor.GetProperties" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.DataPropertyName" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoGenerateColumnsChanged"> @@ -1285,7 +1285,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeColumn"> @@ -1337,10 +1337,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks This method is useful if you want to control when a column resizes. The column width is adjusted only once per method call; if the contents of the column later change, the column will not automatically adjust. To resize all columns, use the <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> method. To set the column to automatically resize whenever its contents change, use the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsMode%2A> property or the column <xref:System.Windows.Forms.DataGridViewColumn.AutoSizeMode%2A> property. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: @@ -1350,7 +1350,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumn"> @@ -1397,10 +1397,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload lets you specify a sizing mode that calculates the new width based on values in a limited set of cells, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: @@ -1416,7 +1416,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="autoSizeColumnMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumn"> @@ -1462,7 +1462,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If `fixedHeight` is `false`, the column width will be calculated with the expectation that you will call the <xref:System.Windows.Forms.DataGridView.AutoResizeRow%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeRows%2A> method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -1474,7 +1474,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="autoSizeColumnMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeColumnHeadersHeight"> @@ -1525,7 +1525,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when the column headers are resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples The following code example demonstrates how to resize column headers and rows as a result of a button click. @@ -1536,7 +1536,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumnHeadersHeight"> @@ -1581,13 +1581,13 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when the column headers are resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumnHeadersHeight"> @@ -1632,11 +1632,11 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedColumnsWidth` or `fixedRowHeadersWidth` parameters are `false`, the height of the column headers will be calculated with the expectation that you will call the methods such as <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> and <xref:System.Windows.Forms.DataGridView.AutoResizeRowHeadersWidth%2A> next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumnHeadersHeight"> @@ -1683,13 +1683,13 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedColumnWidth` or `fixedRowHeadersWidth` parameters are `false`, the height of the column headers will be calculated with the expectation that you will call the methods such as <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> and <xref:System.Windows.Forms.DataGridView.AutoResizeRowHeadersWidth%2A> next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeColumns"> @@ -1738,10 +1738,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks This method is useful if you want to control when columns resize. The column widths are adjusted only once per method call; if the contents of the columns later change, the columns will not automatically adjust. To resize a specific column, use the <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> method. To set the columns to automatically resize whenever their contents change, use the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsMode%2A> property or the column <xref:System.Windows.Forms.DataGridViewColumn.AutoSizeMode%2A> property. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet3"::: @@ -1749,7 +1749,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumns"> @@ -1794,10 +1794,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload lets you specify a sizing mode that calculates the new widths based on values in a limited set of cells, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet3"::: @@ -1811,7 +1811,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeColumnsMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None" /> or <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill" />.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="autoSizeColumnsMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeColumns"> @@ -1855,7 +1855,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If `fixedHeight` is `false`, the column widths will be calculated with the expectation that you will call the <xref:System.Windows.Forms.DataGridView.AutoResizeRow%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeRows%2A> method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -1865,7 +1865,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeColumnsMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None" /> or <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill" />.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="autoSizeColumnsMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeRow"> @@ -1919,10 +1919,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when a row is resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes the third row in a <xref:System.Windows.Forms.DataGridView> to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes the third row in a <xref:System.Windows.Forms.DataGridView> to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: @@ -1932,7 +1932,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRow"> @@ -1981,10 +1981,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload lets you specify a sizing mode that calculates the new height based on values in a limited set of cells, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes the third row in a <xref:System.Windows.Forms.DataGridView> to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes the third row in a <xref:System.Windows.Forms.DataGridView> to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: @@ -1998,7 +1998,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeRowMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowMode" /> value.</exception> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRow"> @@ -2046,7 +2046,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If `fixedWidth` is `false`, the row height will be calculated with the expectation that you will call the <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2056,7 +2056,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeRowMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowMode" /> value.</exception> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeRowHeadersWidth"> @@ -2110,7 +2110,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This method lets you specify a sizing mode that calculates the new width based on values in a limited set of headers, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2118,7 +2118,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowHeadersWidthSizeMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" />.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="rowHeadersWidthSizeMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRowHeadersWidth"> @@ -2165,10 +2165,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This method lets you specify a sizing mode that calculates the new width based on values in a limited set of headers, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates how to resize the row header widths based on changes to the contents of the first row header. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example illustrates how to resize the row header widths based on changes to the contents of the first row header. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet5"::: @@ -2182,7 +2182,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowHeadersWidthSizeMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" /></exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="rowHeadersWidthSizeMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRowHeadersWidth"> @@ -2229,7 +2229,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedColumnHeadersHeight` or `fixedRowsHeight` parameters are `false`, the width of the row headers will be calculated with the expectation that you will call methods such as <xref:System.Windows.Forms.DataGridView.AutoResizeRows%2A> and <xref:System.Windows.Forms.DataGridView.AutoResizeColumnHeadersHeight%2A> next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2237,7 +2237,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowHeadersWidthSizeMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" />.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="rowHeadersWidthSizeMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRowHeadersWidth"> @@ -2286,7 +2286,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected, and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedColumnHeadersHeight` or `fixedRowHeight` parameters are `false`, the width of the row headers will be calculated with the expectation that you will call methods such as <xref:System.Windows.Forms.DataGridView.AutoResizeRows%2A> and <xref:System.Windows.Forms.DataGridView.AutoResizeColumnHeadersHeight%2A> next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2296,7 +2296,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowHeadersWidthSizeMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" />.</exception> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException"> <paramref name="rowHeadersWidthSizeMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="AutoResizeRows"> @@ -2347,10 +2347,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when a row is resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet7"::: @@ -2358,7 +2358,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRows"> @@ -2405,10 +2405,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload lets you specify a sizing mode that calculates the new heights based on values in a limited set of cells, such as those in displayed rows only. This improves performance when the control contains a large number of rows. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet7"::: @@ -2422,7 +2422,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeRowsMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> value.</exception> <exception cref="T:System.ArgumentException"> <paramref name="autoSizeRowsMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.None" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRows"> @@ -2468,7 +2468,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected, and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedWidth` parameter is `false`, the row heights will be calculated with the expectation that you will call the <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2478,7 +2478,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="autoSizeRowsMode" /> is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> value.</exception> <exception cref="T:System.ArgumentException"> <paramref name="autoSizeRowsMode" /> has the value <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.None" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoResizeRows"> @@ -2528,7 +2528,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This overload is protected and is designed to enable you to achieve ideal cell height-to-width ratios in a derived <xref:System.Windows.Forms.DataGridView> class. If the `fixedWidth` parameter is `false`, the row heights will be calculated with the expectation that you will call the <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2544,7 +2544,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x -or- <paramref name="rowsCount" /> is less than 0.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoSize"> @@ -2615,7 +2615,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet180"::: @@ -2627,7 +2627,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoSizeColumnsMode"> @@ -2673,16 +2673,16 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x To change the sizing mode for an individual column, set its <xref:System.Windows.Forms.DataGridViewColumn.AutoSizeMode%2A> property. The default value of this property is <xref:System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet>, indicating that the column inherits its behavior and its <xref:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode%2A> property value from the control. - Columns in fill mode divide the available control width in proportions indicated by their <xref:System.Windows.Forms.DataGridViewColumn.FillWeight%2A> property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + Columns in fill mode divide the available control width in proportions indicated by their <xref:System.Windows.Forms.DataGridViewColumn.FillWeight%2A> property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). Only columns with a <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value of `true` are resized automatically, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. To adjust column widths programmatically, use the <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> methods or set the column <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property. - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates how to use this property in a master/detail scenario where two <xref:System.Windows.Forms.DataGridView> controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is <xref:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None>, and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic column sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/create-a-master-detail-form-using-two-datagridviews). + The following code example illustrates how to use this property in a master/detail scenario where two <xref:System.Windows.Forms.DataGridView> controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is <xref:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None>, and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic column sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/create-a-master-detail-form-using-two-datagridviews). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeColumnsMode/masterdetails.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: @@ -2697,7 +2697,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x The specified value when setting this property is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill" /> and at least one visible column with an <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet" /> is frozen.</exception> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoSizeColumnsModeChanged"> @@ -2750,7 +2750,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnsModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="AutoSizeRowsMode"> @@ -2802,10 +2802,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when a row is resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example demonstrates how to set the row to automatically resize based on the contents of the row headers and all of the columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + The following code example demonstrates how to set the row to automatically resize based on the contents of the row headers and all of the columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet9"::: @@ -2816,8 +2816,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> value.</exception> <exception cref="T:System.InvalidOperationException">The specified value when setting this property is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllHeaders" /> or <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedHeaders" /> and row headers are hidden.</exception> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid">How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid">How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="AutoSizeRowsModeChanged"> @@ -2858,7 +2858,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: @@ -2866,7 +2866,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackColor"> @@ -2921,7 +2921,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridView.BackgroundColor" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackColorChanged"> @@ -2973,7 +2973,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundColor"> @@ -3021,7 +3021,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x -or- The specified value when setting this property has a <see cref="P:System.Drawing.Color.A" /> property value that is less that 255.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundColorChanged"> @@ -3071,7 +3071,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundImage"> @@ -3122,7 +3122,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundImageChanged"> @@ -3172,7 +3172,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundImageLayout"> @@ -3218,7 +3218,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BackgroundImageLayoutChanged"> @@ -3270,7 +3270,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BeginEdit"> @@ -3341,7 +3341,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.IDataGridViewEditingCell" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellBeginEdit" /> <altmember cref="P:System.Windows.Forms.DataGridView.IsCurrentCellInEditMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BorderStyle"> @@ -3395,7 +3395,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.BorderStyle" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="BorderStyleChanged"> @@ -3445,7 +3445,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CancelEdit"> @@ -3485,14 +3485,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <format type="text/markdown"><. + The following code example illustrates the use of this method. This example is part of a larger example available in [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelEdit/fillcolumns.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewFillColumnsDemo/vb/fillcolumns.vb" id="Snippet20"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CancelRowEdit"> @@ -3535,7 +3535,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates how to handle this event for a <xref:System.Windows.Forms.DataGridView> control in virtual mode. When the control is in edit mode, the `rowInEdit` variable holds the index of the row being edited, and the `customerInEdit` variable holds a reference to a Customer object corresponding to that row. When the user cancels out of edit mode, this object can be discarded. If the row the user was editing is the row for new records, however, the old Customer object is discarded and replaced with a new one so that the user can begin making edits again. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control). + The following code example illustrates how to handle this event for a <xref:System.Windows.Forms.DataGridView> control in virtual mode. When the control is in edit mode, the `rowInEdit` variable holds the index of the row being edited, and the `customerInEdit` variable holds a reference to a Customer object corresponding to that row. When the user cancels out of edit mode, this object can be discarded. If the row the user was editing is the row for new records, however, the old Customer object is discarded and replaced with a new one so that the user can begin making edits again. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/implementing-virtual-mode-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet170"::: @@ -3543,7 +3543,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CanEnableIme"> @@ -3573,7 +3573,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <value> <see langword="true" /> if there is an editable cell selected; otherwise, <see langword="false" />.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellBeginEdit"> @@ -3621,7 +3621,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellBorderStyle"> @@ -3678,7 +3678,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewCellBorderStyle" /> value.</exception> <exception cref="T:System.ArgumentException">The specified value when setting this property is <see cref="F:System.Windows.Forms.DataGridViewCellBorderStyle.Custom" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellBorderStyleChanged"> @@ -3728,7 +3728,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellClick"> @@ -3779,7 +3779,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example shows a <xref:System.Windows.Forms.DataGridView.CellClick> event handler in a Tic-Tac-Toe game implementation that uses image columns in a <xref:System.Windows.Forms.DataGridView> control. Unless the game is over or the cell has already been clicked, the event handler sets the cell value to one of two <xref:System.Drawing.Bitmap> objects represented by the variables `x` and `o`. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet10"::: @@ -3787,7 +3787,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellContentClick"> @@ -3842,7 +3842,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellContentDoubleClick"> @@ -3892,7 +3892,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellContextMenuStripChanged"> @@ -3946,7 +3946,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellContextMenuStripNeeded"> @@ -4019,7 +4019,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs.ContextMenuStrip" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ContextMenuStrip" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellContextMenuStripNeeded(System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellDoubleClick"> @@ -4069,7 +4069,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellEndEdit"> @@ -4110,14 +4110,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates how to handle this event to clear the row <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property in case it was previously set by a <xref:System.Windows.Forms.DataGridView.CellValidating> event handler. The <xref:System.Windows.Forms.DataGridView.CellValidating> event handler can clear the error text when the new cell value meets the validation criteria, but when the user reverts to the old cell value by pressing ESC, the <xref:System.Windows.Forms.DataGridView.CellValidating> event does not occur. This example is part of a larger example available in [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control). + The following code example illustrates how to handle this event to clear the row <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property in case it was previously set by a <xref:System.Windows.Forms.DataGridView.CellValidating> event handler. The <xref:System.Windows.Forms.DataGridView.CellValidating> event handler can clear the error text when the new cell value meets the validation criteria, but when the user reverts to the old cell value by pressing ESC, the <xref:System.Windows.Forms.DataGridView.CellValidating> event does not occur. This example is part of a larger example available in [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellEndEdit/datavalidation.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellEnter"> @@ -4167,7 +4167,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellErrorTextChanged"> @@ -4217,7 +4217,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellErrorTextNeeded"> @@ -4288,8 +4288,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ErrorText" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellErrorTextNeeded(System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CellFormatting"> @@ -4339,7 +4339,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x Regardless of the value of the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A?displayProperty=nameWithType> property, the display properties of the object returned by the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle%2A?displayProperty=nameWithType> property are used to render the cell. - For more information about custom formatting using the <xref:System.Windows.Forms.DataGridView.CellFormatting> event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). + For more information about custom formatting using the <xref:System.Windows.Forms.DataGridView.CellFormatting> event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. @@ -4374,9 +4374,9 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellFormatting(System.Windows.Forms.DataGridViewCellFormattingEventArgs)" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellParsing" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellLeave"> @@ -4424,7 +4424,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseClick"> @@ -4490,7 +4490,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="E:System.Windows.Forms.DataGridView.CellValueChanged" /> <altmember cref="E:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged" /> <altmember cref="M:System.Windows.Forms.DataGridView.CommitEdit(System.Windows.Forms.DataGridViewDataErrorContexts)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseDoubleClick"> @@ -4542,7 +4542,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseDown"> @@ -4594,7 +4594,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseEnter"> @@ -4637,7 +4637,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example shows a <xref:System.Windows.Forms.DataGridView.CellMouseEnter> event handler in a Tic-Tac-Toe game implementation that uses image columns in a <xref:System.Windows.Forms.DataGridView> control. The event handler uses the cell value to determine the cursor and ToolTip to display. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: @@ -4645,7 +4645,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseLeave"> @@ -4688,7 +4688,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example shows a <xref:System.Windows.Forms.DataGridView.CellMouseLeave> event handler in a Tic-Tac-Toe game implementation that uses image columns in a <xref:System.Windows.Forms.DataGridView> control. The event handler resets the cursor and ToolTip, which are set in a <xref:System.Windows.Forms.DataGridView.CellMouseEnter> event handler. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: @@ -4696,7 +4696,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseMove"> @@ -4746,7 +4746,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellMouseUp"> @@ -4798,7 +4798,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellPainting"> @@ -4836,7 +4836,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <format type="text/markdown"><. If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. + You can handle this event to customize the appearance of cells in the control. You can paint entire cells yourself, or paint specific parts of cells and use the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.PaintBackground%2A?displayProperty=nameWithType> or <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.PaintContent%2A?displayProperty=nameWithType> methods to paint other parts. You can also use the <xref:System.Windows.Forms.VisualStyles.VisualStyleRenderer> class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. When handling this event, you should access the cell through the parameters of the event handler, rather than access the cell directly. @@ -4845,7 +4845,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use this event to customize the appearance of all cells in a particular column. - This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). + This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: @@ -4856,8 +4856,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellPaintingEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellPainting(System.Windows.Forms.DataGridViewCellPaintingEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewCell" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid">How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid">How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellParsing"> @@ -4937,8 +4937,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.NullValue" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.Format" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.FormatProvider" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellStateChanged"> @@ -4990,7 +4990,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellStateChangedEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStateChangedEventArgs.StateChanged" /> <altmember cref="T:System.Windows.Forms.DataGridViewElementStates" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellStyleChanged"> @@ -5043,8 +5043,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellStyleContentChanged"> @@ -5120,8 +5120,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellStyleContentChangedEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyleContentChangedEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellStyleContentChanged(System.Windows.Forms.DataGridViewCellStyleContentChangedEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellToolTipTextChanged"> @@ -5171,7 +5171,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellToolTipTextNeeded"> @@ -5241,7 +5241,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs.ToolTipText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ToolTipText" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellToolTipTextNeeded(System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellValidated"> @@ -5292,7 +5292,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellValidating"> @@ -5350,7 +5350,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="E:System.Windows.Forms.DataGridView.CellValidated" /> <altmember cref="T:System.Windows.Forms.DataGridViewCell" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellValidating(System.Windows.Forms.DataGridViewCellValidatingEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellValueChanged"> @@ -5404,7 +5404,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellValueNeeded"> @@ -5446,7 +5446,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <format type="text/markdown"><. For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). + Use this event in virtual mode to populate cells with data from a custom data store without causing rows to become unshared. For more information about row sharing, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). To add user-specified values to your custom data store, handle the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event. @@ -5466,9 +5466,9 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellValueNeeded(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CellValuePushed"> @@ -5512,7 +5512,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks Use this event in virtual mode to update a custom data store with user-specified data. Handle the <xref:System.Windows.Forms.DataGridView.CellValueNeeded> event to retrieve values from the data store for display in the control. - For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). + For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -5530,8 +5530,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellValuePushed(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="ClearSelection"> @@ -5582,7 +5582,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ClearSelection"> @@ -5649,7 +5649,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.Selected" /> <altmember cref="P:System.Windows.Forms.DataGridViewBand.Selected" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ClipboardCopyMode"> @@ -5708,7 +5708,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about Clipboard operations and data formats, see the <xref:System.Windows.Forms.Clipboard> class. ## Examples - The following code example demonstrates how to enable copying in the <xref:System.Windows.Forms.DataGridView> control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + The following code example demonstrates how to enable copying in the <xref:System.Windows.Forms.DataGridView> control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: @@ -5722,7 +5722,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.GetClipboardContent(System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.String)" /> <altmember cref="P:System.Windows.Forms.DataGridViewImageCell.Description" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnAdded"> @@ -5772,7 +5772,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnContextMenuStripChanged"> @@ -5822,7 +5822,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnCount"> @@ -5895,7 +5895,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is less than 0.</exception> <exception cref="T:System.InvalidOperationException">When setting this property, the <see cref="P:System.Windows.Forms.DataGridView.DataSource" /> property has been set.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnDataPropertyNameChanged"> @@ -5942,7 +5942,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnDefaultCellStyleChanged"> @@ -5995,8 +5995,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnDisplayIndexChanged"> @@ -6046,7 +6046,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnDividerDoubleClick"> @@ -6100,7 +6100,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnDividerWidthChanged"> @@ -6150,7 +6150,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeaderCellChanged"> @@ -6200,7 +6200,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeaderMouseClick"> @@ -6248,7 +6248,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeaderMouseDoubleClick"> @@ -6298,7 +6298,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersBorderStyle"> @@ -6362,7 +6362,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersBorderStyle" /> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> <altmember cref="P:System.Windows.Forms.DataGridView.EnableHeadersVisualStyles" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersBorderStyleChanged"> @@ -6412,7 +6412,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersDefaultCellStyle"> @@ -6464,7 +6464,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x These values automatically override the values set through the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. To force column headers to inherit the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> values, you must set the values in the <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A> object to the default values indicated for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). If visual styles are enabled and <xref:System.Windows.Forms.DataGridView.EnableHeadersVisualStyles%2A> is set to `true`, all header cells except the <xref:System.Windows.Forms.DataGridView.TopLeftHeaderCell%2A> are painted using the current theme and the <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A> values are ignored. @@ -6478,8 +6478,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersDefaultCellStyleChanged"> @@ -6530,8 +6530,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersHeight"> @@ -6620,7 +6620,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersHeightSizeMode"> @@ -6678,7 +6678,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For cell contents to wrap onto multiple lines when the column headers are resized, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The <xref:System.Windows.Forms.DataGridView> control does not support double buffering. If <xref:System.Windows.Forms.Control.DoubleBuffered%2A> is set to `true` in a derived <xref:System.Windows.Forms.DataGridView> control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -6692,7 +6692,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersHeightSizeModeChanged"> @@ -6742,7 +6742,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnHeadersVisible"> @@ -6793,7 +6793,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The specified value when setting this property is <see langword="false" /> and one or more columns have an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnMinimumWidthChanged"> @@ -6843,7 +6843,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnNameChanged"> @@ -6893,7 +6893,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnRemoved"> @@ -6943,7 +6943,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Columns"> @@ -7010,7 +7010,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewColumnCollection" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnSortModeChanged"> @@ -7060,7 +7060,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnStateChanged"> @@ -7128,7 +7128,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewColumnStateChangedEventArgs" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnColumnStateChanged(System.Windows.Forms.DataGridViewColumnStateChangedEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnToolTipTextChanged"> @@ -7178,7 +7178,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ColumnWidthChanged"> @@ -7219,14 +7219,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet18"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet18"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CommitEdit"> @@ -7266,7 +7266,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x This method attempts to convert the formatted, user-specified value to the underlying cell data type. To do this, it raises the <xref:System.Windows.Forms.DataGridView.CellParsing> event, which you can handle to customize the type conversion. Otherwise, default type converters are used. Conversion errors may result in an exception if the <xref:System.Windows.Forms.DataGridView.DataError> event is not handled to prevent it. If the value is successfully converted, it is committed to the data store, raising the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event for non-data-bound cells when the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property value is `true`. If the value is successfully committed, the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event occurs. ## Examples - The following code example calls the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A> method within a <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event handler to raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example calls the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A> method within a <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event handler to raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: @@ -7281,7 +7281,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.VirtualMode" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValueChanged" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.EndEdit" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CreateAccessibilityInstance"> @@ -7311,7 +7311,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Creates a new accessible object for the <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <returns>A new <see cref="T:System.Windows.Forms.DataGridView.DataGridViewAccessibleObject" /> for the <see cref="T:System.Windows.Forms.DataGridView" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CreateColumnsInstance"> @@ -7347,7 +7347,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Creates and returns a new <see cref="T:System.Windows.Forms.DataGridViewColumnCollection" />.</summary> <returns>An empty <see cref="T:System.Windows.Forms.DataGridViewColumnCollection" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CreateControlsInstance"> @@ -7384,7 +7384,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CreateRowsInstance"> @@ -7420,7 +7420,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Creates and returns a new <see cref="T:System.Windows.Forms.DataGridViewRowCollection" />.</summary> <returns>An empty <see cref="T:System.Windows.Forms.DataGridViewRowCollection" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CurrentCell"> @@ -7501,8 +7501,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="E:System.Windows.Forms.DataGridView.SelectionChanged" /> <altmember cref="E:System.Windows.Forms.DataGridView.CurrentCellChanged" /> <altmember cref="P:System.Windows.Forms.DataGridView.FirstDisplayedCell" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/get-and-set-the-current-cell-wf-datagridview-control">How to: Get and Set the Current Cell in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/get-and-set-the-current-cell-wf-datagridview-control">How to: Get and Set the Current Cell in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CurrentCellAddress"> @@ -7549,14 +7549,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use the <xref:System.Windows.Forms.DataGridView.CurrentCellAddress%2A> property in a row-painting scenario. In the example, this property is used to store the row index of the current cell. When the user changes the current cell to a different row, the row is forced to repaint itself. - This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet19"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CurrentCellChanged"> @@ -7597,14 +7597,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet19"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CurrentCellDirtyStateChanged"> @@ -7653,14 +7653,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event. In this example, the event handler calls the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A> method to raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event and determine the current value of a <xref:System.Windows.Forms.DataGridViewCheckBoxCell>. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event. In this example, the event handler calls the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A> method to raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event and determine the current value of a <xref:System.Windows.Forms.DataGridViewCheckBoxCell>. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="CurrentRow"> @@ -7708,7 +7708,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridView.CurrentCell" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataBindingComplete"> @@ -7748,7 +7748,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Remarks This event is raised when the contents of the data source change or when the value of the <xref:System.Windows.Forms.DataGridView.DataSource%2A>, <xref:System.Windows.Forms.DataGridView.DataMember%2A>, or <xref:System.Windows.Forms.Control.BindingContext%2A> property changes. - Handling this event is useful, for example, to programmatically resize rows and columns based on content updates. For more information, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + Handling this event is useful, for example, to programmatically resize rows and columns based on content updates. For more information, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7767,7 +7767,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.Control.BindingContext" /> <altmember cref="E:System.Windows.Forms.CurrencyManager.ListChanged" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnDataBindingComplete(System.Windows.Forms.DataGridViewBindingCompleteEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataError"> @@ -7823,7 +7823,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewDataErrorEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataMember"> @@ -7882,7 +7882,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.Exception">An error occurred in the data source and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception> <altmember cref="P:System.Windows.Forms.DataGridView.DataSource" /> <altmember cref="T:System.Data.DataSet" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataMemberChanged"> @@ -7932,7 +7932,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DataSource"> @@ -8005,9 +8005,9 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x When binding to an object collection rather than to database data, you will typically set the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property to `null` rather than using the default value of <xref:System.DBNull.Value?displayProperty=nameWithType>, which is appropriate for database data. - For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). The following table provides direct links to common tasks related to the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property. + For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). The following table provides direct links to common tasks related to the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property. - See [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) and [How to: Bind Objects to Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/how-to-bind-objects-to-windows-forms-datagridview-controls). + See [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) and [How to: Bind Objects to Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/how-to-bind-objects-to-windows-forms-datagridview-controls). ## Examples The following code example demonstrates how to initialize a simple data-bound <xref:System.Windows.Forms.DataGridView>. It also demonstrates how to set the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property. @@ -8031,8 +8031,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridView.DataMember" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control">Displaying Data in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control">Displaying Data in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DataSourceChanged"> @@ -8082,7 +8082,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DefaultCellStyle"> @@ -8132,7 +8132,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x - <xref:System.Windows.Forms.DataGridViewCell.Style%2A?displayProperty=nameWithType> - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a <xref:System.Windows.Forms.DataGridViewCellStyle> with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single <xref:System.Windows.Forms.DataGridViewCellStyle> to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -8145,8 +8145,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DefaultCellStyleChanged"> @@ -8199,8 +8199,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DefaultSize"> @@ -8288,7 +8288,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DisplayedColumnCount"> @@ -8322,7 +8322,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Returns the number of columns displayed to the user.</summary> <returns>The number of columns displayed to the user.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="DisplayedRowCount"> @@ -8394,7 +8394,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding the <see cref="P:System.Windows.Forms.DataGridView.DisplayRectangle" /> property in a derived class, use the base class's <see cref="P:System.Windows.Forms.DataGridView.DisplayRectangle" /> property to extend the base implementation. Alternatively, you must provide all the implementation.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Dispose"> @@ -8428,7 +8428,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.Control" /> and its child controls and optionally releases the managed resources.</summary> <remarks>To be added.</remarks> <altmember cref="M:System.Windows.Forms.Control.Dispose(System.Boolean)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EditingControl"> @@ -8484,14 +8484,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use this property in an overridden method of a custom cell type. In the example, a reference to the editing control is retrieved, cast to a custom editing control type, and then populated with the current value of the cell. - This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet210"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet210"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EditingControlShowing"> @@ -8551,7 +8551,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewEditingControlShowingEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewEditingControlShowingEventArgs.CellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewEditingControlShowingEventArgs.Control" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EditingPanel"> @@ -8603,7 +8603,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EditMode"> @@ -8658,7 +8658,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewEditMode" /> value.</exception> <exception cref="T:System.Exception">The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EditModeChanged"> @@ -8708,7 +8708,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EnableHeadersVisualStyles"> @@ -8759,7 +8759,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> <altmember cref="Overload:System.Windows.Forms.Application.Run" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="EndEdit"> @@ -8819,7 +8819,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.Exception">The cell value could not be committed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> <altmember cref="M:System.Windows.Forms.DataGridView.EndEdit(System.Windows.Forms.DataGridViewDataErrorContexts)" /> <altmember cref="M:System.Windows.Forms.DataGridView.CommitEdit(System.Windows.Forms.DataGridViewDataErrorContexts)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="EndEdit"> @@ -8864,7 +8864,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.Exception">The cell value could not be committed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> <altmember cref="M:System.Windows.Forms.DataGridView.CommitEdit(System.Windows.Forms.DataGridViewDataErrorContexts)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="FirstDisplayedCell"> @@ -8934,7 +8934,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x The specified cell when setting this property has a <see cref="P:System.Windows.Forms.DataGridViewCell.Visible" /> property value of <see langword="false" />.</exception> <altmember cref="P:System.Windows.Forms.DataGridView.CurrentCell" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="FirstDisplayedScrollingColumnHiddenWidth"> @@ -8985,7 +8985,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Gets the width of the portion of the column that is currently scrolled out of view.</summary> <value>The width of the portion of the column that is scrolled out of view.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="FirstDisplayedScrollingColumnIndex"> @@ -9034,7 +9034,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x -or- The specified value when setting this property indicates a column with a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="FirstDisplayedScrollingRowIndex"> @@ -9091,7 +9091,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x The specified value when setting this property indicates a column with a <see cref="P:System.Windows.Forms.DataGridViewRow.Frozen" /> property value of <see langword="true" />.</exception> <altmember cref="E:System.Windows.Forms.DataGridView.Scroll" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Font"> @@ -9137,10 +9137,10 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x Because the <xref:System.Drawing.Font> is immutable (meaning that you cannot adjust any of its properties), you can only assign the <xref:System.Windows.Forms.Control.Font%2A> property a new <xref:System.Drawing.Font> object. However, you can base the new font on the existing font. - The <xref:System.Windows.Forms.DataGridView> control uses the value of the <xref:System.Windows.Forms.DataGridView.Font%2A> property as the default value of the <xref:System.Windows.Forms.DataGridViewCellStyle.Font%2A> properties of <xref:System.Windows.Forms.DataGridViewCellStyle> objects returned by the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A>, and <xref:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle%2A> properties. Changing the <xref:System.Windows.Forms.DataGridView.Font%2A> value automatically updates the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A>, and <xref:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle%2A> properties, changing the font for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + The <xref:System.Windows.Forms.DataGridView> control uses the value of the <xref:System.Windows.Forms.DataGridView.Font%2A> property as the default value of the <xref:System.Windows.Forms.DataGridViewCellStyle.Font%2A> properties of <xref:System.Windows.Forms.DataGridViewCellStyle> objects returned by the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A>, and <xref:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle%2A> properties. Changing the <xref:System.Windows.Forms.DataGridView.Font%2A> value automatically updates the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridView.ColumnHeadersDefaultCellStyle%2A>, and <xref:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle%2A> properties, changing the font for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Create an Unbound Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control). + The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Create an Unbound Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/Overview/simpleunbound.cs" id="Snippet30"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb" id="Snippet30"::: @@ -9153,8 +9153,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.Font" /> <altmember cref="T:System.Drawing.Font" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="FontChanged"> @@ -9213,7 +9213,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridView.Font" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ForeColor"> @@ -9267,7 +9267,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x Because the <xref:System.Drawing.Font> is immutable (meaning that you cannot adjust any of its properties), you can only assign the <xref:System.Windows.Forms.Control.Font%2A> property a new <xref:System.Drawing.Font> object. However, you can base the new font on the existing font. - The <xref:System.Windows.Forms.DataGridView> control uses the value of the <xref:System.Windows.Forms.DataGridView.ForeColor%2A> property as the default value of the <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> property of <xref:System.Windows.Forms.DataGridViewCellStyle> returned by the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. Changing the <xref:System.Windows.Forms.DataGridView.ForeColor%2A> value automatically updates the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property, changing the foreground text color for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + The <xref:System.Windows.Forms.DataGridView> control uses the value of the <xref:System.Windows.Forms.DataGridView.ForeColor%2A> property as the default value of the <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> property of <xref:System.Windows.Forms.DataGridViewCellStyle> returned by the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. Changing the <xref:System.Windows.Forms.DataGridView.ForeColor%2A> value automatically updates the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property, changing the foreground text color for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -9275,8 +9275,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.ForeColor" /> <altmember cref="T:System.Drawing.Color" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ForeColorChanged"> @@ -9334,7 +9334,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GetAccessibilityObjectById"> @@ -9408,7 +9408,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use this method to determine whether there are any cells selected in a <xref:System.Windows.Forms.DataGridView> control. In this example, if any cells are selected, their values are retrieved through the <xref:System.Windows.Forms.DataGridView.GetClipboardContent%2A> method and displayed in a <xref:System.Windows.Forms.TextBox> control. - This code is part of a larger example illustrating the use of the Clipboard features of the <xref:System.Windows.Forms.DataGridView> control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + This code is part of a larger example illustrating the use of the Clipboard features of the <xref:System.Windows.Forms.DataGridView> control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet16"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet16"::: @@ -9417,7 +9417,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ArgumentException"> <paramref name="includeFilter" /> includes the value <see cref="F:System.Windows.Forms.DataGridViewElementStates.ResizableSet" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GetCellDisplayRectangle"> @@ -9469,7 +9469,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowIndex" /> is less than -1 or greater than the number of rows in the control minus 1.</exception> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ContentBounds" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GetClipboardContent"> @@ -9508,7 +9508,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information, see the <xref:System.Windows.Forms.Clipboard> class. ## Examples - The following code example demonstrates how to programmatically add selected <xref:System.Windows.Forms.DataGridView> content to the Clipboard. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + The following code example demonstrates how to programmatically add selected <xref:System.Windows.Forms.DataGridView> content to the Clipboard. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: @@ -9523,7 +9523,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.ClipboardCopyMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewClipboardCopyMode" /> <altmember cref="T:System.Windows.Forms.DataFormats" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GetColumnDisplayRectangle"> @@ -9561,7 +9561,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GetRowDisplayRectangle"> @@ -9599,7 +9599,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GridColor"> @@ -9647,7 +9647,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x -or- The specified value when setting this property has a <see cref="P:System.Drawing.Color.A" /> property value that is less that 255.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="GridColorChanged"> @@ -9697,7 +9697,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="HitTest"> @@ -9747,7 +9747,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="T:System.Windows.Forms.DataGridView.HitTestInfo" /> <altmember cref="T:System.Windows.Forms.DataGridViewHitTestType" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="HorizontalScrollBar"> @@ -9831,7 +9831,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <format type="text/markdown"><. + The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: @@ -9839,7 +9839,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is less than 0.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="InvalidateCell"> @@ -9850,7 +9850,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <Docs> <summary>Invalidates a cell in the <see cref="T:System.Windows.Forms.DataGridView" />, forcing it to be repainted.</summary> <altmember cref="Overload:System.Windows.Forms.Control.Invalidate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </MemberGroup> <Member MemberName="InvalidateCell"> @@ -9892,7 +9892,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use this method in a customized <xref:System.Windows.Forms.DataGridViewCell> that is painted with a custom border when the mouse pointer rests on it. In the example, the cell is invalidated when the mouse pointer enters or leaves it. - This code is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + This code is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -9904,7 +9904,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewCell" /> is <see langword="null" />.</exception> <altmember cref="Overload:System.Windows.Forms.Control.Invalidate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="InvalidateCell"> @@ -9946,7 +9946,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about painting and invalidation, see <xref:System.Windows.Forms.Control.Invalidate%2A>. ## Examples - The following code example illustrates how to use this method in a custom cell type that changes a cell's appearance when the user rests the mouse pointer over it. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates how to use this method in a custom cell type that changes a cell's appearance when the user rests the mouse pointer over it. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -9960,7 +9960,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <paramref name="rowIndex" /> is less than -1 or greater than the number of rows in the control minus 1.</exception> <altmember cref="Overload:System.Windows.Forms.Control.Invalidate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="InvalidateColumn"> @@ -10002,7 +10002,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is not in the valid range of 0 to the number of columns minus 1.</exception> <altmember cref="Overload:System.Windows.Forms.Control.Invalidate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="InvalidateRow"> @@ -10044,7 +10044,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use the <xref:System.Windows.Forms.DataGridView.InvalidateRow%2A> method in a row-painting scenario. In the example, the row is invalidated when the current cell changes, forcing the row to repaint itself. - This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet19"::: @@ -10054,7 +10054,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows minus 1.</exception> <altmember cref="Overload:System.Windows.Forms.Control.Invalidate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsCurrentCellDirty"> @@ -10100,14 +10100,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x If <xref:System.Windows.Forms.DataGridView.IsCurrentCellDirty%2A> is `true` and the current cell hosts an editing control, you can retrieve it through the <xref:System.Windows.Forms.DataGridView.EditingControl%2A> property. ## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridView.IsCurrentCellDirty%2A> property to determine whether to commit a cell value and raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event from a handler for the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example uses the <xref:System.Windows.Forms.DataGridView.IsCurrentCellDirty%2A> property to determine whether to commit a cell value and raise the <xref:System.Windows.Forms.DataGridView.CellValueChanged> event from a handler for the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged> event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsCurrentCellInEditMode"> @@ -10159,7 +10159,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <altmember cref="P:System.Windows.Forms.DataGridView.CurrentCell" /> <altmember cref="P:System.Windows.Forms.DataGridView.EditingControl" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsCurrentRowDirty"> @@ -10204,7 +10204,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsInputChar"> @@ -10245,7 +10245,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="IsInputKey"> @@ -10280,7 +10280,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <see langword="true" /> if the specified key is a regular input key; otherwise, <see langword="false" />.</returns> <remarks>To be added.</remarks> <altmember cref="M:System.Windows.Forms.Control.IsInputKey(System.Windows.Forms.Keys)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="Item"> @@ -10361,7 +10361,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellCollection" /> <altmember cref="P:System.Windows.Forms.DataGridView.Rows" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowCollection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Item"> @@ -10427,7 +10427,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="T:System.Windows.Forms.DataGridViewCellCollection" /> <altmember cref="P:System.Windows.Forms.DataGridView.Rows" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowCollection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="MultiSelect"> @@ -10481,7 +10481,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="MultiSelectChanged"> @@ -10531,7 +10531,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="NewRowIndex"> @@ -10585,7 +10585,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="NewRowNeeded"> @@ -10636,7 +10636,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="NotifyCurrentCellDirty"> @@ -10677,14 +10677,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates the use of this method in a custom cell scenario. In the example, an <xref:System.Windows.Forms.IDataGridViewEditingControl> implementation derived from the <xref:System.Windows.Forms.DateTimePicker> class overrides the <xref:System.Windows.Forms.DateTimePicker.OnValueChanged%2A> method and uses the <xref:System.Windows.Forms.DataGridView.NotifyCurrentCellDirty%2A> method to indicate a change to the <xref:System.Windows.Forms.DataGridView> control. - This example is part of a larger example shown in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + This example is part of a larger example shown in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet310"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet310"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAllowUserToAddRowsChanged"> @@ -10729,7 +10729,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToAddRowsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToAddRowsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.AllowUserToAddRowsChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAllowUserToDeleteRowsChanged"> @@ -10774,7 +10774,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToDeleteRowsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToDeleteRowsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.AllowUserToDeleteRowsChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAllowUserToOrderColumnsChanged"> @@ -10819,7 +10819,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToOrderColumnsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToOrderColumnsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.AllowUserToOrderColumnsChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAllowUserToResizeColumnsChanged"> @@ -10863,7 +10863,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToResizeColumnsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToResizeColumnsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAllowUserToResizeRowsChanged"> @@ -10907,7 +10907,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToResizeRowsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnAllowUserToResizeRowsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAlternatingRowsDefaultCellStyleChanged"> @@ -10952,8 +10952,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAlternatingRowsDefaultCellStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAlternatingRowsDefaultCellStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnAutoGenerateColumnsChanged"> @@ -10997,7 +10997,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAutoGenerateColumnsChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAutoGenerateColumnsChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAutoSizeColumnModeChanged"> @@ -11042,7 +11042,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAutoSizeColumnsModeChanged"> @@ -11088,7 +11088,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnsModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnsModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnAutoSizeRowsModeChanged"> @@ -11132,7 +11132,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeRowsModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnAutoSizeRowsModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnBackgroundColorChanged"> @@ -11176,7 +11176,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnBackgroundColorChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnBackgroundColorChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnBindingContextChanged"> @@ -11220,7 +11220,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnBindingContextChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnBindingContextChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnBorderStyleChanged"> @@ -11264,7 +11264,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnBorderStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnBorderStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCancelRowEdit"> @@ -11308,7 +11308,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCancelRowEdit(System.Windows.Forms.QuestionEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCancelRowEdit(System.Windows.Forms.QuestionEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellBeginEdit"> @@ -11357,7 +11357,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellBeginEdit(System.Windows.Forms.DataGridViewCellCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellBeginEdit(System.Windows.Forms.DataGridViewCellCancelEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellBorderStyleChanged"> @@ -11401,7 +11401,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellBorderStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellBorderStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellClick"> @@ -11450,7 +11450,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellContentClick"> @@ -11499,7 +11499,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellContentDoubleClick"> @@ -11548,7 +11548,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellContextMenuStripChanged"> @@ -11597,7 +11597,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellContextMenuStripChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellContextMenuStripChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellContextMenuStripNeeded"> @@ -11647,7 +11647,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellContextMenuStripNeeded(System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellContextMenuStripNeeded(System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.CellContextMenuStripNeeded" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellDoubleClick"> @@ -11696,7 +11696,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellEndEdit"> @@ -11745,7 +11745,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellEndEdit(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellEndEdit(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellEnter"> @@ -11794,7 +11794,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellErrorTextChanged"> @@ -11843,7 +11843,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellErrorTextChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellErrorTextChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellErrorTextNeeded"> @@ -11892,7 +11892,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellErrorTextNeeded(System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellErrorTextNeeded(System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellFormatting"> @@ -11941,7 +11941,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellFormatting(System.Windows.Forms.DataGridViewCellFormattingEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellFormatting(System.Windows.Forms.DataGridViewCellFormattingEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellLeave"> @@ -11990,7 +11990,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseClick"> @@ -12039,7 +12039,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseDoubleClick"> @@ -12090,7 +12090,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseDoubleClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseDoubleClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseDown"> @@ -12140,7 +12140,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseEnter"> @@ -12189,7 +12189,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseLeave"> @@ -12238,7 +12238,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseMove"> @@ -12287,7 +12287,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseMove(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseMove(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellMouseUp"> @@ -12336,7 +12336,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellPainting"> @@ -12385,7 +12385,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellPainting(System.Windows.Forms.DataGridViewCellPaintingEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellPainting(System.Windows.Forms.DataGridViewCellPaintingEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellParsing"> @@ -12434,7 +12434,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellParsing(System.Windows.Forms.DataGridViewCellParsingEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellParsing(System.Windows.Forms.DataGridViewCellParsingEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellStateChanged"> @@ -12478,7 +12478,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellStateChanged(System.Windows.Forms.DataGridViewCellStateChangedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellStateChanged(System.Windows.Forms.DataGridViewCellStateChangedEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellStyleChanged"> @@ -12528,8 +12528,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellStyleChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellStyleChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnCellStyleContentChanged"> @@ -12575,8 +12575,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellStyleContentChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnCellToolTipTextChanged"> @@ -12625,7 +12625,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellToolTipTextChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellToolTipTextChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellToolTipTextNeeded"> @@ -12674,7 +12674,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellToolTipTextNeeded(System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellToolTipTextNeeded(System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellValidated"> @@ -12723,7 +12723,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellValidated(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellValidated(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellValidating"> @@ -12773,7 +12773,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellValidating(System.Windows.Forms.DataGridViewCellValidatingEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCellValidating(System.Windows.Forms.DataGridViewCellValidatingEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellValueChanged"> @@ -12822,7 +12822,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellValueChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellValueChanged(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellValueNeeded"> @@ -12872,7 +12872,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellValueNeeded(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellValueNeeded(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCellValuePushed"> @@ -12922,7 +12922,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCellValuePushed(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCellValuePushed(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnAdded"> @@ -12967,7 +12967,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnAdded(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnAdded(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnContextMenuStripChanged"> @@ -13012,7 +13012,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnContextMenuStripChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnContextMenuStripChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnDataPropertyNameChanged"> @@ -13057,7 +13057,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnDataPropertyNameChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnDataPropertyNameChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnDefaultCellStyleChanged"> @@ -13103,8 +13103,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnDefaultCellStyleChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnDefaultCellStyleChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnColumnDisplayIndexChanged"> @@ -13149,7 +13149,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnDisplayIndexChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnDisplayIndexChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnDividerDoubleClick"> @@ -13193,7 +13193,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnDividerDoubleClick(System.Windows.Forms.DataGridViewColumnDividerDoubleClickEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnDividerDoubleClick(System.Windows.Forms.DataGridViewColumnDividerDoubleClickEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnDividerWidthChanged"> @@ -13238,7 +13238,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnDividerWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnDividerWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeaderCellChanged"> @@ -13283,7 +13283,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderCellChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderCellChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeaderMouseClick"> @@ -13328,7 +13328,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderMouseClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderMouseClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeaderMouseDoubleClick"> @@ -13372,7 +13372,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderMouseDoubleClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeaderMouseDoubleClick(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeadersBorderStyleChanged"> @@ -13416,7 +13416,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersBorderStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersBorderStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeadersDefaultCellStyleChanged"> @@ -13461,8 +13461,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersDefaultCellStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersDefaultCellStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnColumnHeadersHeightChanged"> @@ -13506,7 +13506,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersHeightChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersHeightChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnHeadersHeightSizeModeChanged"> @@ -13550,7 +13550,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersHeightSizeModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnHeadersHeightSizeModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnMinimumWidthChanged"> @@ -13595,7 +13595,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnMinimumWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnMinimumWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnNameChanged"> @@ -13640,7 +13640,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnNameChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnNameChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnRemoved"> @@ -13684,7 +13684,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnRemoved(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnRemoved(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnSortModeChanged"> @@ -13729,7 +13729,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnSortModeChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnSortModeChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnStateChanged"> @@ -13775,7 +13775,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnStateChanged(System.Windows.Forms.DataGridViewColumnStateChangedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnStateChanged(System.Windows.Forms.DataGridViewColumnStateChangedEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.ColumnStateChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnToolTipTextChanged"> @@ -13820,7 +13820,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnToolTipTextChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnColumnToolTipTextChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnColumnWidthChanged"> @@ -13865,7 +13865,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnColumnWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnColumnWidthChanged(System.Windows.Forms.DataGridViewColumnEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCurrentCellChanged"> @@ -13909,7 +13909,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCurrentCellChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnCurrentCellChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCurrentCellDirtyStateChanged"> @@ -13953,7 +13953,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnCurrentCellDirtyStateChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnCurrentCellDirtyStateChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnCursorChanged"> @@ -14002,7 +14002,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.UserSetCursor" /> <altmember cref="T:System.Windows.Forms.Cursor" /> <altmember cref="E:System.Windows.Forms.Control.CursorChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDataBindingComplete"> @@ -14042,7 +14042,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.DataGridView.DataBindingComplete" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDataError"> @@ -14089,7 +14089,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDataError(System.Boolean,System.Windows.Forms.DataGridViewDataErrorEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnDataError(System.Boolean,System.Windows.Forms.DataGridViewDataErrorEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDataMemberChanged"> @@ -14133,7 +14133,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDataMemberChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnDataMemberChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDataSourceChanged"> @@ -14177,7 +14177,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDataSourceChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnDataSourceChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDefaultCellStyleChanged"> @@ -14222,8 +14222,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDefaultCellStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnDefaultCellStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnDefaultValuesNeeded"> @@ -14267,7 +14267,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDefaultValuesNeeded(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnDefaultValuesNeeded(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnDoubleClick"> @@ -14311,7 +14311,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnDoubleClick(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnDoubleClick(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnEditingControlShowing"> @@ -14355,7 +14355,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnEditingControlShowing(System.Windows.Forms.DataGridViewEditingControlShowingEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnEditingControlShowing(System.Windows.Forms.DataGridViewEditingControlShowingEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnEditModeChanged"> @@ -14402,7 +14402,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnEditModeChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnEditModeChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnEnabledChanged"> @@ -14484,7 +14484,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnEnter(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnEnter(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnFontChanged"> @@ -14530,7 +14530,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnFontChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnFontChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnForeColorChanged"> @@ -14576,7 +14576,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnForeColorChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnForeColorChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnGotFocus"> @@ -14652,7 +14652,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnGridColorChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnGridColorChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnHandleCreated"> @@ -14696,7 +14696,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnHandleCreated(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnHandleCreated(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnHandleDestroyed"> @@ -14729,7 +14729,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Raises the <see cref="E:System.Windows.Forms.Control.HandleDestroyed" /> event.</summary> <remarks>To be added.</remarks> <altmember cref="M:System.Windows.Forms.Control.OnHandleDestroyed(System.EventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnKeyDown"> @@ -14780,7 +14780,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnKeyDown(System.Windows.Forms.KeyEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnKeyDown(System.Windows.Forms.KeyEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnKeyPress"> @@ -14830,7 +14830,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnKeyPress(System.Windows.Forms.KeyPressEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnKeyPress(System.Windows.Forms.KeyPressEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnKeyUp"> @@ -14880,7 +14880,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnKeyUp(System.Windows.Forms.KeyEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnKeyUp(System.Windows.Forms.KeyEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnLayout"> @@ -14924,7 +14924,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnLayout(System.Windows.Forms.LayoutEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnLayout(System.Windows.Forms.LayoutEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnLeave"> @@ -14972,7 +14972,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnLeave(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnLeave(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnLostFocus"> @@ -15055,7 +15055,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMouseClick(System.Windows.Forms.MouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMouseClick(System.Windows.Forms.MouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseDoubleClick"> @@ -15088,7 +15088,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseDoubleClick" /> event.</summary> <remarks>To be added.</remarks> <altmember cref="M:System.Windows.Forms.Control.OnMouseDoubleClick(System.Windows.Forms.MouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseDown"> @@ -15133,7 +15133,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMouseDown(System.Windows.Forms.MouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMouseDown(System.Windows.Forms.MouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseEnter"> @@ -15205,7 +15205,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x The <xref:System.Windows.Forms.DataGridView.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -15215,7 +15215,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMouseLeave(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMouseLeave(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseMove"> @@ -15259,7 +15259,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMouseMove(System.Windows.Forms.MouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMouseMove(System.Windows.Forms.MouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseUp"> @@ -15303,7 +15303,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnMouseWheel"> @@ -15379,7 +15379,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnMultiSelectChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnMultiSelectChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnNewRowNeeded"> @@ -15424,7 +15424,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnNewRowNeeded(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnNewRowNeeded(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnPaint"> @@ -15483,7 +15483,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnPaint(System.Windows.Forms.PaintEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnPaint(System.Windows.Forms.PaintEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnReadOnlyChanged"> @@ -15528,7 +15528,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnReadOnlyChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnReadOnlyChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnResize"> @@ -15572,7 +15572,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnResize(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnResize(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRightToLeftChanged"> @@ -15649,7 +15649,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowContextMenuStripChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowContextMenuStripChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowContextMenuStripNeeded"> @@ -15693,7 +15693,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowContextMenuStripNeeded(System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowContextMenuStripNeeded(System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowDefaultCellStyleChanged"> @@ -15739,8 +15739,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowDefaultCellStyleChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowDefaultCellStyleChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnRowDirtyStateNeeded"> @@ -15784,7 +15784,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowDirtyStateNeeded(System.Windows.Forms.QuestionEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowDirtyStateNeeded(System.Windows.Forms.QuestionEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowDividerDoubleClick"> @@ -15828,7 +15828,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowDividerDoubleClick(System.Windows.Forms.DataGridViewRowDividerDoubleClickEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowDividerDoubleClick(System.Windows.Forms.DataGridViewRowDividerDoubleClickEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowDividerHeightChanged"> @@ -15873,7 +15873,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowDividerHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowDividerHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowEnter"> @@ -15917,7 +15917,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowErrorTextChanged"> @@ -15962,7 +15962,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowEnter(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowErrorTextNeeded"> @@ -16007,7 +16007,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowErrorTextNeeded(System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowErrorTextNeeded(System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.RowErrorTextNeeded" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeaderCellChanged"> @@ -16052,7 +16052,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeaderCellChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowHeaderCellChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeaderMouseClick"> @@ -16084,7 +16084,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> that contains information about the mouse and the header cell that was clicked.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGridView.RowHeaderMouseClick" /> event.</summary> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeaderMouseDoubleClick"> @@ -16116,7 +16116,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> that contains information about the mouse and the header cell that was double-clicked.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGridView.RowHeaderMouseDoubleClick" /> event.</summary> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeadersBorderStyleChanged"> @@ -16160,7 +16160,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersBorderStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersBorderStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeadersDefaultCellStyleChanged"> @@ -16205,8 +16205,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersDefaultCellStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersDefaultCellStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnRowHeadersWidthChanged"> @@ -16250,7 +16250,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersWidthChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersWidthChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeadersWidthSizeModeChanged"> @@ -16294,7 +16294,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersWidthSizeModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowHeadersWidthSizeModeChanged(System.Windows.Forms.DataGridViewAutoSizeModeEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeightChanged"> @@ -16339,7 +16339,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeightInfoNeeded"> @@ -16383,7 +16383,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightInfoNeeded(System.Windows.Forms.DataGridViewRowHeightInfoNeededEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightInfoNeeded(System.Windows.Forms.DataGridViewRowHeightInfoNeededEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowHeightInfoPushed"> @@ -16427,7 +16427,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightInfoPushed(System.Windows.Forms.DataGridViewRowHeightInfoPushedEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowHeightInfoPushed(System.Windows.Forms.DataGridViewRowHeightInfoPushedEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowLeave"> @@ -16471,7 +16471,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowLeave(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowMinimumHeightChanged"> @@ -16516,7 +16516,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowMinimumHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowMinimumHeightChanged(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowPostPaint"> @@ -16560,7 +16560,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowPostPaint(System.Windows.Forms.DataGridViewRowPostPaintEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowPostPaint(System.Windows.Forms.DataGridViewRowPostPaintEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowPrePaint"> @@ -16604,7 +16604,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowPrePaint(System.Windows.Forms.DataGridViewRowPrePaintEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowPrePaint(System.Windows.Forms.DataGridViewRowPrePaintEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowsAdded"> @@ -16648,7 +16648,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowsAdded(System.Windows.Forms.DataGridViewRowsAddedEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowsAdded(System.Windows.Forms.DataGridViewRowsAddedEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowsDefaultCellStyleChanged"> @@ -16693,8 +16693,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowsDefaultCellStyleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowsDefaultCellStyleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnRowsRemoved"> @@ -16738,7 +16738,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowsRemoved(System.Windows.Forms.DataGridViewRowsRemovedEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnRowsRemoved(System.Windows.Forms.DataGridViewRowsRemovedEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowStateChanged"> @@ -16785,7 +16785,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowStateChanged(System.Int32,System.Windows.Forms.DataGridViewRowStateChangedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowStateChanged(System.Int32,System.Windows.Forms.DataGridViewRowStateChangedEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowUnshared"> @@ -16830,7 +16830,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowUnshared(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowUnshared(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowValidated"> @@ -16874,7 +16874,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowValidated(System.Windows.Forms.DataGridViewCellEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowValidated(System.Windows.Forms.DataGridViewCellEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnRowValidating"> @@ -16918,7 +16918,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnRowValidating(System.Windows.Forms.DataGridViewCellCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnRowValidating(System.Windows.Forms.DataGridViewCellCancelEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnScroll"> @@ -16962,7 +16962,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnScroll(System.Windows.Forms.ScrollEventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnScroll(System.Windows.Forms.ScrollEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSelectionChanged"> @@ -17006,7 +17006,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnSelectionChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnSelectionChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSortCompare"> @@ -17051,7 +17051,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnSortCompare(System.Windows.Forms.DataGridViewSortCompareEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnSortCompare(System.Windows.Forms.DataGridViewSortCompareEventArgs)" /> method so that registered delegates receive the event.</para> </block> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnSorted"> @@ -17095,7 +17095,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnSorted(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.DataGridView.OnSorted(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnUserAddedRow"> @@ -17140,7 +17140,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnUserAddedRow(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnUserAddedRow(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnUserDeletedRow"> @@ -17184,7 +17184,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnUserDeletedRow(System.Windows.Forms.DataGridViewRowEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnUserDeletedRow(System.Windows.Forms.DataGridViewRowEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnUserDeletingRow"> @@ -17228,7 +17228,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnUserDeletingRow(System.Windows.Forms.DataGridViewRowCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnUserDeletingRow(System.Windows.Forms.DataGridViewRowCancelEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnValidating"> @@ -17275,7 +17275,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.DataGridView.OnValidating(System.ComponentModel.CancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.DataGridView.OnValidating(System.ComponentModel.CancelEventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="OnVisibleChanged"> @@ -17361,7 +17361,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="PaddingChanged"> @@ -17422,7 +17422,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridView.Padding" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="PaintBackground"> @@ -17466,7 +17466,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessAKey"> @@ -17507,7 +17507,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessControlShiftF10Keys"> @@ -17595,7 +17595,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding this method, a control should return <see langword="true" /> to indicate that it has processed the key. For keys that are not processed by the control, return the result of the base version of this method.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessDeleteKey"> @@ -17637,7 +17637,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.Exception">The DELETE key would delete one or more rows, but an error in the data source prevents the deletion and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessDialogKey"> @@ -17691,7 +17691,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding this method, a control should return <see langword="true" /> to indicate that it has processed the key. For keys that are not processed by the control, return the result of the base version of this method.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessDownKey"> @@ -17727,7 +17727,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The DOWN ARROW key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessEndKey"> @@ -17763,7 +17763,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The END key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessEnterKey"> @@ -17799,7 +17799,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The ENTER key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessEscapeKey"> @@ -17833,7 +17833,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <returns> <see langword="true" /> if the key was processed; otherwise, <see langword="false" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessF2Key"> @@ -17869,7 +17869,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The F2 key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">The F2 key would cause the control to enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessF3Key"> @@ -17937,7 +17937,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The HOME key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessInsertKey"> @@ -17971,7 +17971,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <returns> <see langword="true" /> if the key was processed; otherwise, <see langword="false" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessKeyEventArgs"> @@ -18017,7 +18017,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding this method, a control should return <see langword="true" /> to indicate that it has processed the message. For messages that are not processed by the control, return the result of the base version of this method.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessKeyPreview"> @@ -18063,7 +18063,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <block subset="none" type="overrides"> <para>When overriding this method, a control should return <see langword="true" /> to indicate that it has processed the message. For messages that are not processed by the control, return the result of the base version of this method.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessLeftKey"> @@ -18099,7 +18099,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The LEFT ARROW key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessNextKey"> @@ -18135,7 +18135,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The PAGE DOWN key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessPriorKey"> @@ -18171,7 +18171,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The PAGE UP key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessRightKey"> @@ -18217,7 +18217,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.InvalidCastException">The RIGHT ARROW key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessSpaceKey"> @@ -18251,7 +18251,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <returns> <see langword="true" /> if the key was processed; otherwise, <see langword="false" />.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessTabKey"> @@ -18287,7 +18287,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The TAB key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessUpKey"> @@ -18323,7 +18323,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The UP ARROW key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the new current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ProcessZeroKey"> @@ -18359,7 +18359,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <remarks>To be added.</remarks> <exception cref="T:System.InvalidCastException">The 0 key would cause the control to enter edit mode, but the <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property of the current cell does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> <exception cref="T:System.Exception">This action would cause the control to enter edit mode, but an error in the data source prevents the action and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ReadOnly"> @@ -18414,7 +18414,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.InvalidOperationException">The specified value when setting this property is <see langword="true" />, the current cell is in edit mode, and the current cell contains changes that cannot be committed.</exception> <exception cref="T:System.Exception">The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the <see cref="E:System.Windows.Forms.DataGridView.DataError" /> event or the handler has set the <see cref="P:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException" /> property to <see langword="true" />. The exception object can typically be cast to type <see cref="T:System.FormatException" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ReadOnlyChanged"> @@ -18464,7 +18464,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RefreshEdit"> @@ -18502,7 +18502,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ResetText"> @@ -18594,7 +18594,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowContextMenuStripNeeded"> @@ -18664,7 +18664,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs.ContextMenuStrip" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ContextMenuStrip" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnRowContextMenuStripNeeded(System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowCount"> @@ -18741,7 +18741,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x The specified value is less than 1 and <see cref="P:System.Windows.Forms.DataGridView.AllowUserToAddRows" /> is set to <see langword="true" />.</exception> <exception cref="T:System.InvalidOperationException">When setting this property, the <see cref="P:System.Windows.Forms.DataGridView.DataSource" /> property is set.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowDefaultCellStyleChanged"> @@ -18794,8 +18794,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowDirtyStateNeeded"> @@ -18842,7 +18842,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to handle this event to provide cell-level commit scope, meaning that the user can revert changes to the current cell only. In cell-level commit scope, the row is treated as having uncommitted changes only when the current cell has uncommitted changes, rather than when any cell in the row has uncommitted changes. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control). + The following code example demonstrates how to handle this event to provide cell-level commit scope, meaning that the user can revert changes to the current cell only. In cell-level commit scope, the row is treated as having uncommitted changes only when the current cell has uncommitted changes, rather than when any cell in the row has uncommitted changes. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/implementing-virtual-mode-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet160"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet160"::: @@ -18850,7 +18850,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowDividerDoubleClick"> @@ -18904,7 +18904,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowDividerHeightChanged"> @@ -18956,7 +18956,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowEnter"> @@ -19008,7 +19008,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowErrorTextChanged"> @@ -19058,7 +19058,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowErrorTextNeeded"> @@ -19130,7 +19130,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ErrorText" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnRowErrorTextNeeded(System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeaderCellChanged"> @@ -19180,7 +19180,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeaderMouseClick"> @@ -19228,7 +19228,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeaderMouseDoubleClick"> @@ -19278,7 +19278,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersBorderStyle"> @@ -19341,7 +19341,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x <altmember cref="P:System.Windows.Forms.DataGridView.ColumnHeadersBorderStyle" /> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> <altmember cref="P:System.Windows.Forms.DataGridView.EnableHeadersVisualStyles" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersBorderStyleChanged"> @@ -19391,7 +19391,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersDefaultCellStyle"> @@ -19443,7 +19443,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x These values automatically override the values set through the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. To force row headers to inherit the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> values, you must set the values in the <xref:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle%2A> object to the default values indicated for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ## Examples The following code example illustrates how to use this property in a <xref:System.Windows.Forms.DataGridView> with custom colors. Note how the <xref:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor%2A?displayProperty=nameWithType> property is set to <xref:System.Drawing.Color.Empty?displayProperty=nameWithType> so that the value is inherited from the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> object. @@ -19456,8 +19456,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowHeadersDefaultCellStyleChanged"> @@ -19510,8 +19510,8 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowHeadersVisible"> @@ -19562,7 +19562,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The specified value when setting this property is <see langword="false" /> and the <see cref="P:System.Windows.Forms.DataGridView.AutoSizeRowsMode" /> property is set to <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllHeaders" /> or <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedHeaders" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersWidth"> @@ -19609,7 +19609,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ## Examples The following code example illustrates how to use the <xref:System.Windows.Forms.DataGridView.RowHeadersWidth%2A> property in a row-painting scenario. In the example, the value of this property is used to calculate the bounds within which a custom background is drawn. - This code is part of a larger example available in[How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in[How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: @@ -19618,7 +19618,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is less than the minimum width of 4 pixels or is greater than the maximum width of 32768 pixels.</exception> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeRowHeadersWidth" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersWidthChanged"> @@ -19668,7 +19668,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersWidthSizeMode"> @@ -19724,7 +19724,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x To set the sizing mode for the column headers, use the <xref:System.Windows.Forms.DataGridView.ColumnHeadersHeightSizeMode%2A> property. - For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The <xref:System.Windows.Forms.DataGridView> control does not support double buffering. If <xref:System.Windows.Forms.Control.DoubleBuffered%2A> is set to `true` in a derived <xref:System.Windows.Forms.DataGridView> control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -19738,7 +19738,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeadersWidthSizeModeChanged"> @@ -19788,7 +19788,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeightChanged"> @@ -19829,14 +19829,14 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example illustrates the use of this event. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet40"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet40"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeightInfoNeeded"> @@ -19893,7 +19893,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.DataGridView.RowHeightInfoPushed" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowHeightInfoPushed"> @@ -19950,7 +19950,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.DataGridView.RowHeightInfoNeeded" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowLeave"> @@ -19998,7 +19998,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowMinimumHeightChanged"> @@ -20048,7 +20048,7 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowPostPaint"> @@ -20098,19 +20098,19 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x - <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.PaintHeader%2A> - You can also use the <xref:System.Windows.Forms.VisualStyles.VisualStyleRenderer> class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. + You can also use the <xref:System.Windows.Forms.VisualStyles.VisualStyleRenderer> class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.DataGridView.RowPostPaint> event to paint textual content that spans the entire row below the normal cell values. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.DataGridView.RowPostPaint> event to paint textual content that spans the entire row below the normal cell values. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowPrePaint"> @@ -20160,19 +20160,19 @@ The <xref:System.Windows.Forms.DataGridView> control replaces and extends the <x - <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintHeader%2A> - You can also use the <xref:System.Windows.Forms.VisualStyles.VisualStyleRenderer> class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. + You can also use the <xref:System.Windows.Forms.VisualStyles.VisualStyleRenderer> class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the <xref:System.Windows.Forms.DataGridView> control. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.DataGridView.RowPrePaint> event to paint a gradient row background if the row is selected. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.DataGridView.RowPrePaint> event to paint a gradient row background if the row is selected. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Rows"> @@ -20225,7 +20225,7 @@ this.dataGridView1.Rows.Add("five", "six", "seven", "eight");this.dataGridView1. Rows include style information in addition to cell values. For this reason, you might want to add or insert rows based on existing rows that you have already styled. You can do this using the <xref:System.Windows.Forms.DataGridViewRowCollection.AddCopy%2A>, <xref:System.Windows.Forms.DataGridViewRowCollection.AddCopies%2A>, <xref:System.Windows.Forms.DataGridViewRowCollection.InsertCopy%2A>, and <xref:System.Windows.Forms.DataGridViewRowCollection.InsertCopies%2A> methods. - You can also use the <xref:System.Windows.Forms.DataGridView.Rows%2A> collection to modify the values in the control or to remove rows. You can modify values or remove rows regardless of whether the control is bound to an external data source. If there is a data source, the changes are made directly to the data source. You may still need to push the data source updates to a remote database, however. For more information, see [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control). + You can also use the <xref:System.Windows.Forms.DataGridView.Rows%2A> collection to modify the values in the control or to remove rows. You can modify values or remove rows regardless of whether the control is bound to an external data source. If there is a data source, the changes are made directly to the data source. You may still need to push the data source updates to a remote database, however. For more information, see [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control). The following example shows you how to modify cell values programmatically. @@ -20279,7 +20279,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowsAdded"> @@ -20339,7 +20339,7 @@ if (rowToDelete > -1) <altmember cref="P:System.Windows.Forms.DataGridViewRowsAddedEventArgs.RowIndex" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnRowsAdded(System.Windows.Forms.DataGridViewRowsAddedEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowsDefaultCellStyle"> @@ -20373,7 +20373,7 @@ if (rowToDelete > -1) ## Remarks The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. For cells in all rows, excluding header cells, the styles specified through the <xref:System.Windows.Forms.DataGridView.RowsDefaultCellStyle%2A> property override the styles specified through the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> and <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A?displayProperty=nameWithType> properties, and are overridden by the styles specified through the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A>, <xref:System.Windows.Forms.DataGridViewRow.DefaultCellStyle%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataGridViewCell.Style%2A?displayProperty=nameWithType> properties. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a <xref:System.Windows.Forms.DataGridViewCellStyle> with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single <xref:System.Windows.Forms.DataGridViewCellStyle> to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -20386,8 +20386,8 @@ if (rowToDelete > -1) ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowsDefaultCellStyleChanged"> @@ -20440,8 +20440,8 @@ if (rowToDelete > -1) ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowsRemoved"> @@ -20494,7 +20494,7 @@ if (rowToDelete > -1) <altmember cref="T:System.Windows.Forms.DataGridViewRowsRemovedEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowsRemovedEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnRowsRemoved(System.Windows.Forms.DataGridViewRowsRemovedEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowStateChanged"> @@ -20544,7 +20544,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowTemplate"> @@ -20608,7 +20608,7 @@ if (rowToDelete > -1) ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The specified row when setting this property has its <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property set.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowUnshared"> @@ -20664,7 +20664,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowValidated"> @@ -20714,7 +20714,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="RowValidating"> @@ -20764,7 +20764,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Scroll"> @@ -20814,7 +20814,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ScrollBars"> @@ -20866,7 +20866,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.ScrollBars" /> value.</exception> <exception cref="T:System.InvalidOperationException">The value of this property cannot be set because the <see cref="T:System.Windows.Forms.DataGridView" /> is unable to scroll due to a cell change that cannot be committed or canceled.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectAll"> @@ -20910,7 +20910,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectedCells"> @@ -20960,7 +20960,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectedColumns"> @@ -21010,7 +21010,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectedRows"> @@ -21063,7 +21063,7 @@ if (rowToDelete > -1) ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridViewRow.Selected" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectionChanged"> @@ -21118,7 +21118,7 @@ if (rowToDelete > -1) <altmember cref="P:System.Windows.Forms.DataGridView.CurrentCell" /> <altmember cref="E:System.Windows.Forms.DataGridView.SelectionChanged" /> <altmember cref="E:System.Windows.Forms.DataGridView.CurrentCellChanged" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SelectionMode"> @@ -21177,7 +21177,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.DataGridViewSelectionMode" /> value.</exception> <exception cref="T:System.InvalidOperationException">The specified value when setting this property is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" /> and the <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property of one or more columns is set to <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SetBoundsCore"> @@ -21218,7 +21218,7 @@ if (rowToDelete > -1) <summary>This member overrides <see cref="M:System.Windows.Forms.Control.SetBoundsCore(System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Forms.BoundsSpecified)" />.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentOutOfRangeException">One or both of the width or height values exceeds the maximum value of 8,388,607.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SetCurrentCellAddressCore"> @@ -21284,7 +21284,7 @@ if (rowToDelete > -1) This method was called for a reason other than the underlying data source being reset, and another thread is currently executing this method.</exception> <exception cref="T:System.InvalidCastException">The new current cell tried to enter edit mode, but its <see cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> property does not indicate a class that derives from <see cref="T:System.Windows.Forms.Control" /> and implements <see cref="T:System.Windows.Forms.IDataGridViewEditingControl" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SetSelectedCellCore"> @@ -21334,7 +21334,7 @@ if (rowToDelete > -1) -or- <paramref name="rowIndex" /> is less than 0 or greater than the number of rows in the control minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SetSelectedColumnCore"> @@ -21378,7 +21378,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="columnIndex" /> is less than 0 or greater than the number of columns in the control minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SetSelectedRowCore"> @@ -21422,7 +21422,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is less than 0 or greater than the number of rows in the control minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ShowCellErrors"> @@ -21458,7 +21458,7 @@ if (rowToDelete > -1) <value> <see langword="true" /> if a red glyph will appear in a cell that fails validation; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ShowCellToolTips"> @@ -21512,7 +21512,7 @@ if (rowToDelete > -1) <altmember cref="E:System.Windows.Forms.DataGridView.CellToolTipTextNeeded" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs.ToolTipText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ToolTipText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ShowEditingIcon"> @@ -21559,7 +21559,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="ShowRowErrors"> @@ -21616,7 +21616,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="Sort"> @@ -21682,7 +21682,7 @@ if (rowToDelete > -1) -or- <see cref="P:System.Windows.Forms.DataGridView.DataSource" /> is not <see langword="null" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Sort"> @@ -21727,7 +21727,7 @@ if (rowToDelete > -1) When the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property has been set, this method works for data-bound columns only. Data-bound columns have had their <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A?displayProperty=nameWithType> property set. This causes the <xref:System.Windows.Forms.DataGridViewColumn.IsDataBound%2A?displayProperty=nameWithType> property to return `true`. - If your <xref:System.Windows.Forms.DataGridView> control contains both bound and unbound columns, you must implement virtual mode to maintain the values of the unbound columns when the control is sorted by a bound column. You can do this by setting the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property to `true` and handling the <xref:System.Windows.Forms.DataGridView.CellValueNeeded> event. If the column is editable, you should also handle the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event. For more information about virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). Sorting by unbound columns when the control is data-bound is not supported. + If your <xref:System.Windows.Forms.DataGridView> control contains both bound and unbound columns, you must implement virtual mode to maintain the values of the unbound columns when the control is sorted by a bound column. You can do this by setting the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property to `true` and handling the <xref:System.Windows.Forms.DataGridView.CellValueNeeded> event. If the column is editable, you should also handle the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event. For more information about virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). Sorting by unbound columns when the control is data-bound is not supported. ## Examples The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridView.Sort%2A> in a programmatic sort. @@ -21753,7 +21753,7 @@ if (rowToDelete > -1) -or- The object specified by the <see cref="P:System.Windows.Forms.DataGridView.DataSource" /> property has a <see cref="P:System.ComponentModel.IBindingList.SupportsSorting" /> property value of <see langword="false" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SortCompare"> @@ -21804,7 +21804,7 @@ if (rowToDelete > -1) For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridView.SortCompare> in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridView.SortCompare> in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: @@ -21816,8 +21816,8 @@ if (rowToDelete > -1) <altmember cref="M:System.Windows.Forms.DataGridView.OnSortCompare(System.Windows.Forms.DataGridViewSortCompareEventArgs)" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Sorted"> @@ -21869,7 +21869,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SortedColumn"> @@ -21933,7 +21933,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="SortOrder"> @@ -21988,7 +21988,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="StandardTab"> @@ -22041,7 +22041,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="StyleChanged"> @@ -22093,7 +22093,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="System.ComponentModel.ISupportInitialize.BeginInit"> @@ -22134,7 +22134,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.InvalidOperationException">This method has already been called for this control.</exception> <altmember cref="T:System.ComponentModel.ISupportInitialize" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="System.ComponentModel.ISupportInitialize.EndInit"> @@ -22174,7 +22174,7 @@ if (rowToDelete > -1) ]]></format> </remarks> <altmember cref="T:System.ComponentModel.ISupportInitialize" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="Text"> @@ -22224,7 +22224,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="TextChanged"> @@ -22274,7 +22274,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="TopLeftHeaderCell"> @@ -22333,7 +22333,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UpdateCellErrorText"> @@ -22382,7 +22382,7 @@ if (rowToDelete > -1) -or- <paramref name="rowIndex" /> is less than -1 or greater than the number of rows in the control minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UpdateCellValue"> @@ -22431,7 +22431,7 @@ if (rowToDelete > -1) -or- <paramref name="rowIndex" /> is less than zero or greater than the number of rows in the control minus one.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <MemberGroup MemberName="UpdateRowErrorText"> @@ -22481,7 +22481,7 @@ if (rowToDelete > -1) </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is not in the valid range of 0 to the number of rows in the control minus 1.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UpdateRowErrorText"> @@ -22532,7 +22532,7 @@ if (rowToDelete > -1) -or- <paramref name="rowIndexEnd" /> is less than <paramref name="rowIndexStart" />.</exception> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UpdateRowHeightInfo"> @@ -22592,7 +22592,7 @@ if (rowToDelete > -1) <paramref name="rowIndex" /> is greater than the highest row index in the <see cref="P:System.Windows.Forms.DataGridView.Rows" /> collection.</exception> <altmember cref="E:System.Windows.Forms.DataGridView.RowHeightInfoNeeded" /> <altmember cref="E:System.Windows.Forms.DataGridView.RowHeightInfoPushed" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UserAddedRow"> @@ -22640,7 +22640,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UserDeletedRow"> @@ -22690,7 +22690,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UserDeletingRow"> @@ -22740,7 +22740,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="UserSetCursor"> @@ -22793,7 +22793,7 @@ if (rowToDelete > -1) </remarks> <altmember cref="P:System.Windows.Forms.Control.Cursor" /> <altmember cref="T:System.Windows.Forms.Cursor" /> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="VerticalScrollBar"> @@ -22828,7 +22828,7 @@ if (rowToDelete > -1) <summary>Gets the vertical scroll bar of the control.</summary> <value>A <see cref="T:System.Windows.Forms.ScrollBar" /> representing the vertical scroll bar.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="VerticalScrollingOffset"> @@ -22875,7 +22875,7 @@ if (rowToDelete > -1) <summary>Gets the number of pixels by which the control is scrolled vertically.</summary> <value>The number of pixels by which the control is scrolled vertically.</value> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="VirtualMode"> @@ -22918,7 +22918,7 @@ if (rowToDelete > -1) <format type="text/markdown"><. + Virtual mode is designed for use with very large stores of data. When the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> property is `true`, you create a <xref:System.Windows.Forms.DataGridView> with a set number of rows and columns and then handle the <xref:System.Windows.Forms.DataGridView.CellValueNeeded> event to populate the cells. Virtual mode requires implementation of an underlying data cache to handle the population, editing, and deletion of <xref:System.Windows.Forms.DataGridView> cells based on actions of the user. For more information about implementing virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). You must use virtual mode to maintain the values of unbound columns when the <xref:System.Windows.Forms.DataGridView> control is in bound mode. Sorting by unbound columns in bound mode is not supported. @@ -22930,7 +22930,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> <Member MemberName="WndProc"> @@ -22969,7 +22969,7 @@ if (rowToDelete > -1) ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-windows-forms">DataGridView Control (Windows Forms)</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml index 1c93c13ef7f..58e5815addb 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml @@ -22,27 +22,27 @@ <Docs> <summary>Defines values for specifying how the width of a column is adjusted.</summary> <remarks> - <format type="text/markdown"><. For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration to configure a fixed-width column. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration to configure a fixed-width column. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -51,9 +51,9 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeColumn" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeColumns" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control">How to: Set the Sizing Modes of the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control">How to: Set the Sizing Modes of the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AllCells"> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml index a0dd3b18de9..aadd346fdef 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml @@ -29,22 +29,22 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -54,7 +54,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventHandler" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -97,7 +97,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Column"> @@ -133,15 +133,15 @@ <summary>Gets the column with the <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> property that changed.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewColumn" /> with the <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> property that changed.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -149,7 +149,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="PreviousMode"> @@ -184,23 +184,23 @@ <summary>Gets the previous value of the <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> property of the column.</summary> <value>An <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> value representing the previous value of the <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> property of the <see cref="P:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs.Column" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet280"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet280"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet280"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml index 7a7a6cf94b0..d1851600107 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml @@ -39,13 +39,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.AutoSizeColumnModeChanged" /> event of a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -54,6 +54,6 @@ <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml index 886770349f7..774999d58b6 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml @@ -22,27 +22,27 @@ <Docs> <summary>Defines values for specifying how the widths of columns are adjusted.</summary> <remarks> - <format type="text/markdown"><. For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration in a master/details scenario where two <xref:System.Windows.Forms.DataGridView> controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is None and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/create-a-master-detail-form-using-two-datagridviews). - + <format type="text/markdown"><. For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration in a master/details scenario where two <xref:System.Windows.Forms.DataGridView> controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is None and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/create-a-master-detail-form-using-two-datagridviews). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeColumnsMode/masterdetails.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -51,8 +51,8 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeColumns" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AllCells"> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml index f1fadd15871..603d7859ff3 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml @@ -29,23 +29,23 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet257"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -55,7 +55,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventHandler" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnsModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -97,7 +97,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnAutoSizeColumnsModeChanged(System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="PreviousModes"> @@ -133,16 +133,16 @@ <summary>Gets an array of the previous values of the column <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> properties.</summary> <value>An array of <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> values representing the previous values of the column <see cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> properties.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet257"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -150,7 +150,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml index 88b51b8dc5e..05af8a404cf 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml @@ -39,13 +39,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.AutoSizeColumnsModeChanged" /> event of a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -54,6 +54,6 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnsModeEventArgs" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml index 8161cb7a369..2942f553ca9 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml @@ -23,22 +23,22 @@ <Docs> <summary>Provides data for the <see cref="T:System.Windows.Forms.DataGridView" /><see cref="E:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged" /> and <see cref="E:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged" /> events.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to process the <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged> event. This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to process the <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged> event. This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -49,7 +49,7 @@ <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeModeEventHandler" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -85,11 +85,11 @@ <see langword="true" /> if the <see cref="P:System.Windows.Forms.DataGridView.AutoSizeRowsMode" /> property was previously set to any <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> value other than <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.None" /> or the <see cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> property was previously set to any <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value other than <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" />; otherwise, <see langword="false" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewAutoSizeModeEventArgs" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When implementing a source for <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged?displayProperty=nameWithType> and <xref:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged?displayProperty=nameWithType> events, pass in `true` for `previousModeAutoSized` if the <xref:System.Windows.Forms.DataGridView> already had an automatic resizing mode and the new mode is different. Otherwise, pass in `false` for `previousModeAutoSized`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When implementing a source for <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged?displayProperty=nameWithType> and <xref:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged?displayProperty=nameWithType> events, pass in `true` for `previousModeAutoSized` if the <xref:System.Windows.Forms.DataGridView> already had an automatic resizing mode and the new mode is different. Otherwise, pass in `false` for `previousModeAutoSized`. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -99,7 +99,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged" /> <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="PreviousModeAutoSized"> @@ -135,20 +135,20 @@ <value> <see langword="true" /> if the <see cref="P:System.Windows.Forms.DataGridView.AutoSizeRowsMode" /> property was previously set to any <see cref="T:System.Windows.Forms.DataGridViewAutoSizeRowsMode" /> value other than <see cref="F:System.Windows.Forms.DataGridViewAutoSizeRowsMode.None" /> or the <see cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> property was previously set to any <see cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> value other than <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing" /> or <see cref="F:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing" />; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -158,7 +158,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged" /> <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml index abcbc726052..ab83fc0350d 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml @@ -39,22 +39,22 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewAutoSizeModeEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged" /> or <see cref="E:System.Windows.Forms.DataGridView.RowHeadersWidthSizeModeChanged" /> events of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.AutoSizeRowsModeChanged> event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -65,6 +65,6 @@ <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeModeEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml index 6426fa2a3ef..d21e82a57ae 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml @@ -22,32 +22,32 @@ <Docs> <summary>Defines values for specifying how the height of a row is adjusted.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example resizes the third row in the control to fit the contents of its nonheader cells. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following code example resizes the third row in the control to fit the contents of its nonheader cells. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/VB/programmaticsizing.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/VB/programmaticsizing.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeRow" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid">How to: Programmatically Resize Cells To Fit Content in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid">How to: Programmatically Resize Cells To Fit Content in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AllCells"> diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml index 0b24424b25f..30e4bcd155f 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml @@ -22,33 +22,33 @@ <Docs> <summary>Defines values for specifying how the heights of rows are adjusted.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example sets rows to automatically resize their height whenever cell contents change. The new row height is determined from the contents of all rows and columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following code example sets rows to automatically resize their height whenever cell contents change. The new row height is determined from the contents of all rows and columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet9"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.AutoSizeRowsMode" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeRows" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid">How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid">How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AllCells"> diff --git a/xml/System.Windows.Forms/DataGridViewBand.xml b/xml/System.Windows.Forms/DataGridViewBand.xml index 38f0733ca3f..67a837deaa1 100644 --- a/xml/System.Windows.Forms/DataGridViewBand.xml +++ b/xml/System.Windows.Forms/DataGridViewBand.xml @@ -227,7 +227,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DefaultHeaderCellType"> @@ -571,7 +571,7 @@ ## Remarks Getting the value of the <xref:System.Windows.Forms.DataGridViewBand.DefaultCellStyle%2A> property automatically instantiates a new <xref:System.Windows.Forms.DataGridViewCellStyle> if the property has not previously been accessed. You must, therefore, use the <xref:System.Windows.Forms.DataGridViewBand.HasDefaultCellStyle%2A> property to determine whether the <xref:System.Windows.Forms.DataGridViewBand.DefaultCellStyle%2A> property is currently set to a <xref:System.Windows.Forms.DataGridViewCellStyle> instance. This is useful to determine which properties of the object returned by the <xref:System.Windows.Forms.DataGridViewBand.InheritedStyle%2A> property represent styles set specifically for the band. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -737,7 +737,7 @@ ## Remarks The implementation of this property in the <xref:System.Windows.Forms.DataGridViewBand> class always returns `null` because this base class cannot contain elements. - For more information about style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -745,7 +745,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsRow"> diff --git a/xml/System.Windows.Forms/DataGridViewButtonCell.xml b/xml/System.Windows.Forms/DataGridViewButtonCell.xml index e9fded1fa7f..2f9fd878f8a 100644 --- a/xml/System.Windows.Forms/DataGridViewButtonCell.xml +++ b/xml/System.Windows.Forms/DataGridViewButtonCell.xml @@ -50,7 +50,7 @@ ## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to perform actions on particular rows. You can use similar code when working with individual <xref:System.Windows.Forms.DataGridViewButtonCell> objects. In this example, a <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to perform actions on particular rows. You can use similar code when working with individual <xref:System.Windows.Forms.DataGridViewButtonCell> objects. In this example, a <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: @@ -469,7 +469,7 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyDownUnsharesRow"> @@ -517,7 +517,7 @@ <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyUpUnsharesRow"> @@ -565,7 +565,7 @@ <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseDownUnsharesRow"> @@ -611,7 +611,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseEnterUnsharesRow"> @@ -656,7 +656,7 @@ </remarks> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseEnter(System.Int32)" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseLeaveUnsharesRow"> @@ -702,7 +702,7 @@ <altmember cref="T:System.Windows.Forms.ButtonState" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnMouseLeave(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseUpUnsharesRow"> @@ -748,7 +748,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnKeyDown"> @@ -801,7 +801,7 @@ <altmember cref="E:System.Windows.Forms.Control.KeyDown" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="F:System.Windows.Forms.Keys.Space" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnKeyUp"> @@ -856,7 +856,7 @@ <altmember cref="E:System.Windows.Forms.Control.KeyUp" /> <altmember cref="M:System.Windows.Forms.DataGridViewButtonCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="F:System.Windows.Forms.Keys.Space" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnLeave"> diff --git a/xml/System.Windows.Forms/DataGridViewButtonColumn.xml b/xml/System.Windows.Forms/DataGridViewButtonColumn.xml index aace3ec98f6..c3c65dda4b1 100644 --- a/xml/System.Windows.Forms/DataGridViewButtonColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewButtonColumn.xml @@ -41,28 +41,28 @@ <Docs> <summary>Hosts a collection of <see cref="T:System.Windows.Forms.DataGridViewButtonCell" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewButtonColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that respond to simple user input. A <xref:System.Windows.Forms.DataGridViewButtonColumn> has an associated <xref:System.Windows.Forms.DataGridViewButtonCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell supplies a user interface (UI) that is similar to a <xref:System.Windows.Forms.Button> control. - - To display the same button text for every cell, set the <xref:System.Windows.Forms.DataGridViewButtonColumn.UseColumnTextForButtonValue%2A> property to `true` and set the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property to the desired button text. - - The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. - - To respond to user button clicks, handle the <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> or <xref:System.Windows.Forms.DataGridView.CellContentClick?displayProperty=nameWithType> event. In the event handler, you can use the <xref:System.Windows.Forms.DataGridViewCellEventArgs.ColumnIndex%2A?displayProperty=nameWithType> property to determine whether the click occurred in the button column. You can use the <xref:System.Windows.Forms.DataGridViewCellEventArgs.RowIndex%2A?displayProperty=nameWithType> property to determine whether the click occurred in a button cell and not on the column header. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewButtonColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that respond to simple user input. A <xref:System.Windows.Forms.DataGridViewButtonColumn> has an associated <xref:System.Windows.Forms.DataGridViewButtonCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell supplies a user interface (UI) that is similar to a <xref:System.Windows.Forms.Button> control. + + To display the same button text for every cell, set the <xref:System.Windows.Forms.DataGridViewButtonColumn.UseColumnTextForButtonValue%2A> property to `true` and set the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property to the desired button text. + + The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. + + To respond to user button clicks, handle the <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> or <xref:System.Windows.Forms.DataGridView.CellContentClick?displayProperty=nameWithType> event. In the event handler, you can use the <xref:System.Windows.Forms.DataGridViewCellEventArgs.ColumnIndex%2A?displayProperty=nameWithType> property to determine whether the click occurred in the button column. You can use the <xref:System.Windows.Forms.DataGridViewCellEventArgs.RowIndex%2A?displayProperty=nameWithType> property to determine whether the click occurred in a button cell and not on the column header. + > [!NOTE] -> When visual styles are enabled, the buttons in a button column are painted using a <xref:System.Windows.Forms.ButtonRenderer>, and cell styles specified through properties such as <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> have no effect. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to perform actions on particular rows. In this example, a <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). - +> When visual styles are enabled, the buttons in a button column are painted using a <xref:System.Windows.Forms.ButtonRenderer>, and cell styles specified through properties such as <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> have no effect. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to perform actions on particular rows. In this example, a <xref:System.Windows.Forms.DataGridView.CellClick?displayProperty=nameWithType> event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -75,7 +75,7 @@ <altmember cref="T:System.Windows.Forms.Button" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellClick" /> - <related type="Article" href="/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid">How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid">How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -100,16 +100,16 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewButtonColumn" /> class to the default state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the column by setting the following properties. - -|Property|Value| -|--------------|-----------| -|<xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewButtonCell>.| -|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the column by setting the following properties. + +|Property|Value| +|--------------|-----------| +|<xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewButtonCell>.| +|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -161,23 +161,23 @@ <summary>Gets or sets the template used to create new cells.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCell" /> that all other cells in the column are modeled after.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The constructor for the <xref:System.Windows.Forms.DataGridViewButtonColumn> class initializes this property to a newly created <xref:System.Windows.Forms.DataGridViewButtonCell>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The constructor for the <xref:System.Windows.Forms.DataGridViewButtonColumn> class initializes this property to a newly created <xref:System.Windows.Forms.DataGridViewButtonCell>. + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. A cell template is used to apply the same color to all buttons. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. A cell template is used to apply the same color to all buttons. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.InvalidCastException">The specified value when setting this property could not be cast to a <see cref="T:System.Windows.Forms.DataGridViewButtonCell" />.</exception> @@ -215,11 +215,11 @@ <summary>Creates an exact copy of this column.</summary> <returns>An <see cref="T:System.Object" /> that represents the cloned <see cref="T:System.Windows.Forms.DataGridViewButtonColumn" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to duplicate a column of button cells. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to duplicate a column of button cells. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -266,28 +266,28 @@ <summary>Gets or sets the column's default cell style.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be applied as the default style.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + > [!NOTE] -> When visual styles are enabled, the buttons in a button column are painted using a <xref:System.Windows.Forms.ButtonRenderer> and cell styles specified through properties such as <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> have no effect. - - - -## Examples - The following code example demonstrates the use of this property. - +> When visual styles are enabled, the buttons in a button column are painted using a <xref:System.Windows.Forms.ButtonRenderer> and cell styles specified through properties such as <xref:System.Windows.Forms.DataGridViewButtonColumn.DefaultCellStyle%2A> have no effect. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="FlatStyle"> @@ -334,22 +334,22 @@ <summary>Gets or sets the flat-style appearance of the button cells in the column.</summary> <value>A <see cref="T:System.Windows.Forms.FlatStyle" /> value indicating the appearance of the buttons in the column. The default is <see cref="F:System.Windows.Forms.FlatStyle.Standard" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewButtonColumn.FlatStyle%2A> property specifies the appearance of the cells in the column. For more information, see the <xref:System.Windows.Forms.FlatStyle> enumeration. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewButtonCell.FlatStyle%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewButtonCell.FlatStyle%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewButtonColumn.FlatStyle%2A> property specifies the appearance of the cells in the column. For more information, see the <xref:System.Windows.Forms.FlatStyle> enumeration. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewButtonCell.FlatStyle%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewButtonCell.FlatStyle%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -397,22 +397,22 @@ <summary>Gets or sets the default text displayed on the button cell.</summary> <value>A <see cref="T:System.String" /> that contains the text. The default is <see cref="F:System.String.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each <xref:System.Windows.Forms.DataGridViewButtonCell> contained in the column that has as a <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property value of `true` displays the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property value on the cell's button. - - If there is an associated <xref:System.Windows.Forms.DataGridView> control, changing this property refreshes the column display. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. The <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property is used to set the column header. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each <xref:System.Windows.Forms.DataGridViewButtonCell> contained in the column that has as a <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property value of `true` displays the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property value on the cell's button. + + If there is an associated <xref:System.Windows.Forms.DataGridView> control, changing this property refreshes the column display. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewButtonColumn> to view the sales an employee has made. The <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property is used to set the column header. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">When setting this property, the value of the <see cref="P:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -498,21 +498,21 @@ <value> <see langword="true" /> if the <see cref="P:System.Windows.Forms.DataGridViewButtonColumn.Text" /> property value is displayed on buttons in the column; <see langword="false" /> if the <see cref="P:System.Windows.Forms.DataGridViewCell.FormattedValue" /> property value of each cell is displayed on its button. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A?displayProperty=nameWithType> of a button cell is displayed as the text on the button. The <xref:System.Windows.Forms.DataGridViewButtonColumn.UseColumnTextForButtonValue%2A> property allows you to either set the button text for each cell, or to use the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property value for all of the button cells. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A?displayProperty=nameWithType> of a button cell is displayed as the text on the button. The <xref:System.Windows.Forms.DataGridViewButtonColumn.UseColumnTextForButtonValue%2A> property allows you to either set the button text for each cell, or to use the <xref:System.Windows.Forms.DataGridViewButtonColumn.Text%2A> property value for all of the button cells. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet010"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -522,7 +522,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewButtonColumn.CellTemplate" /> <altmember cref="T:System.Windows.Forms.DataGridViewButtonCell" /> <altmember cref="P:System.Windows.Forms.DataGridViewButtonCell.UseColumnTextForButtonValue" /> - <related type="Article" href="/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid">How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid">How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewCell.xml b/xml/System.Windows.Forms/DataGridViewCell.xml index 6e6efc8c5ec..e18307c6910 100644 --- a/xml/System.Windows.Forms/DataGridViewCell.xml +++ b/xml/System.Windows.Forms/DataGridViewCell.xml @@ -54,7 +54,7 @@ ## Examples - The following code example illustrates the use of this type. For more information about this example, see [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). + The following code example illustrates the use of this type. For more information about this example, see [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: @@ -265,7 +265,7 @@ ## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.BorderWidths%2A> method of the <xref:System.Windows.Forms.DataGridViewCell> class to determine the available drawing area in a cell. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.BorderWidths%2A> method of the <xref:System.Windows.Forms.DataGridViewCell> class to determine the available drawing area in a cell. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet20"::: @@ -319,7 +319,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Clone"> @@ -509,7 +509,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ContentDoubleClickUnsharesRow"> @@ -554,7 +554,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ContextMenuStrip"> @@ -714,7 +714,7 @@ ## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.DefaultNewRowValue%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.DefaultNewRowValue%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -966,7 +966,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="EditedFormattedValue"> @@ -1091,7 +1091,7 @@ ## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.EditType%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.EditType%2A> property in a `CalendarCell` class that derives from <xref:System.Windows.Forms.DataGridViewTextBoxCell>. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -1152,7 +1152,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnEnter(System.Int32,System.Boolean)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnLeave(System.Int32,System.Boolean)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseEnterUnsharesRow(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ErrorIconBounds"> @@ -2048,7 +2048,7 @@ <format type="text/markdown"><. + This method returns a <xref:System.Windows.Forms.DataGridViewCellStyle> that inherits its settings from the <xref:System.Windows.Forms.DataGridViewCellStyle> objects of the cell's parent row, column, and <xref:System.Windows.Forms.DataGridView>. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2235,7 +2235,7 @@ ## Remarks Getting the value of the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property automatically instantiates a new <xref:System.Windows.Forms.DataGridViewCellStyle> if the property has not previously been accessed. Therefore, you must use the <xref:System.Windows.Forms.DataGridViewCell.HasStyle%2A> property to determine whether the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property is currently set to a <xref:System.Windows.Forms.DataGridViewCellStyle> instance. This is useful to determine which properties of the object returned by the <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property represent styles set specifically for the cell. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2323,7 +2323,7 @@ ## Remarks The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. The styles specified through the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -2404,7 +2404,7 @@ ## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewTextBoxCell.InitializeEditingControl%2A> method in a simple class that derives from the <xref:System.Windows.Forms.DataGridViewTextBoxCell> class. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewTextBoxCell.InitializeEditingControl%2A> method in a simple class that derives from the <xref:System.Windows.Forms.DataGridViewTextBoxCell> class. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -2510,7 +2510,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow(System.Windows.Forms.KeyPressEventArgs,System.Int32)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyEntersEditMode"> @@ -2601,7 +2601,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyPress(System.Windows.Forms.KeyPressEventArgs,System.Int32)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="T:System.Windows.Forms.KeyPressEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyUpUnsharesRow"> @@ -2652,7 +2652,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.KeyPressUnsharesRow(System.Windows.Forms.KeyPressEventArgs,System.Int32)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="LeaveUnsharesRow"> @@ -2701,7 +2701,7 @@ <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnLeave(System.Int32,System.Boolean)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseLeaveUnsharesRow(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <MemberGroup MemberName="MeasureTextHeight"> @@ -3113,7 +3113,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseMoveUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseUpUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseDoubleClickUnsharesRow"> @@ -3157,7 +3157,7 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseDownUnsharesRow"> @@ -3210,7 +3210,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseUpUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseEnterUnsharesRow"> @@ -3261,7 +3261,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseLeaveUnsharesRow(System.Int32)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseMoveUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseUpUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseLeaveUnsharesRow"> @@ -3312,7 +3312,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseLeave(System.Int32)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseMoveUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseUpUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseMoveUnsharesRow"> @@ -3363,7 +3363,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseMove(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseUpUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseUpUnsharesRow"> @@ -3414,7 +3414,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewCell.MouseMoveUnsharesRow(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellMouseEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnClick"> @@ -4026,7 +4026,7 @@ ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -4082,7 +4082,7 @@ ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -4373,7 +4373,7 @@ <format type="text/markdown"><. + The following code example demonstrates how to override the <xref:System.Windows.Forms.DataGridViewCell.Paint%2A> method of a <xref:System.Windows.Forms.DataGridViewButtonCell>. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet20"::: @@ -4430,7 +4430,7 @@ <format type="text/markdown"><. + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet20"::: @@ -4932,7 +4932,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ColumnIndex" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Selected"> @@ -5114,7 +5114,7 @@ ## Remarks The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. The styles specified through the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). @@ -5255,7 +5255,7 @@ ## Examples - The following code example shows how to set the <xref:System.Windows.Forms.DataGridViewCell.ToolTipText%2A> property within an event handler for the <xref:System.Windows.Forms.DataGridView.CellFormatting> event. This example is part of a larger code example provided in [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). + The following code example shows how to set the <xref:System.Windows.Forms.DataGridViewCell.ToolTipText%2A> property within an event handler for the <xref:System.Windows.Forms.DataGridView.CellFormatting> event. This example is part of a larger code example provided in [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: @@ -5359,7 +5359,7 @@ ## Examples - The following code example shows how to update a cell's contents with the <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property. This example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example shows how to update a cell's contents with the <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property. This example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: diff --git a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml index c0cd5ad5193..501898f6559 100644 --- a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml @@ -68,7 +68,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowContextMenuStripNeeded" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ContextMenuStrip" /> <altmember cref="T:System.Windows.Forms.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml index 85c6a194a32..9a11f7cf5b3 100644 --- a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml @@ -79,6 +79,6 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowContextMenuStripNeeded" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ContextMenuStrip" /> <altmember cref="T:System.Windows.Forms.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml index 51250c5c87c..6759c0784e9 100644 --- a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml @@ -63,7 +63,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellErrorTextNeededEventHandler" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ErrorText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="ErrorText"> diff --git a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml index 6af4fa9719a..3221bac817c 100644 --- a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml @@ -74,6 +74,6 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ErrorText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml index 6e11398b978..f55b7767d31 100644 --- a/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml @@ -23,52 +23,52 @@ <Docs> <summary>Provides data for <see cref="T:System.Windows.Forms.DataGridView" /> events related to cell and row operations.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -104,10 +104,10 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="columnIndex" /> is less than -1. - - -or- - + <paramref name="columnIndex" /> is less than -1. + + -or- + <paramref name="rowIndex" /> is less than -1.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> </Docs> @@ -144,14 +144,14 @@ <summary>Gets a value indicating the column index of the cell that the event occurs for.</summary> <value>The index of the column containing the cell that the event occurs for.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet220"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet220"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet220"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -189,14 +189,14 @@ <summary>Gets a value indicating the row index of the cell that the event occurs for.</summary> <value>The index of the row containing the cell that the event occurs for.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet220"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet220"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet220"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml index e0e565c7269..2764ad8e8d2 100644 --- a/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml @@ -39,54 +39,54 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle <see cref="T:System.Windows.Forms.DataGridView" /> events related to cell and row operations.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates using <xref:System.Windows.Forms.DataGridView.CellMouseEnter> and <xref:System.Windows.Forms.DataGridView.CellMouseLeave> event handlers to determine whether a cell can be clicked. The example updates each <xref:System.Windows.Forms.DataGridViewCell.ToolTipText%2A> to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates using <xref:System.Windows.Forms.DataGridView.CellMouseEnter> and <xref:System.Windows.Forms.DataGridView.CellMouseLeave> event handlers to determine whether a cell can be clicked. The example updates each <xref:System.Windows.Forms.DataGridViewCell.ToolTipText%2A> to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml index 4dcea347b47..cbcdf411f75 100644 --- a/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml @@ -29,36 +29,36 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.CellFormatting" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. - - To customize the conversion of a formatted, user-specified value into an actual cell value, handle the <xref:System.Windows.Forms.DataGridView.CellParsing> event. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to handle <xref:System.Windows.Forms.DataGridView.CellFormatting>. - + <format type="text/markdown"><. + + To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. + + To customize the conversion of a formatted, user-specified value into an actual cell value, handle the <xref:System.Windows.Forms.DataGridView.CellParsing> event. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to handle <xref:System.Windows.Forms.DataGridView.CellFormatting>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -80,8 +80,8 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle" /> <altmember cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -127,29 +127,29 @@ <param name="cellStyle">The style of the cell that caused the event.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellFormattingEventArgs" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `desiredType` parameter represents the type that the `value` parameter should be converted to, and `desiredType` is assigned the cell's <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. For example, if a cell is formatting picture names as bitmaps, `value` is the <xref:System.String> that contains the picture name, and `desiredType` is a <xref:System.Type> representing the <xref:System.Drawing.Bitmap> type. - - If the <xref:System.Windows.Forms.DataGridView.CellFormatting> event handler does not set the <xref:System.Windows.Forms.ConvertEventArgs.Value%2A> property to a type that can be displayed by the cell, the cell contents will be formatted using the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A>, and <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> properties. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `desiredType` parameter represents the type that the `value` parameter should be converted to, and `desiredType` is assigned the cell's <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A> property. For example, if a cell is formatting picture names as bitmaps, `value` is the <xref:System.String> that contains the picture name, and `desiredType` is a <xref:System.Type> representing the <xref:System.Drawing.Bitmap> type. + + If the <xref:System.Windows.Forms.DataGridView.CellFormatting> event handler does not set the <xref:System.Windows.Forms.ConvertEventArgs.Value%2A> property to a type that can be displayed by the cell, the cell contents will be formatted using the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A>, and <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> properties. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="columnIndex" /> is less than -1 - - -or- - + <paramref name="columnIndex" /> is less than -1 + + -or- + <paramref name="rowIndex" /> is less than -1.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellFormatting" /> @@ -161,7 +161,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCell.FormattedValueType" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle" /> <altmember cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CellStyle"> @@ -201,29 +201,29 @@ <summary>Gets or sets the style of the cell that is being formatted.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents the display style of the cell being formatted. The default is the value of the cell's <see cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" /> property.</value> <remarks> - <format type="text/markdown">< - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle%2A> property to color the background of cells that contain the string "Pink" to <xref:System.Drawing.Color.Pink%2A>. - + <format type="text/markdown">< + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle%2A> property to color the background of cells that contain the string "Pink" to <xref:System.Drawing.Color.Pink%2A>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellFormatting" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ColumnIndex"> @@ -258,20 +258,20 @@ <summary>Gets the column index of the cell that is being formatted.</summary> <value>The column index of the cell that is being formatted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.ColumnIndex%2A> property to obtain an index into the <xref:System.Windows.Forms.DataGridView.Columns%2A> property of a <xref:System.Windows.Forms.DataGridView>. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.ColumnIndex%2A> property to retrieve column properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.ColumnIndex%2A> property to obtain an index into the <xref:System.Windows.Forms.DataGridView.Columns%2A> property of a <xref:System.Windows.Forms.DataGridView>. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.ColumnIndex%2A> property to retrieve column properties. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -316,20 +316,20 @@ <value> <see langword="true" /> if the formatting for the cell value has been handled; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When handling the <xref:System.Windows.Forms.DataGridView.CellFormatting> event, set the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property to `true` after setting the <xref:System.Windows.Forms.ConvertEventArgs.Value%2A> property if no further value formatting is required. If the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property value is `false` when the event handler exits, the formatting will be applied to the value as indicated by the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A>, and <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> properties of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle%2A> property. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property to `true` to signal that formatting for this cell is finished. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When handling the <xref:System.Windows.Forms.DataGridView.CellFormatting> event, set the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property to `true` after setting the <xref:System.Windows.Forms.ConvertEventArgs.Value%2A> property if no further value formatting is required. If the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property value is `false` when the event handler exits, the formatting will be applied to the value as indicated by the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A>, <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A>, and <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> properties of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.CellStyle%2A> property. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A> property to `true` to signal that formatting for this cell is finished. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -374,20 +374,20 @@ <summary>Gets the row index of the cell that is being formatted.</summary> <value>The row index of the cell that is being formatted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.RowIndex%2A> property to obtain an index into the <xref:System.Windows.Forms.DataGridView.Rows%2A> property of a <xref:System.Windows.Forms.DataGridView>. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.RowIndex%2A> property to retrieve the cell being formatted. The cell reference is then used to set the cell's ToolTip text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.RowIndex%2A> property to obtain an index into the <xref:System.Windows.Forms.DataGridView.Rows%2A> property of a <xref:System.Windows.Forms.DataGridView>. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.RowIndex%2A> property to retrieve the cell being formatted. The cell reference is then used to set the cell's ToolTip text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/VB/datagridviewcell.tooltiptext.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/VB/datagridviewcell.tooltiptext.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml index 34b1a2bbdc4..da3b780b628 100644 --- a/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml @@ -39,45 +39,45 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellFormattingEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.CellFormatting" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. - - To customize the conversion of a formatted, user-specified value into an actual cell value, handle the <xref:System.Windows.Forms.DataGridView.CellParsing> event. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - When you create a <xref:System.Windows.Forms.DataGridViewCellFormattingEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.CellFormatting> event. - + <format type="text/markdown"><. + + To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. + + To customize the conversion of a formatted, user-specified value into an actual cell value, handle the <xref:System.Windows.Forms.DataGridView.CellParsing> event. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + When you create a <xref:System.Windows.Forms.DataGridViewCellFormattingEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to handle the <xref:System.Windows.Forms.DataGridView.CellFormatting> event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellFormatting" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellFormattingEventArgs" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control">How to: Customize Data Formatting in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml index f2133cedabd..995adb7a22a 100644 --- a/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml @@ -29,19 +29,19 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.CellPainting" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.DataGridView.CellPainting" /> @@ -122,14 +122,14 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellPaintingEventArgs" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentNullException"> - <paramref name="dataGridView" /> is <see langword="null" />. - - -or- - - <paramref name="graphics" /> is <see langword="null" />. - - -or- - + <paramref name="dataGridView" /> is <see langword="null" />. + + -or- + + <paramref name="graphics" /> is <see langword="null" />. + + -or- + <paramref name="cellStyle" /> is <see langword="null" />.</exception> <exception cref="T:System.ArgumentException"> <paramref name="paintParts" /> is not a valid bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewPaintParts" /> values.</exception> @@ -174,21 +174,21 @@ <summary>Gets the border style of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewAdvancedBorderStyle" /> that represents the border style of the <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Change the borders of the current <xref:System.Windows.Forms.DataGridViewCell> by setting the properties of the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.AdvancedBorderStyle%2A> property to one of the <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle> values. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Change the borders of the current <xref:System.Windows.Forms.DataGridViewCell> by setting the properties of the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.AdvancedBorderStyle%2A> property to one of the <xref:System.Windows.Forms.DataGridViewAdvancedCellBorderStyle> values. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -229,14 +229,14 @@ <summary>Get the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -277,19 +277,19 @@ <summary>Gets the cell style of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that contains the cell style of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Change the appearance of the current <xref:System.Windows.Forms.DataGridViewCell> by setting the properties of the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.CellStyle%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Change the appearance of the current <xref:System.Windows.Forms.DataGridViewCell> by setting the properties of the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.CellStyle%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -329,21 +329,21 @@ <summary>Gets the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window, and then uncovers it, then <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView>, and then uncovers it, then <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> represents the small area that was covered. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window, and then uncovers it, then <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView>, and then uncovers it, then <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ClipBounds%2A> represents the small area that was covered. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -382,19 +382,19 @@ <summary>Gets the column index of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>The column index of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex%2A> property returns -1 when a row header cell is being painted. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex%2A> property returns -1 when a row header cell is being painted. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -434,21 +434,21 @@ <summary>Gets a string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>A string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the current <xref:System.Windows.Forms.DataGridViewCell> is a row header cell, the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ErrorText%2A> property is the same as the <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property of the <xref:System.Windows.Forms.DataGridViewRow>. When the current cell is a data cell, <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ErrorText%2A> is the same as the <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A?displayProperty=nameWithType> property of the <xref:System.Windows.Forms.DataGridViewCell>. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the current <xref:System.Windows.Forms.DataGridViewCell> is a row header cell, the <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ErrorText%2A> property is the same as the <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property of the <xref:System.Windows.Forms.DataGridViewRow>. When the current cell is a data cell, <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ErrorText%2A> is the same as the <xref:System.Windows.Forms.DataGridViewCell.ErrorText%2A?displayProperty=nameWithType> property of the <xref:System.Windows.Forms.DataGridViewCell>. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -491,21 +491,21 @@ <summary>Gets the formatted value of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>The formatted value of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.FormattedValue%2A> property contains the value of the cell after the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> or <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has been applied to it, and after the <xref:System.Windows.Forms.DataGridView.CellFormatting> event has been handled. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.FormattedValue%2A> property contains the value of the cell after the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> or <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has been applied to it, and after the <xref:System.Windows.Forms.DataGridView.CellFormatting> event has been handled. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -547,14 +547,14 @@ <summary>Gets the <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>The <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -594,10 +594,10 @@ <summary>Paints the specified parts of the cell for the area in the specified bounds.</summary> <remarks>To be added.</remarks> <exception cref="T:System.InvalidOperationException"> - <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex" /> is less than -1 or greater than or equal to the number of columns in the <see cref="T:System.Windows.Forms.DataGridView" /> control.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> </Docs> @@ -635,10 +635,10 @@ <summary>Paints the cell background for the area in the specified bounds.</summary> <remarks>To be added.</remarks> <exception cref="T:System.InvalidOperationException"> - <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex" /> is less than -1 or greater than or equal to the number of columns in the <see cref="T:System.Windows.Forms.DataGridView" /> control.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> </Docs> @@ -673,10 +673,10 @@ <summary>Paints the cell content for the area in the specified bounds.</summary> <remarks>To be added.</remarks> <exception cref="T:System.InvalidOperationException"> - <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex" /> is less than -1 or greater than or equal to the number of rows in the <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + <see cref="P:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex" /> is less than -1 or greater than or equal to the number of columns in the <see cref="T:System.Windows.Forms.DataGridView" /> control.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> </Docs> @@ -713,16 +713,16 @@ <summary>The cell parts that are to be painted.</summary> <value>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewPaintParts" /> values specifying the parts to be painted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -760,19 +760,19 @@ <summary>Gets the row index of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>The row index of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex%2A> property returns -1 when a column header is being painted. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.RowIndex%2A> property returns -1 when a column header is being painted. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -811,16 +811,16 @@ <summary>Gets the state of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values that specifies the state of the cell.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -861,19 +861,19 @@ <summary>Gets the value of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <value>The value of the current <see cref="T:System.Windows.Forms.DataGridViewCell" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.Value%2A> property contains the value of the cell before any formatting occurs. - - - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.Value%2A> property contains the value of the cell before any formatting occurs. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml index b72b0235884..8b847fa05ad 100644 --- a/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml @@ -39,27 +39,27 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellPaintingEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.CellPainting" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following example illustrates the use of this event to customize the appearance of all cells in a particular column. - - This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following example illustrates the use of this event to customize the appearance of all cells in a particular column. + + This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellPainting" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellPaintingEventArgs" /> <altmember cref="T:System.Windows.Forms.DataGridViewCell" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid">How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid">How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCellStyle.xml b/xml/System.Windows.Forms/DataGridViewCellStyle.xml index 88943bfbb3a..53392c1b028 100644 --- a/xml/System.Windows.Forms/DataGridViewCellStyle.xml +++ b/xml/System.Windows.Forms/DataGridViewCellStyle.xml @@ -45,19 +45,19 @@ <Docs> <summary>Represents the formatting and style information applied to individual cells within a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the effect of setting properties on multiple <xref:System.Windows.Forms.DataGridViewCellStyle> objects. This example sets the background color of cells in the <xref:System.Windows.Forms.DataGridView> by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property on the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. The background color is overridden on alternating rows because the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property is set on the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A> property. The example also determines the format of dates in the column named `Last Prepared` by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> property on the column's <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the effect of setting properties on multiple <xref:System.Windows.Forms.DataGridViewCellStyle> objects. This example sets the background color of cells in the <xref:System.Windows.Forms.DataGridView> by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property on the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. The background color is overridden on alternating rows because the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property is set on the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A> property. The example also determines the format of dates in the column named `Last Prepared` by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> property on the column's <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -75,8 +75,8 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellFormattingEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/datagridview-control-overview-windows-forms">DataGridView Control Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/datagridview-control-overview-windows-forms">DataGridView Control Overview (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -87,7 +87,7 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> class.</summary> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </MemberGroup> <Member MemberName=".ctor"> @@ -113,7 +113,7 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> class using default property values.</summary> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName=".ctor"> @@ -145,7 +145,7 @@ <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewCellStyle" /> is <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Alignment"> @@ -180,20 +180,20 @@ <summary>Gets or sets a value indicating the position of the cell content within a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <value>One of the <see cref="T:System.Windows.Forms.DataGridViewContentAlignment" /> values. The default is <see cref="F:System.Windows.Forms.DataGridViewContentAlignment.NotSet" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet072"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.DataGridViewContentAlignment" /> value.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/data-formatting-in-the-windows-forms-datagridview-control">Data Formatting in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/data-formatting-in-the-windows-forms-datagridview-control">Data Formatting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ApplyStyle"> @@ -225,17 +225,17 @@ <param name="dataGridViewCellStyle">The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to apply to the current <see cref="T:System.Windows.Forms.DataGridViewCellStyle" />.</param> <summary>Applies the specified <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to the current <see cref="T:System.Windows.Forms.DataGridViewCellStyle" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellStyle.ApplyStyle%2A> method applies the values of the properties that are set in the `dataGridViewCellStyle` parameter to the current <xref:System.Windows.Forms.DataGridViewCellStyle>. If a property is not set in `dataGridViewCellStyle`, the current <xref:System.Windows.Forms.DataGridViewCellStyle> retains its value of that property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellStyle.ApplyStyle%2A> method applies the values of the properties that are set in the `dataGridViewCellStyle` parameter to the current <xref:System.Windows.Forms.DataGridViewCellStyle>. If a property is not set in `dataGridViewCellStyle`, the current <xref:System.Windows.Forms.DataGridViewCellStyle> retains its value of that property. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewCellStyle" /> is <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="BackColor"> @@ -264,18 +264,18 @@ <summary>Gets or sets the background color of a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of a cell. The default is <see cref="F:System.Drawing.Color.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the background color of cells in the <xref:System.Windows.Forms.DataGridView> by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property on the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. Note that the background color is overridden on alternating rows because the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property is set on the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A> property. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the background color of cells in the <xref:System.Windows.Forms.DataGridView> by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property on the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A> property. Note that the background color is overridden on alternating rows because the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property is set on the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A> property. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Clone"> @@ -306,7 +306,7 @@ <returns>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents an exact copy of this cell style.</returns> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DataSourceNullValue"> @@ -358,22 +358,22 @@ <summary>Gets or sets the value saved to the data source when the user enters a null value into a cell.</summary> <value>The value saved to the data source when the user specifies a null cell value. The default is <see cref="F:System.DBNull.Value" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The user can enter a null value into a cell by pressing CTRL+0 or by typing the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property. When the user commits the change, the underlying cell value is set to the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property or to `null` if <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is <xref:System.DBNull.Value?displayProperty=nameWithType> and the cell <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> is a reference type. This conversion does not occur when you set the <xref:System.Windows.Forms.DataGridViewCell.Value%2A?displayProperty=nameWithType> property programmatically. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The user can enter a null value into a cell by pressing CTRL+0 or by typing the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property. When the user commits the change, the underlying cell value is set to the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property or to `null` if <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is <xref:System.DBNull.Value?displayProperty=nameWithType> and the cell <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> is a reference type. This conversion does not occur when you set the <xref:System.Windows.Forms.DataGridViewCell.Value%2A?displayProperty=nameWithType> property programmatically. + > [!NOTE] -> The control does not display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value for cell values equal to the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property value when <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is set to a value other than <xref:System.DBNull.Value?displayProperty=nameWithType> or `null`. In this case, you can handle the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. For more information, see the code example in this topic. - - - -## Examples - The following code example illustrates the use of this property. In this example, a <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event handler displays the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property when the cell value equals <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A>. - +> The control does not display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value for cell values equal to the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property value when <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is set to a value other than <xref:System.DBNull.Value?displayProperty=nameWithType> or `null`. In this case, you can handle the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. For more information, see the code example in this topic. + + + +## Examples + The following code example illustrates the use of this property. In this example, a <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event handler displays the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property when the cell value equals <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -381,7 +381,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.IsDataSourceNullValueDefault" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.NullValue" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Equals"> @@ -417,7 +417,7 @@ <see langword="true" /> if <paramref name="o" /> is a <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> and has the same property values as this instance; otherwise, <see langword="false" />.</returns> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Font"> @@ -453,24 +453,24 @@ <summary>Gets or sets the font applied to the textual content of a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <value>The <see cref="T:System.Drawing.Font" /> applied to the cell text. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to change the typeface styles applied to the cell text. Because a <xref:System.Drawing.Font> is immutable (its properties are read-only), you can modify this property only by assigning a new or existing <xref:System.Drawing.Font> to it; you cannot alter the properties of the returned object directly. - - - -## Examples - The following code example sets the font for column headers. To run this example, paste the code into a form that contains a <xref:System.Windows.Forms.DataGridView> named `GridView1`, and then call the `SetupUpDataGridView` and `PopulateDataGridView` methods from the form's constructor or <xref:System.Windows.Forms.Form.OnLoad%2A> method. Ensure all events are associated with their event-handling methods. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to change the typeface styles applied to the cell text. Because a <xref:System.Drawing.Font> is immutable (its properties are read-only), you can modify this property only by assigning a new or existing <xref:System.Drawing.Font> to it; you cannot alter the properties of the returned object directly. + + + +## Examples + The following code example sets the font for column headers. To run this example, paste the code into a form that contains a <xref:System.Windows.Forms.DataGridView> named `GridView1`, and then call the `SetupUpDataGridView` and `PopulateDataGridView` methods from the form's constructor or <xref:System.Windows.Forms.Form.OnLoad%2A> method. Ensure all events are associated with their event-handling methods. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ForeColor"> @@ -499,23 +499,23 @@ <summary>Gets or sets the foreground color of a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of a cell. The default is <see cref="F:System.Drawing.Color.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> property typically should specify a color that contrasts with the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property. - - - -## Examples - The following code example demonstrates how to set the <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> and <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> properties for cells in alternating rows. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> property typically should specify a color that contrasts with the <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> property. + + + +## Examples + The following code example demonstrates how to set the <xref:System.Windows.Forms.DataGridViewCellStyle.ForeColor%2A> and <xref:System.Windows.Forms.DataGridViewCellStyle.BackColor%2A> properties for cells in alternating rows. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Format"> @@ -562,24 +562,24 @@ <summary>Gets or sets the format string applied to the textual content of a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <value>A string that indicates the format of the cell value. The default is <see cref="F:System.String.Empty" />.</value> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example sets the format of dates in the column named `Last Fixed` to "Month, year" by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> property on the column's <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. - + <format type="text/markdown"><. + + + +## Examples + The following code example sets the format of dates in the column named `Last Fixed` to "Month, year" by setting the <xref:System.Windows.Forms.DataGridViewCellStyle.Format%2A> property on the column's <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewCellStyle> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/data-formatting-in-the-windows-forms-datagridview-control">Data Formatting in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/data-formatting-in-the-windows-forms-datagridview-control">Data Formatting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="FormatProvider"> @@ -619,7 +619,7 @@ <value>An <see cref="T:System.IFormatProvider" /> used for cell formatting. The default is <see cref="P:System.Globalization.CultureInfo.CurrentUICulture" />.</value> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetHashCode"> @@ -689,16 +689,16 @@ <value> <see langword="true" /> if the value of the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue" /> property is the default value; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsFormatProviderDefault"> @@ -738,15 +738,15 @@ <value> <see langword="true" /> if the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.FormatProvider" /> property is the default value; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.FormatProvider%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsNullValueDefault"> @@ -786,15 +786,15 @@ <value> <see langword="true" /> if the value of the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.NullValue" /> property is the default value; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to determine whether the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property has been explicitly set without having to store its default value for comparison. This is useful because the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property has a non-empty default value, unlike most other <xref:System.Windows.Forms.DataGridViewCellStyle> properties, which have default values such as `null`, <xref:System.Drawing.Color.Empty>, or <xref:System.Windows.Forms.DataGridViewContentAlignment.NotSet>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="NullValue"> @@ -838,24 +838,24 @@ <summary>Gets or sets the <see cref="T:System.Windows.Forms.DataGridView" /> cell display value corresponding to a cell value of <see cref="F:System.DBNull.Value" /> or <see langword="null" />.</summary> <value>The object used to indicate a null value in a cell. The default is <see cref="F:System.String.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DataGridView> cell with this cell style has a value of <xref:System.DBNull.Value?displayProperty=nameWithType> or `null` or the user edits the cell and presses CTRL+0, the <xref:System.Windows.Forms.DataGridView> control displays the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. When a user edits a cell with this cell style and enters the value of this property or presses CTRL+0, the control sets the cell value to the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property or to `null` if <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is <xref:System.DBNull.Value?displayProperty=nameWithType> and the cell <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> is a reference type. This conversion does not occur when you set the <xref:System.Windows.Forms.DataGridViewCell.Value%2A?displayProperty=nameWithType> property programmatically. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DataGridView> cell with this cell style has a value of <xref:System.DBNull.Value?displayProperty=nameWithType> or `null` or the user edits the cell and presses CTRL+0, the <xref:System.Windows.Forms.DataGridView> control displays the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. When a user edits a cell with this cell style and enters the value of this property or presses CTRL+0, the control sets the cell value to the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property or to `null` if <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is <xref:System.DBNull.Value?displayProperty=nameWithType> and the cell <xref:System.Windows.Forms.DataGridViewCell.ValueType%2A> is a reference type. This conversion does not occur when you set the <xref:System.Windows.Forms.DataGridViewCell.Value%2A?displayProperty=nameWithType> property programmatically. + > [!NOTE] -> The control does not display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value for cell values equal to the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property value when <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is set to a value other than <xref:System.DBNull.Value?displayProperty=nameWithType> or `null`. In this case, you can handle the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. For more information, see the code example in this topic. - - This property takes any object, which enables you to specify a value with a type appropriate to the display type of the cell. For example, you can set this property to string values for use by text box cells or images for use by image cells. - - - -## Examples - The following code example illustrates the use of this property. In this example, a <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event handler displays the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property when the cell value equals <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A>. - +> The control does not display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value for cell values equal to the <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> property value when <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A> is set to a value other than <xref:System.DBNull.Value?displayProperty=nameWithType> or `null`. In this case, you can handle the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event to display the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property value. For more information, see the code example in this topic. + + This property takes any object, which enables you to specify a value with a type appropriate to the display type of the cell. For example, you can set this property to string values for use by text box cells or images for use by image cells. + + + +## Examples + The following code example illustrates the use of this property. In this example, a <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event handler displays the value of the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property when the cell value equals <xref:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue%2A>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -863,8 +863,8 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.DataSourceNullValue" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.IsDataSourceNullValueDefault" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control">How to: Format Data in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control">How to: Format Data in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Padding"> @@ -893,25 +893,25 @@ <summary>Gets or sets the space between the edge of a <see cref="T:System.Windows.Forms.DataGridViewCell" /> and its content.</summary> <value>A <see cref="T:System.Windows.Forms.Padding" /> that represents the space between the edge of a <see cref="T:System.Windows.Forms.DataGridViewCell" /> and its content.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="SelectionBackColor"> @@ -940,18 +940,18 @@ <summary>Gets or sets the background color used by a <see cref="T:System.Windows.Forms.DataGridView" /> cell when it is selected.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of a selected cell. The default is <see cref="F:System.Drawing.Color.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates the use of this property in a <xref:System.Windows.Forms.DataGridView> control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewCellStyle> class overview. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates the use of this property in a <xref:System.Windows.Forms.DataGridView> control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewCellStyle> class overview. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="SelectionForeColor"> @@ -980,23 +980,23 @@ <summary>Gets or sets the foreground color used by a <see cref="T:System.Windows.Forms.DataGridView" /> cell when it is selected.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of a selected cell. The default is <see cref="F:System.Drawing.Color.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCellStyle.SelectionForeColor%2A> property typically should specify a color that contrasts with the <xref:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor%2A> property. - - - -## Examples - The following code example illustrates the use of this property in a <xref:System.Windows.Forms.DataGridView> control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewCellStyle> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCellStyle.SelectionForeColor%2A> property typically should specify a color that contrasts with the <xref:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor%2A> property. + + + +## Examples + The following code example illustrates the use of this property in a <xref:System.Windows.Forms.DataGridView> control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewCellStyle> class overview. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="System.ICloneable.Clone"> @@ -1035,15 +1035,15 @@ <summary>Creates an exact copy of this <see cref="T:System.Windows.Forms.DataGridViewCellStyle" />.</summary> <returns>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents an exact copy of this cell style.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewCellStyle> instance is cast to an <xref:System.ICloneable> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewCellStyle> instance is cast to an <xref:System.ICloneable> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Tag"> @@ -1092,7 +1092,7 @@ <value>An object that contains additional data. The default is <see langword="null" />.</value> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ToString"> @@ -1123,7 +1123,7 @@ <returns>A string indicating the current property settings of the <see cref="T:System.Windows.Forms.DataGridViewCellStyle" />.</returns> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="WrapMode"> @@ -1158,25 +1158,25 @@ <summary>Gets or sets a value indicating whether textual content in a <see cref="T:System.Windows.Forms.DataGridView" /> cell is wrapped to subsequent lines or truncated when it is too long to fit on a single line.</summary> <value>One of the <see cref="T:System.Windows.Forms.DataGridViewTriState" /> values. The default is <see cref="F:System.Windows.Forms.DataGridViewTriState.NotSet" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is <xref:System.Windows.Forms.DataGridViewTriState.False> for a cell that contains text, the cell displays the text on a single line, and displays any embedded newline characters as box characters. If <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is <xref:System.Windows.Forms.DataGridViewTriState.True> for a cell that contains text, the cell displays newline characters as line breaks, but also wraps any lines that exceed the width of the cell. - - - -## Examples - The following code example illustrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is <xref:System.Windows.Forms.DataGridViewTriState.False> for a cell that contains text, the cell displays the text on a single line, and displays any embedded newline characters as box characters. If <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is <xref:System.Windows.Forms.DataGridViewTriState.True> for a cell that contains text, the cell displays newline characters as line breaks, but also wraps any lines that exceed the width of the cell. + + + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet074"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet074"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet074"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.DataGridViewTriState" /> value.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control">How to: Format Data in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control">How to: Format Data in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml index d256fc7b424..ad02b2a8b5c 100644 --- a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml @@ -63,7 +63,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventHandler" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs.ToolTipText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ToolTipText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="ToolTipText"> diff --git a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml index 8cfa2607920..3e2622066e9 100644 --- a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml @@ -75,6 +75,6 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellToolTipTextNeededEventArgs.ToolTipText" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ToolTipText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml index 5d901c3bef7..ff1a0110eec 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml @@ -29,22 +29,22 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> event of a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridView.CellValidating?displayProperty=nameWithType> event lets you cancel changes to the current cell when the new value is not valid. Use the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.FormattedValue%2A> property to determine the current value. To determine the state of the current cell, use the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.RowIndex%2A> and <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.ColumnIndex%2A> properties to access the cell through the <xref:System.Windows.Forms.DataGridView.Rows%2A?displayProperty=nameWithType> collection. To cancel the change, set the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property to `true`. - - When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. When this event is canceled in virtual mode, the <xref:System.Windows.Forms.DataGridView.CellValuePushed?displayProperty=nameWithType> event will not be raised. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValidating> event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> reference topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridView.CellValidating?displayProperty=nameWithType> event lets you cancel changes to the current cell when the new value is not valid. Use the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.FormattedValue%2A> property to determine the current value. To determine the state of the current cell, use the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.RowIndex%2A> and <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.ColumnIndex%2A> properties to access the cell through the <xref:System.Windows.Forms.DataGridView.Rows%2A?displayProperty=nameWithType> collection. To cancel the change, set the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property to `true`. + + When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. When this event is canceled in virtual mode, the <xref:System.Windows.Forms.DataGridView.CellValuePushed?displayProperty=nameWithType> event will not be raised. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValidating> event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet40"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -92,14 +92,14 @@ <summary>Gets the column index of the cell that needs to be validated.</summary> <value>A zero-based integer that specifies the column index of the cell that needs to be validated.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellEndEdit/datavalidation.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -141,20 +141,20 @@ <summary>Gets the formatted contents of the cell that needs to be validated.</summary> <value>A reference to the formatted value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The text entered by the user through the user interface (UI) becomes the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.FormattedValue%2A> property value. This is the value that you can validate before it is parsed into the cell <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property value. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValidating> event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> reference topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The text entered by the user through the user interface (UI) becomes the <xref:System.Windows.Forms.DataGridViewCellValidatingEventArgs.FormattedValue%2A> property value. This is the value that you can validate before it is parsed into the cell <xref:System.Windows.Forms.DataGridViewCell.Value%2A> property value. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValidating> event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet40"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -195,14 +195,14 @@ <summary>Gets the row index of the cell that needs to be validated.</summary> <value>A zero-based integer that specifies the row index of the cell that needs to be validated.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellEndEdit/datavalidation.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml index 8e8ffbf6b0d..a6185afea77 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml @@ -29,22 +29,22 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> and <see cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> events of the <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. - + <format type="text/markdown"><. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -52,7 +52,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellValueEventHandler" /> - <related type="Article" href="/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -84,10 +84,10 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="columnIndex" /> is less than 0. - - -or- - + <paramref name="columnIndex" /> is less than 0. + + -or- + <paramref name="rowIndex" /> is less than 0.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnCellValueNeeded(System.Windows.Forms.DataGridViewCellValueEventArgs)" /> @@ -126,20 +126,20 @@ <summary>Gets a value indicating the column index of the cell that the event occurs for.</summary> <value>The index of the column containing the cell that the event occurs for.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet120"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -178,20 +178,20 @@ <summary>Gets a value indicating the row index of the cell that the event occurs for.</summary> <value>The index of the row containing the cell that the event occurs for.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this offset with the <xref:System.Windows.Forms.DataGridView.Rows%2A> property to reference the cell that the event occurs for. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this offset with the <xref:System.Windows.Forms.DataGridView.Rows%2A> property to reference the cell that the event occurs for. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -235,20 +235,20 @@ <summary>Gets or sets the value of the cell that the event occurs for.</summary> <value>An <see cref="T:System.Object" /> representing the cell's value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to inspect the cell's value when handling an event, or to communicate the cell's current value if creating an event. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to inspect the cell's value when handling an event, or to communicate the cell's current value if creating an event. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml index d114c86f94f..e038fddc6ee 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml @@ -39,22 +39,22 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> event or <see cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - When you create a <xref:System.Windows.Forms.DataGridViewCellValueEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. - + <format type="text/markdown"><. + + When you create a <xref:System.Windows.Forms.DataGridViewCellValueEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.DataGridView.CellValuePushed> event to store updates and new entries in a data store object. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.VirtualMode%2A?displayProperty=nameWithType> reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -62,6 +62,6 @@ <altmember cref="E:System.Windows.Forms.DataGridView.CellValueNeeded" /> <altmember cref="E:System.Windows.Forms.DataGridView.CellValuePushed" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control">Virtual Mode in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml b/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml index 95af568148d..439ff7c6c0d 100644 --- a/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml @@ -245,7 +245,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnContentClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ContentDoubleClickUnsharesRow"> @@ -296,7 +296,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnContentDoubleClick(System.Windows.Forms.DataGridViewCellEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CreateAccessibilityInstance"> @@ -994,7 +994,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnKeyDown(System.Windows.Forms.KeyEventArgs,System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyUpUnsharesRow"> @@ -1041,7 +1041,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseDownUnsharesRow"> @@ -1087,7 +1087,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseEnterUnsharesRow"> @@ -1132,7 +1132,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.OnMouseEnter(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseLeaveUnsharesRow"> @@ -1178,7 +1178,7 @@ <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.ButtonState" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnMouseLeave(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseUpUnsharesRow"> @@ -1224,7 +1224,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnContentClick"> @@ -1347,7 +1347,7 @@ <altmember cref="M:System.Windows.Forms.Control.OnKeyDown(System.Windows.Forms.KeyEventArgs)" /> <altmember cref="E:System.Windows.Forms.Control.KeyDown" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.KeyDownUnsharesRow(System.Windows.Forms.KeyEventArgs,System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnKeyUp"> @@ -1394,7 +1394,7 @@ <altmember cref="M:System.Windows.Forms.Control.OnKeyUp(System.Windows.Forms.KeyEventArgs)" /> <altmember cref="E:System.Windows.Forms.Control.KeyUp" /> <altmember cref="M:System.Windows.Forms.DataGridViewCheckBoxCell.KeyUpUnsharesRow(System.Windows.Forms.KeyEventArgs,System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnLeave"> diff --git a/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml index aab49a832ee..7ffd86730c7 100644 --- a/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml @@ -37,24 +37,24 @@ <Docs> <summary>Hosts a collection of <see cref="T:System.Windows.Forms.DataGridViewCheckBoxCell" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that indicate binary state. A <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> has an associated <xref:System.Windows.Forms.DataGridViewCheckBoxCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell supplies a user interface (UI) that is similar to a <xref:System.Windows.Forms.CheckBox> control. - - The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. - - Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the <xref:System.Windows.Forms.DataGridView.CellContentClick?displayProperty=nameWithType> event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the <xref:System.Windows.Forms.DataGridView.CellValueChanged?displayProperty=nameWithType> event to respond to it. To commit the change when the cell is clicked, you must handle the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged?displayProperty=nameWithType> event. In the handler, if the current cell is a check box cell, call the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A?displayProperty=nameWithType> method and pass in the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.Commit> value. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that indicate binary state. A <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> has an associated <xref:System.Windows.Forms.DataGridViewCheckBoxCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell supplies a user interface (UI) that is similar to a <xref:System.Windows.Forms.CheckBox> control. + + The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. + + Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the <xref:System.Windows.Forms.DataGridView.CellContentClick?displayProperty=nameWithType> event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the <xref:System.Windows.Forms.DataGridView.CellValueChanged?displayProperty=nameWithType> event to respond to it. To commit the change when the cell is clicked, you must handle the <xref:System.Windows.Forms.DataGridView.CurrentCellDirtyStateChanged?displayProperty=nameWithType> event. In the handler, if the current cell is a check box cell, call the <xref:System.Windows.Forms.DataGridView.CommitEdit%2A?displayProperty=nameWithType> method and pass in the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.Commit> value. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -109,11 +109,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCheckBoxColumn" /> class to the default state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Using this parameterless constructor is equivalent to supplying an argument of `false` to the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.%23ctor%28System.Boolean%29> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Using this parameterless constructor is equivalent to supplying an argument of `false` to the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.%23ctor%28System.Boolean%29> constructor. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -146,19 +146,19 @@ <see langword="true" /> to display check boxes with three states; <see langword="false" /> to display check boxes with two states.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewCheckBoxColumn" /> and configures it to display check boxes with two or three states.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the column by setting the following properties. - -|Property|Value| -|--------------|-----------| -|<xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewCheckBoxCell> with its <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property initialized to the `threeState` parameter value.| -|<xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A>|The value of the `threeState` parameter.| -|<xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A?displayProperty=nameWithType>|<xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable?displayProperty=nameWithType>| -|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| -|The <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.CheckState.Indeterminate?displayProperty=nameWithType> if `threeState` is `true`; otherwise, `false`.| - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the column by setting the following properties. + +|Property|Value| +|--------------|-----------| +|<xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewCheckBoxCell> with its <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property initialized to the `threeState` parameter value.| +|<xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A>|The value of the `threeState` parameter.| +|<xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A?displayProperty=nameWithType>|<xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable?displayProperty=nameWithType>| +|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| +|The <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.CheckState.Indeterminate?displayProperty=nameWithType> if `threeState` is `true`; otherwise, `false`.| + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -213,23 +213,23 @@ <summary>Gets or sets the template used to create new cells.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCell" /> that all other cells in the column are modeled after. The default value is a new <see cref="T:System.Windows.Forms.DataGridViewCheckBoxCell" /> instance.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The constructors for the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> class initialize this property to a newly created <xref:System.Windows.Forms.DataGridViewCheckBoxCell>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The constructors for the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> class initialize this property to a newly created <xref:System.Windows.Forms.DataGridViewCheckBoxCell>. + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. The cell template is used to apply the same color to all cells in the check box column. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. The cell template is used to apply the same color to all cells in the check box column. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.InvalidCastException">The property is set to a value that is not of type <see cref="T:System.Windows.Forms.DataGridViewCheckBoxCell" />.</exception> @@ -276,34 +276,34 @@ <summary>Gets or sets the column's default cell style.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be applied as the default style.</value> <remarks> - <format type="text/markdown"><. - - If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property has a value of `false`, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to <xref:System.Windows.Forms.CheckState.Indeterminate>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value of <xref:System.Windows.Forms.CheckState.Indeterminate>, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to `false`. - - - -## Examples - The following code example demonstrates the use of this property. - + <format type="text/markdown"><. + + If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property has a value of `false`, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to <xref:System.Windows.Forms.CheckState.Indeterminate>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value of <xref:System.Windows.Forms.CheckState.Indeterminate>, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to `false`. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="FalseValue"> @@ -355,22 +355,22 @@ <summary>Gets or sets the underlying value corresponding to a cell value of <see langword="false" />, which appears as an unchecked box.</summary> <value>An <see cref="T:System.Object" /> representing a value that the cells in this column will treat as a <see langword="false" /> value. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FalseValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FalseValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FalseValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FalseValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -427,22 +427,22 @@ <summary>Gets or sets the flat style appearance of the check box cells.</summary> <value>A <see cref="T:System.Windows.Forms.FlatStyle" /> value indicating the appearance of cells in the column. The default is <see cref="F:System.Windows.Forms.FlatStyle.Standard" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To display the check box cells using visual styles, set this property to <xref:System.Windows.Forms.FlatStyle.System> and call the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method before <xref:System.Windows.Forms.Application.Run%2A?displayProperty=nameWithType>. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FlatStyle%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FlatStyle%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To display the check box cells using visual styles, set this property to <xref:System.Windows.Forms.FlatStyle.System> and call the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method before <xref:System.Windows.Forms.Application.Run%2A?displayProperty=nameWithType>. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FlatStyle%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.FlatStyle%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to mark which employees are out of the office. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridViewComboBoxColumn> class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -503,22 +503,22 @@ <summary>Gets or sets the underlying value corresponding to an indeterminate or <see langword="null" /> cell value, which appears as a disabled checkbox.</summary> <value>An <see cref="T:System.Object" /> representing a value that the cells in this column will treat as an indeterminate value. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.IndeterminateValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.IndeterminateValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.IndeterminateValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.IndeterminateValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -576,24 +576,24 @@ <value> <see langword="true" /> if the hosted <see cref="T:System.Windows.Forms.DataGridViewCheckBoxCell" /> objects are able to have a third, indeterminate, state; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The indeterminate state can be useful, for example, when you do not want to set a default value in the check box. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property has a value of `false`, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to <xref:System.Windows.Forms.CheckState.Indeterminate>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value of <xref:System.Windows.Forms.CheckState.Indeterminate>, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to `false`. - - - -## Examples - The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The indeterminate state can be useful, for example, when you do not want to set a default value in the check box. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.ThreeState%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.DefaultCellStyle%2A> property has a value of `false`, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to <xref:System.Windows.Forms.CheckState.Indeterminate>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value of <xref:System.Windows.Forms.CheckState.Indeterminate>, changing the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.ThreeState%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to `false`. + + + +## Examples + The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -685,22 +685,22 @@ <summary>Gets or sets the underlying value corresponding to a cell value of <see langword="true" />, which appears as a checked box.</summary> <value>An <see cref="T:System.Object" /> representing a value that the cell will treat as a <see langword="true" /> value. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.TrueValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.TrueValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A>, <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A>, and <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.TrueValue%2A> property of the cell object returned by the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewCheckBoxCell.TrueValue%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a <xref:System.Windows.Forms.DataGridViewCheckBoxColumn> to track the status of office lighting. The <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.FalseValue%2A> property associates "turnedOff" with `false`, the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.TrueValue%2A> property associates "turnedOn" with `true`, and the <xref:System.Windows.Forms.DataGridViewCheckBoxColumn.IndeterminateValue%2A> property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewCheckBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> diff --git a/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml b/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml index 06c4d03f2df..65c9175307f 100644 --- a/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml +++ b/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml @@ -22,19 +22,19 @@ <Docs> <summary>Defines constants that indicate whether content is copied from a <see cref="T:System.Windows.Forms.DataGridView" /> control to the Clipboard.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Clipboard" /> diff --git a/xml/System.Windows.Forms/DataGridViewColumn.xml b/xml/System.Windows.Forms/DataGridViewColumn.xml index 67809ff17fa..b0c1eabc5e3 100644 --- a/xml/System.Windows.Forms/DataGridViewColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewColumn.xml @@ -60,24 +60,24 @@ <Docs> <summary>Represents a column in a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - - Types that derive from <xref:System.Windows.Forms.DataGridViewColumn> typically initialize the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> property to a new instance of a related type derived from the <xref:System.Windows.Forms.DataGridViewCell> class. Any column properties that relate to the appearance or behavior of individual cells are wrappers for the corresponding properties of the template cell. Changing one of these properties on the column automatically changes the value on the cell template and on all cells in the column. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example creates a Windows Form with a <xref:System.Windows.Forms.DataGridView> and a set of buttons. Each button label describes an operation related to a <xref:System.Windows.Forms.DataGridViewColumn> property, such as swapping the first and last column (using the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property) or changing the text of a column header (using the <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> property). Clicking a button changes the associated property of the <xref:System.Windows.Forms.DataGridViewColumn>. - + <format type="text/markdown"><. + + Types that derive from <xref:System.Windows.Forms.DataGridViewColumn> typically initialize the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> property to a new instance of a related type derived from the <xref:System.Windows.Forms.DataGridViewCell> class. Any column properties that relate to the appearance or behavior of individual cells are wrappers for the corresponding properties of the template cell. Changing one of these properties on the column automatically changes the value on the cell template and on all cells in the column. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example creates a Windows Form with a <xref:System.Windows.Forms.DataGridView> and a set of buttons. Each button label describes an operation related to a <xref:System.Windows.Forms.DataGridViewColumn> property, such as swapping the first and last column (using the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property) or changing the text of a column header (using the <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> property). Clicking a button changes the associated property of the <xref:System.Windows.Forms.DataGridViewColumn>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet100"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet100"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -157,11 +157,11 @@ <param name="cellTemplate">An existing <see cref="T:System.Windows.Forms.DataGridViewCell" /> to use as a template.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewColumn" /> class using an existing <see cref="T:System.Windows.Forms.DataGridViewCell" /> as a template.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> property to the value of the `cellTemplate` parameter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> property to the value of the `cellTemplate` parameter. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -213,44 +213,44 @@ <summary>Gets or sets the mode by which the column automatically adjusts its width.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> value that determines whether the column will automatically adjust its width and how it will determine its preferred width. The default is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet" />.</value> <remarks> - <format type="text/markdown"><. - - When the <xref:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode%2A> property is set to any other value except <xref:System.Windows.Forms.DataGridViewAutoSizeColumnMode.None>, the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. - - Only columns with a <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. - - To adjust column widths programmatically, use the <xref:System.Windows.Forms.DataGridView> control's <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> methods or set the column <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property. - - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example forces a column to automatically resize its width to fit its contents. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><. + + When the <xref:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode%2A> property is set to any other value except <xref:System.Windows.Forms.DataGridViewAutoSizeColumnMode.None>, the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. + + Only columns with a <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. + + To adjust column widths programmatically, use the <xref:System.Windows.Forms.DataGridView> control's <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> methods or set the column <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property. + + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example forces a column to automatically resize its width to fit its contents. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet109"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet109"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet109"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet109"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is a <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> that is not valid.</exception> - <exception cref="T:System.InvalidOperationException">The specified value when setting this property results in an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> for a visible column when column headers are hidden. - - -or- - + <exception cref="T:System.InvalidOperationException">The specified value when setting this property results in an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> for a visible column when column headers are hidden. + + -or- + The specified value when setting this property results in an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> for a visible column that is frozen.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="P:System.Windows.Forms.DataGridView.AutoSizeColumnsMode" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CellTemplate"> @@ -306,23 +306,23 @@ <summary>Gets or sets the template used to create new cells.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCell" /> that all other cells in the column are modeled after. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The constructors for the <xref:System.Windows.Forms.DataGridViewColumn> class initialize this property. The parameterless constructor sets the property to `null`; the other constructor copies the cell template from its parameter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The constructors for the <xref:System.Windows.Forms.DataGridViewColumn> class initialize this property. The parameterless constructor sets the property to `null`; the other constructor copies the cell template from its parameter. + > [!NOTE] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). - - - -## Examples - The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCell> as a template for a <xref:System.Windows.Forms.DataGridViewColumn>. Style changes made to any cell in the column affect all of the column's cells. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). + + + +## Examples + The following code example demonstrates how to use a <xref:System.Windows.Forms.DataGridViewCell> as a template for a <xref:System.Windows.Forms.DataGridViewColumn>. Style changes made to any cell in the column affect all of the column's cells. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -368,11 +368,11 @@ <summary>Gets the run-time type of the cell template.</summary> <value>The <see cref="T:System.Type" /> of the <see cref="T:System.Windows.Forms.DataGridViewCell" /> used as a template for this column. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The base type of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> is <xref:System.Windows.Forms.DataGridViewCell>. Use this property to determine the actual derived type. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The base type of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A> is <xref:System.Windows.Forms.DataGridViewCell>. Use this property to determine the actual derived type. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -444,20 +444,20 @@ <summary>Gets or sets the shortcut menu for the column.</summary> <value>The <see cref="T:System.Windows.Forms.ContextMenuStrip" /> associated with the current <see cref="T:System.Windows.Forms.DataGridViewColumn" />. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The shortcut menu appears when a user clicks the right mouse button in the column's display area. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.ContextMenuStrip%2A> property to add functionality for changing a cell's background color. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The shortcut menu appears when a user clicks the right mouse button in the column's display area. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.ContextMenuStrip%2A> property to add functionality for changing a cell's background color. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet130"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet130"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet130"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet130"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -527,22 +527,22 @@ <summary>Gets or sets the name of the data source property or database column to which the <see cref="T:System.Windows.Forms.DataGridViewColumn" /> is bound.</summary> <value>The case-insensitive name of the property or database column associated with the <see cref="T:System.Windows.Forms.DataGridViewColumn" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property is set to `true`, each column automatically sets its <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property to the name of a property or database column in the data source specified by the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property. This binding can also be performed manually, which is useful when you want to display only a subset of the properties or database columns available in the data source. In such cases, set the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property to `false`, and then manually add each <xref:System.Windows.Forms.DataGridViewColumn>, setting the value of each <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property to the properties or database columns in the data source that you want to display. - - - -## Examples - The following code example shows how to choose what property each column will represent. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property is set to `true`, each column automatically sets its <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property to the name of a property or database column in the data source specified by the <xref:System.Windows.Forms.DataGridView.DataSource%2A> property. This binding can also be performed manually, which is useful when you want to display only a subset of the properties or database columns available in the data source. In such cases, set the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property to `false`, and then manually add each <xref:System.Windows.Forms.DataGridViewColumn>, setting the value of each <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property to the properties or database columns in the data source that you want to display. + + + +## Examples + The following code example shows how to choose what property each column will represent. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet20"::: + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -585,27 +585,27 @@ <summary>Gets or sets the column's default cell style.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents the default style of the cells in the column.</value> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property to set the content alignment of various columns. - + <format type="text/markdown"><. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A> property to set the content alignment of various columns. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DisplayIndex"> @@ -652,35 +652,35 @@ <summary>Gets or sets the display order of the column relative to the currently displayed columns.</summary> <value>The zero-based position of the column as it is displayed in the associated <see cref="T:System.Windows.Forms.DataGridView" />, or -1 if the band is not contained within a control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Unlike the <xref:System.Windows.Forms.DataGridViewBand.Index%2A> property, the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property corresponds to the current position of the column as displayed by the user interface (UI). By default, each column's <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> is set to numbers of increasing order, which reflects the order in which they were added. The <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value does not affect the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value. To determine the display position of a column based on its visibility or other state, use the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetFirstColumn%2A>, <xref:System.Windows.Forms.DataGridViewColumnCollection.GetLastColumn%2A>, or <xref:System.Windows.Forms.DataGridViewColumnCollection.GetNextColumn%2A> method of the <xref:System.Windows.Forms.DataGridViewColumnCollection> class. - - Every column in the control has a unique <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value. The values start with 0 and proceed in numerical order without skipping any values. When you change the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value for a column, the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> values for other columns are changed to reflect the new order. - - If the column has an associated <xref:System.Windows.Forms.DataGridView> control, setting this property will cause the control to redraw itself. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property to swap the visual position of the first and last columns. Note that insertions occur before the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Unlike the <xref:System.Windows.Forms.DataGridViewBand.Index%2A> property, the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property corresponds to the current position of the column as displayed by the user interface (UI). By default, each column's <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> is set to numbers of increasing order, which reflects the order in which they were added. The <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value does not affect the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value. To determine the display position of a column based on its visibility or other state, use the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetFirstColumn%2A>, <xref:System.Windows.Forms.DataGridViewColumnCollection.GetLastColumn%2A>, or <xref:System.Windows.Forms.DataGridViewColumnCollection.GetNextColumn%2A> method of the <xref:System.Windows.Forms.DataGridViewColumnCollection> class. + + Every column in the control has a unique <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value. The values start with 0 and proceed in numerical order without skipping any values. When you change the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value for a column, the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> values for other columns are changed to reflect the new order. + + If the column has an associated <xref:System.Windows.Forms.DataGridView> control, setting this property will cause the control to redraw itself. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> property to swap the visual position of the first and last columns. Note that insertions occur before the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> is not <see langword="null" /> and the specified value when setting this property is less than 0 or greater than or equal to the number of columns in the control. - - -or- - - <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> is <see langword="null" /> and the specified value when setting this property is less than -1. - - -or- - + <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> is not <see langword="null" /> and the specified value when setting this property is less than 0 or greater than or equal to the number of columns in the control. + + -or- + + <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> is <see langword="null" /> and the specified value when setting this property is less than -1. + + -or- + The specified value when setting this property is equal to <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewBand.Index" /> @@ -762,21 +762,21 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.DataGridViewColumn" /> is disposed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridViewColumn.Disposed> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridViewColumn> named `DataGridViewColumn1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridViewColumn.Disposed> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridViewColumn.Disposed> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridViewColumn> named `DataGridViewColumn1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridViewColumn.Disposed> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet370"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet370"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet370"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -814,20 +814,20 @@ <summary>Gets or sets the width, in pixels, of the column divider.</summary> <value>The thickness, in pixels, of the divider (the column's right margin).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is useful to provide a visual boundary between frozen columns and columns that can scroll. The extra edge is part of the current column, although it will take on the foreground color of the associated <xref:System.Windows.Forms.DataGridView>. The extra edge does not extend the area in which users can double-click to automatically resize a column. To resize a column, the user must double-click on the boundary between the divider and the adjacent column. - - - -## Examples - The following code example adds a vertical edge after the third column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is useful to provide a visual boundary between frozen columns and columns that can scroll. The extra edge is part of the current column, although it will take on the foreground color of the associated <xref:System.Windows.Forms.DataGridView>. The extra edge does not extend the area in which users can double-click to automatically resize a column. To resize a column, the user must double-click on the boundary between the divider and the adjacent column. + + + +## Examples + The following code example adds a vertical edge after the third column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet110"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet110"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet110"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet110"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -870,29 +870,29 @@ <summary>Gets or sets a value that represents the width of the column when it is in fill mode relative to the widths of other fill-mode columns in the control.</summary> <value>A <see cref="T:System.Single" /> representing the width of the column when it is in fill mode relative to the widths of other fill-mode columns. The default is 100.</value> <remarks> - <format type="text/markdown"><. - - The maximum sum of <xref:System.Windows.Forms.DataGridViewColumn.FillWeight%2A> values for all columns in a <xref:System.Windows.Forms.DataGridView> control is 65535. - - - -## Examples - The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + The maximum sum of <xref:System.Windows.Forms.DataGridViewColumn.FillWeight%2A> values for all columns in a <xref:System.Windows.Forms.DataGridView> control is 65535. + + + +## Examples + The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is less than or equal to 0.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="P:System.Windows.Forms.DataGridView.AutoSizeColumnsMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control">Column Fill Mode in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Frozen"> @@ -936,20 +936,20 @@ <value> <see langword="true" /> to freeze the column; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a column is frozen, all the columns to its left (or to its right in right-to-left languages) are frozen as well. The frozen and unfrozen columns form two groups. If column repositioning is enabled by setting the <xref:System.Windows.Forms.DataGridView.AllowUserToOrderColumns%2A> property to `true`, the user cannot drag a column from one group to the other. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.Frozen%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.Frozen%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a column is frozen, all the columns to its left (or to its right in right-to-left languages) are frozen as well. The frozen and unfrozen columns form two groups. If column repositioning is enabled by setting the <xref:System.Windows.Forms.DataGridView.AllowUserToOrderColumns%2A> property to `true`, the user cannot drag a column from one group to the other. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.Frozen%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.Frozen%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -989,15 +989,15 @@ <summary>Calculates the ideal width of the column based on the specified criteria.</summary> <returns>The ideal width, in pixels, of the column.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -1054,20 +1054,20 @@ <summary>Gets or sets the <see cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> that represents the column header.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> that represents the header cell for the column.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The header of a column is typically used to display a column label. Depending on the current values of the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A?displayProperty=nameWithType> properties, users can also click the column header to sort or select the column. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.HeaderCell%2A> property to change column header style and contents. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The header of a column is typically used to display a column label. Depending on the current values of the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> and <xref:System.Windows.Forms.DataGridView.SelectionMode%2A?displayProperty=nameWithType> properties, users can also click the column header to sort or select the column. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.HeaderCell%2A> property to change column header style and contents. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet150"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet150"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet150"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet150"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1109,23 +1109,23 @@ <summary>Gets or sets the caption text on the column's header cell.</summary> <value>A <see cref="T:System.String" /> with the desired text. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is useful only when the column has an associated header cell. For more information, see the <xref:System.Windows.Forms.DataGridViewBand.HeaderCellCore%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is useful only when the column has an associated header cell. For more information, see the <xref:System.Windows.Forms.DataGridViewBand.HeaderCellCore%2A> property. + > [!NOTE] -> There is no corresponding header text property for rows. To display labels in row headers, you must handle the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event and paint your own labels when <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex%2A?displayProperty=nameWithType> is -1. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> property to change the text in the column header. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - +> There is no corresponding header text property for rows. To display labels in row headers, you must handle the <xref:System.Windows.Forms.DataGridView.CellPainting?displayProperty=nameWithType> event and paint your own labels when <xref:System.Windows.Forms.DataGridViewCellPaintingEventArgs.ColumnIndex%2A?displayProperty=nameWithType> is -1. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> property to change the text in the column header. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet160"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet160"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet160"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet160"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1176,29 +1176,29 @@ <summary>Gets the sizing mode in effect for the column.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> value in effect for the column.</value> <remarks> - <format type="text/markdown"><. - - When the <xref:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode%2A> property is set to any other value except <xref:System.Windows.Forms.DataGridViewAutoSizeColumnMode.None>, the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. - - Only columns with a <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. - - To adjust column widths programmatically, use the <xref:System.Windows.Forms.DataGridView> control's <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> methods or set the column <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property. - - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + When the <xref:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode%2A> property is set to any other value except <xref:System.Windows.Forms.DataGridViewAutoSizeColumnMode.None>, the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. + + Only columns with a <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. + + To adjust column widths programmatically, use the <xref:System.Windows.Forms.DataGridView> control's <xref:System.Windows.Forms.DataGridView.AutoResizeColumn%2A> or <xref:System.Windows.Forms.DataGridView.AutoResizeColumns%2A> methods or set the column <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property. + + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.AutoSizeMode" /> <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeColumnMode" /> <altmember cref="P:System.Windows.Forms.DataGridView.AutoSizeColumnsMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/resizing-columns-and-rows-in-the-windows-forms-datagridview-control">Resizing Columns and Rows in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="InheritedStyle"> @@ -1234,20 +1234,20 @@ <summary>Gets the cell style currently applied to the column.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that represents the cell style used to display the column.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewBand.DefaultCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsDataBound"> @@ -1295,11 +1295,11 @@ <value> <see langword="true" /> if the column is connected to a data source; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A column becomes bound to a data source if it is part of a data-bound <xref:System.Windows.Forms.DataGridView>. A column can become part of a data-bound <xref:System.Windows.Forms.DataGridView> if the column is automatically created when the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property is set to `true`, or if the column's <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property is set when the column is manually added to the <xref:System.Windows.Forms.DataGridView>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A column becomes bound to a data source if it is part of a data-bound <xref:System.Windows.Forms.DataGridView>. A column can become part of a data-bound <xref:System.Windows.Forms.DataGridView> if the column is automatically created when the <xref:System.Windows.Forms.DataGridView.AutoGenerateColumns%2A> property is set to `true`, or if the column's <xref:System.Windows.Forms.DataGridViewColumn.DataPropertyName%2A> property is set when the column is manually added to the <xref:System.Windows.Forms.DataGridView>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1349,20 +1349,20 @@ <summary>Gets or sets the minimum width, in pixels, of the column.</summary> <value>The number of pixels, from 2 to <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>, that specifies the minimum width of the column. The default is 5.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property sets a limit on how narrow the column can be resized in the user interface (UI). The <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property can override the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property. - - - -## Examples - The following code example sets the minimum width of a column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property sets a limit on how narrow the column can be resized in the user interface (UI). The <xref:System.Windows.Forms.DataGridViewColumn.Width%2A> property can override the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property. + + + +## Examples + The following code example sets the minimum width of a column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet107"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet107"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet107"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet107"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The value is less than 2 or greater than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception> @@ -1406,19 +1406,19 @@ <summary>Gets or sets the name of the column.</summary> <value>A <see cref="T:System.String" /> that contains the name of the column. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property represents a formal name associated with the column that can be used to identify the column in a collection. For example, the <xref:System.Windows.Forms.DataGridViewColumnCollection.Remove%2A> and <xref:System.Windows.Forms.DataGridViewColumnCollection.Contains%2A> methods of the <xref:System.Windows.Forms.DataGridViewColumnCollection> class use the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> property. The name is case-insensitive. The <xref:System.Windows.Forms.DataGridView> will treat `column1` and `COLUMN1` as the same column. - - - -## Examples - The following code example shows how to set the column name. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property represents a formal name associated with the column that can be used to identify the column in a collection. For example, the <xref:System.Windows.Forms.DataGridViewColumnCollection.Remove%2A> and <xref:System.Windows.Forms.DataGridViewColumnCollection.Contains%2A> methods of the <xref:System.Windows.Forms.DataGridViewColumnCollection> class use the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> property. The name is case-insensitive. The <xref:System.Windows.Forms.DataGridView> will treat `column1` and `COLUMN1` as the same column. + + + +## Examples + The following code example shows how to set the column name. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1454,20 +1454,20 @@ <value> <see langword="true" /> if the user cannot edit the column's cells; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewColumn.ReadOnly%2A> property affects the <xref:System.Windows.Forms.DataGridViewCell.ReadOnly%2A?displayProperty=nameWithType> property of each cell in the column. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.ReadOnly%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.ReadOnly%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewColumn.ReadOnly%2A> property affects the <xref:System.Windows.Forms.DataGridViewCell.ReadOnly%2A?displayProperty=nameWithType> property of each cell in the column. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.ReadOnly%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.ReadOnly%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet11"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet11"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">This property is set to <see langword="false" /> for a column that is bound to a read-only data source.</exception> @@ -1501,24 +1501,24 @@ <summary>Gets or sets a value indicating whether the column is resizable.</summary> <value>One of the <see cref="T:System.Windows.Forms.DataGridViewTriState" /> values. The default is <see cref="F:System.Windows.Forms.DataGridViewTriState.True" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property is <xref:System.Windows.Forms.DataGridViewTriState.False>, the user will not be able to manually adjust the column width. - - By default, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value is based on the <xref:System.Windows.Forms.DataGridView.AllowUserToResizeColumns%2A?displayProperty=nameWithType> property value. If you explicitly set <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> to <xref:System.Windows.Forms.DataGridViewTriState.True> or <xref:System.Windows.Forms.DataGridViewTriState.False>, however, the control value is ignored. Set <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> to <xref:System.Windows.Forms.DataGridViewTriState.NotSet> to restore the value-inheritance behavior. - - Because <xref:System.Windows.Forms.DataGridViewTriState.NotSet> restores the value inheritance, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property will never return a <xref:System.Windows.Forms.DataGridViewTriState.NotSet> value unless the column has not been added to a <xref:System.Windows.Forms.DataGridView> control. If you need to determine whether the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value of a column is inherited, check its <xref:System.Windows.Forms.DataGridViewElement.State%2A> property. If the <xref:System.Windows.Forms.DataGridViewElement.State%2A> property value includes the <xref:System.Windows.Forms.DataGridViewElementStates.ResizableSet> flag, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value is not inherited. - - - -## Examples - The following code example uses this property to fix the size of the third column so that the user cannot change the column width. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property is <xref:System.Windows.Forms.DataGridViewTriState.False>, the user will not be able to manually adjust the column width. + + By default, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value is based on the <xref:System.Windows.Forms.DataGridView.AllowUserToResizeColumns%2A?displayProperty=nameWithType> property value. If you explicitly set <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> to <xref:System.Windows.Forms.DataGridViewTriState.True> or <xref:System.Windows.Forms.DataGridViewTriState.False>, however, the control value is ignored. Set <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> to <xref:System.Windows.Forms.DataGridViewTriState.NotSet> to restore the value-inheritance behavior. + + Because <xref:System.Windows.Forms.DataGridViewTriState.NotSet> restores the value inheritance, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property will never return a <xref:System.Windows.Forms.DataGridViewTriState.NotSet> value unless the column has not been added to a <xref:System.Windows.Forms.DataGridView> control. If you need to determine whether the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value of a column is inherited, check its <xref:System.Windows.Forms.DataGridViewElement.State%2A> property. If the <xref:System.Windows.Forms.DataGridViewElement.State%2A> property value includes the <xref:System.Windows.Forms.DataGridViewElementStates.ResizableSet> flag, the <xref:System.Windows.Forms.DataGridViewColumn.Resizable%2A> property value is not inherited. + + + +## Examples + The following code example uses this property to fix the size of the third column so that the user cannot change the column width. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/CPP/mousesizing.cpp" id="Snippet12"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewBand/Resizable/mousesizing.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/VB/mousesizing.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/VB/mousesizing.vb" id="Snippet12"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1611,35 +1611,35 @@ <summary>Gets or sets the sort mode for the column.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewColumnSortMode" /> that specifies the criteria used to order the rows based on the cell values in a column.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DataGridView> control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>, a sorting glyph is automatically displayed in the column header. - - Starting in the .NET Framework 4.6, the sorting glyph is resized according to the system DPI settings when the app.config file contains the following entry: - -``` -<appSettings> - <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" /> -</appSettings> -``` - - When the control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic>, you must display the sorting glyph yourself through the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property. - - The default sort mode of a <xref:System.Windows.Forms.DataGridViewTextBoxColumn> is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. The default sort mode for other column types is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. - - The <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the <xref:System.Windows.Forms.DataGridView.Sort%2A> method. - - A <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable> will not prevent the <xref:System.Windows.Forms.DataGridView.ColumnHeaderMouseClick?displayProperty=nameWithType> event from occurring, but it will prevent the header from changing its appearance when it is clicked. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DataGridView> control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>, a sorting glyph is automatically displayed in the column header. + + Starting in the .NET Framework 4.6, the sorting glyph is resized according to the system DPI settings when the app.config file contains the following entry: + +``` +<appSettings> + <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" /> +</appSettings> +``` + + When the control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic>, you must display the sorting glyph yourself through the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property. + + The default sort mode of a <xref:System.Windows.Forms.DataGridViewTextBoxColumn> is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. The default sort mode for other column types is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. + + The <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the <xref:System.Windows.Forms.DataGridView.Sort%2A> method. + + A <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable> will not prevent the <xref:System.Windows.Forms.DataGridView.ColumnHeaderMouseClick?displayProperty=nameWithType> event from occurring, but it will prevent the header from changing its appearance when it is clicked. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value assigned to the property conflicts with <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" />.</exception> @@ -1689,20 +1689,20 @@ <summary>Gets or sets the text used for ToolTips.</summary> <value>The text to display as a ToolTip for the column.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The column's ToolTip displays when the mouse pointer rests on the column header. - - - -## Examples - The following code example shows how to set a column's ToolTip. This code example is part of a larger code example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The column's ToolTip displays when the mouse pointer rests on the column header. + + + +## Examples + The following code example shows how to set a column's ToolTip. This code example is part of a larger code example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet145"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet145"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet145"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet145"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1735,11 +1735,11 @@ <summary>Gets a string that describes the column.</summary> <returns>A <see cref="T:System.String" /> that describes the column.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method overrides the <xref:System.Object.ToString%2A?displayProperty=nameWithType> method. The returned string contains the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> and <xref:System.Windows.Forms.DataGridViewBand.Index%2A> properties of the <xref:System.Windows.Forms.DataGridViewColumn>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method overrides the <xref:System.Object.ToString%2A?displayProperty=nameWithType> method. The returned string contains the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> and <xref:System.Windows.Forms.DataGridViewBand.Index%2A> properties of the <xref:System.Windows.Forms.DataGridViewColumn>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1792,19 +1792,19 @@ <summary>Gets or sets the data type of the values in the column's cells.</summary> <value>A <see cref="T:System.Type" /> that describes the run-time class of the values stored in the column's cells.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is used when filtering or sorting the columns with respect to the contents of their cells. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumn.ValueType%2A> property in the initialization of a <xref:System.Windows.Forms.DataGridViewComboBoxColumn> that contains <xref:System.Drawing.Color> values. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is used when filtering or sorting the columns with respect to the contents of their cells. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumn.ValueType%2A> property in the initialization of a <xref:System.Windows.Forms.DataGridViewComboBoxColumn> that contains <xref:System.Drawing.Color> values. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1848,22 +1848,22 @@ <value> <see langword="true" /> if the column is visible; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to hide a column from view while keeping the column in the <xref:System.Windows.Forms.DataGridView>. To completely remove a column, use the <xref:System.Windows.Forms.DataGridViewColumnCollection.Remove%2A?displayProperty=nameWithType> method. - - To hide a column that is automatically generated when binding to a data source, set this property in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete> event handler. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.Visible%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class overview. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to hide a column from view while keeping the column in the <xref:System.Windows.Forms.DataGridView>. To completely remove a column, use the <xref:System.Windows.Forms.DataGridViewColumnCollection.Remove%2A?displayProperty=nameWithType> method. + + To hide a column that is automatically generated when binding to a data source, set this property in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete> event handler. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewBand.Visible%2A?displayProperty=nameWithType> property, which is nearly identical to the <xref:System.Windows.Forms.DataGridViewColumn.Visible%2A> property of the <xref:System.Windows.Forms.DataGridViewColumn> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewBand> class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet9"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1909,20 +1909,20 @@ <summary>Gets or sets the current width of the column.</summary> <value>The width, in pixels, of the column. The default is 100.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the specified value when setting this property is less than the value of the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property, the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property value is used instead. - - - -## Examples - The following code example sets the width of a column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the specified value when setting this property is less than the value of the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property, the <xref:System.Windows.Forms.DataGridViewColumn.MinimumWidth%2A> property value is used instead. + + + +## Examples + The following code example sets the width of a column. This code example is part of a larger example provided for the <xref:System.Windows.Forms.DataGridViewColumn> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet108"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet108"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet108"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet108"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is greater than 65536.</exception> diff --git a/xml/System.Windows.Forms/DataGridViewColumnCollection.xml b/xml/System.Windows.Forms/DataGridViewColumnCollection.xml index beea4a0298a..1f117b978d9 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnCollection.xml @@ -43,19 +43,19 @@ <Docs> <summary>Represents a collection of <see cref="T:System.Windows.Forms.DataGridViewColumn" /> objects in a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can retrieve an instance of this class through the <xref:System.Windows.Forms.DataGridView.Columns%2A> property of the <xref:System.Windows.Forms.DataGridView> control. The collection maintains a reference to the control through the <xref:System.Windows.Forms.DataGridViewColumnCollection.DataGridView%2A> property. - - - -## Examples - The following code example illustrates the use of this type. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can retrieve an instance of this class through the <xref:System.Windows.Forms.DataGridView.Columns%2A> property of the <xref:System.Windows.Forms.DataGridView> control. The collection maintains a reference to the control through the <xref:System.Windows.Forms.DataGridViewColumnCollection.DataGridView%2A> property. + + + +## Examples + The following code example illustrates the use of this type. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -132,72 +132,72 @@ <summary>Adds the given column to the collection.</summary> <returns>The index of the column.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates the use of this method. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates the use of this method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewColumn" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - <paramref name="dataGridViewColumn" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - - The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. - - -or- - - The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. - - -or- - - <paramref name="dataGridViewColumn" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. - - -or- - - <paramref name="dataGridViewColumn" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. - - -or- - - <paramref name="dataGridViewColumn" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + <paramref name="dataGridViewColumn" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + + The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. + + -or- + + The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. + + -or- + + <paramref name="dataGridViewColumn" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. + + -or- + + <paramref name="dataGridViewColumn" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. + + -or- + + <paramref name="dataGridViewColumn" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. + + -or- + The <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row and <paramref name="dataGridViewColumn" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -246,47 +246,47 @@ <summary>Adds a <see cref="T:System.Windows.Forms.DataGridViewTextBoxColumn" /> with the given column name and column header text to the collection.</summary> <returns>The index of the column.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `columnName` and `headerText` parameters are related to the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> and <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> properties, respectively. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `columnName` and `headerText` parameters are related to the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A> and <xref:System.Windows.Forms.DataGridViewColumn.HeaderText%2A> properties, respectively. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - The <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />, which conflicts with the default column <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" />. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + The <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />, which conflicts with the default column <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" />. + + -or- + The default column <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value of 100 would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -328,80 +328,80 @@ <param name="dataGridViewColumns">An array of <see cref="T:System.Windows.Forms.DataGridViewColumn" /> objects to add.</param> <summary>Adds a range of columns to the collection.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet40"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewColumns" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - At least one of the values in <paramref name="dataGridViewColumns" /> is <see langword="null" />. - - -or- - - At least one of the columns in <paramref name="dataGridViewColumns" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - - At least one of the columns in <paramref name="dataGridViewColumns" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" /> and the <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row. - - -or- - - At least one of the columns in <paramref name="dataGridViewColumns" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. - - -or- - - At least one of the columns in <paramref name="dataGridViewColumns" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. - - -or- - - At least one of the columns in <paramref name="dataGridViewColumns" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. - - -or- - - The columns in <paramref name="dataGridViewColumns" /> have <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property values that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. - - -or- - - At least two of the values in <paramref name="dataGridViewColumns" /> are references to the same <see cref="T:System.Windows.Forms.DataGridViewColumn" />. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + At least one of the values in <paramref name="dataGridViewColumns" /> is <see langword="null" />. + + -or- + + At least one of the columns in <paramref name="dataGridViewColumns" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + + At least one of the columns in <paramref name="dataGridViewColumns" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" /> and the <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row. + + -or- + + At least one of the columns in <paramref name="dataGridViewColumns" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. + + -or- + + At least one of the columns in <paramref name="dataGridViewColumns" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. + + -or- + + At least one of the columns in <paramref name="dataGridViewColumns" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. + + -or- + + The columns in <paramref name="dataGridViewColumns" /> have <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property values that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. + + -or- + + At least two of the values in <paramref name="dataGridViewColumns" /> are references to the same <see cref="T:System.Windows.Forms.DataGridViewColumn" />. + + -or- + At least one of the columns in <paramref name="dataGridViewColumns" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -433,42 +433,42 @@ <Docs> <summary>Clears the collection.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelEdit/fillcolumns.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewFillColumnsDemo/vb/fillcolumns.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewFillColumnsDemo/vb/fillcolumns.vb" id="Snippet20"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -506,23 +506,23 @@ <Docs> <summary>Occurs when the collection changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridViewColumnCollection.CollectionChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridViewColumnCollection> named `DataGridViewColumnCollection1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridViewColumnCollection.CollectionChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridViewColumnCollection.CollectionChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridViewColumnCollection> named `DataGridViewColumnCollection1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridViewColumnCollection.CollectionChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet372"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet372"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet372"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -569,11 +569,11 @@ <returns> <see langword="true" /> if the column is contained in the collection; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The name of a column is indicated by the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The name of a column is indicated by the <xref:System.Windows.Forms.DataGridViewColumn.Name%2A?displayProperty=nameWithType> property. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -719,14 +719,14 @@ <summary>Returns the number of columns that meet the given filter requirements.</summary> <returns>The number of columns that meet the filter requirements.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example illustrates how to use this method to get the number of selected columns. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example illustrates how to use this method to get the number of selected columns. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AreAllCellsSelected/DataGridViewSelectedCollections.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectedCollections/VB/DataGridViewSelectedCollections.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectedCollections/VB/DataGridViewSelectedCollections.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -766,14 +766,14 @@ <summary>Returns the width, in pixels, required to display all of the columns that meet the given filter requirements.</summary> <returns>The width, in pixels, that is necessary to display all of the columns that meet the filter requirements.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -823,22 +823,22 @@ <summary>Returns the first column in display order that meets the given inclusion-filter requirements.</summary> <returns>The first column in display order that meets the given filter requirements, or <see langword="null" /> if no column is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The first column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column that fits the given criteria without having to compare index values directly. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetFirstColumn%2A> method to swap the first displayed column and the last displayed column. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The first column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column that fits the given criteria without having to compare index values directly. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetFirstColumn%2A> method to swap the first displayed column and the last displayed column. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -882,13 +882,13 @@ <summary>Returns the first column in display order that meets the given inclusion-filter and exclusion-filter requirements.</summary> <returns>The first column in display order that meets the given filter requirements, or <see langword="null" /> if no column is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The first column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column that fits the given criteria without having to compare index values directly. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The first column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column that fits the given criteria without having to compare index values directly. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">At least one of the filter values is not a valid bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values.</exception> @@ -931,22 +931,22 @@ <summary>Returns the last column in display order that meets the given filter requirements.</summary> <returns>The last displayed column in display order that meets the given filter requirements, or <see langword="null" /> if no column is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The last column in display order is the column with the highest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the last column that fits the given criteria without having to compare index values directly. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetLastColumn%2A> method to swap the last displayed column and the first displayed column. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The last column in display order is the column with the highest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the last column that fits the given criteria without having to compare index values directly. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.DataGridViewColumnCollection.GetLastColumn%2A> method to swap the last displayed column and the first displayed column. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">At least one of the filter values is not a valid bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values.</exception> @@ -991,13 +991,13 @@ <summary>Gets the first column after the given column in display order that meets the given filter requirements.</summary> <returns>The next column that meets the given filter requirements, or <see langword="null" /> if no column is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The next column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value higher than the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value of the specified column, regardless of whether the column is actually visible on the screen. - - This method lets you determine the next column after the current column that fits the given criteria without having to compare index values directly. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The next column in display order is the column with the lowest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value higher than the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value of the specified column, regardless of whether the column is actually visible on the screen. + + This method lets you determine the next column after the current column that fits the given criteria without having to compare index values directly. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -1044,13 +1044,13 @@ <summary>Gets the last column prior to the given column in display order that meets the given filter requirements.</summary> <returns>The previous column that meets the given filter requirements, or <see langword="null" /> if no column is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The previous column in display order is the column with the highest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value lower than the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value of the specified column, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column before the current column that fits the given criteria without having to compare index values directly. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The previous column in display order is the column with the highest <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value lower than the <xref:System.Windows.Forms.DataGridViewColumn.DisplayIndex%2A> value of the specified column, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column before the current column that fits the given criteria without having to compare index values directly. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -1127,68 +1127,68 @@ <param name="dataGridViewColumn">The <see cref="T:System.Windows.Forms.DataGridViewColumn" /> to insert.</param> <summary>Inserts a column at the given index in the collection.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet010"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewColumn" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - <paramref name="dataGridViewColumn" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - - The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. - - -or- - - The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. - - -or- - - <paramref name="dataGridViewColumn" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. - - -or- - - <paramref name="dataGridViewColumn" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + <paramref name="dataGridViewColumn" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + + The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. + + -or- + + The <paramref name="dataGridViewColumn" /><see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. + + -or- + + <paramref name="dataGridViewColumn" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. + + -or- + + <paramref name="dataGridViewColumn" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. + + -or- + The <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row and <paramref name="dataGridViewColumn" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -1346,13 +1346,13 @@ <param name="e">A <see cref="T:System.ComponentModel.CollectionChangeEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DataGridViewColumnCollection.CollectionChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DataGridViewColumnCollection.OnCollectionChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DataGridViewColumnCollection.OnCollectionChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1401,53 +1401,53 @@ <param name="columnName">The name of the column to delete.</param> <summary>Removes the column with the specified name from the collection.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet110"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet110"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet110"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> <paramref name="columnName" /> does not match the name of any column in the collection.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="columnName" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.DataBindingComplete" /> @@ -1484,43 +1484,43 @@ <param name="dataGridViewColumn">The column to delete.</param> <summary>Removes the specified column from the collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To remove a column that is automatically generated when binding to a data source, call this method in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete?displayProperty=nameWithType> event handler. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To remove a column that is automatically generated when binding to a data source, call this method in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete?displayProperty=nameWithType> event handler. + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> <paramref name="dataGridViewColumn" /> is not in the collection.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="dataGridViewColumn" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.DataBindingComplete" /> @@ -1556,41 +1556,41 @@ <param name="index">The index of the column to delete.</param> <summary>Removes the column at the given index in the collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To remove a column that is automatically generated when binding to a data source, call this method in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete?displayProperty=nameWithType> event handler. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To remove a column that is automatically generated when binding to a data source, call this method in a <xref:System.Windows.Forms.DataGridView.DataBindingComplete?displayProperty=nameWithType> event handler. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="index" /> is less than zero or greater than the number of columns in the control minus one.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.DataBindingComplete" /> @@ -1631,11 +1631,11 @@ <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param> <summary>Copies the entire contents of the collection to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -1643,10 +1643,10 @@ <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="index" /> is less than 0.</exception> <exception cref="T:System.ArgumentException"> - <paramref name="array" /> is multidimensional. - - -or- - + <paramref name="array" /> is multidimensional. + + -or- + The number of elements in the source collection is greater than the available space from <paramref name="index" /> to the end of <paramref name="array" />.</exception> <exception cref="T:System.InvalidCastException">The type of the source element cannot be cast automatically to the type of <paramref name="array" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1684,11 +1684,11 @@ <summary>Gets the number of elements in the collection.</summary> <value>The number of elements in the <see cref="T:System.Windows.Forms.DataGridViewColumnCollection" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1726,11 +1726,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1767,11 +1767,11 @@ <summary>Gets an object that can be used to synchronize access to the collection.</summary> <value>An <see cref="T:System.Object" /> that can be used to synchronize access to the collection.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.ICollection> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1809,11 +1809,11 @@ <summary>Returns an enumerator that iterates through the collection.</summary> <returns>An <see cref="T:System.Collections.IEnumerator" /> that can be used to iterate through the collection.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IEnumerable> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IEnumerable> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -1856,71 +1856,71 @@ <summary>Adds an object to the end of the collection.</summary> <returns>The index at which <paramref name="value" /> has been added.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <exception cref="T:System.InvalidCastException"> <paramref name="value" /> is not a <see cref="T:System.Windows.Forms.DataGridViewColumn" />.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="value" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - The column indicated by <paramref name="value" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - - The <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. - - -or- - - The <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. - - -or- - - The column indicated by <paramref name="value" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. - - -or- - - The column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. - - -or- - - The column indicated by <paramref name="value" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + The column indicated by <paramref name="value" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + + The <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. + + -or- + + The <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. + + -or- + + The column indicated by <paramref name="value" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. + + -or- + + The column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. + + -or- + + The column indicated by <paramref name="value" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. + + -or- + The <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row and the column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -1962,39 +1962,39 @@ <Docs> <summary>Removes all elements from the collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -2036,11 +2036,11 @@ <returns> <see langword="true" /> if <paramref name="value" /> is found in the <see cref="T:System.Windows.Forms.DataGridViewColumnCollection" />; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -2084,11 +2084,11 @@ <summary>Determines the index of a specific item in the collection.</summary> <returns>The zero-based index of the first occurrence of <paramref name="value" /> within the collection, if found; otherwise, -1.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -2131,71 +2131,71 @@ <param name="value">The <see cref="T:System.Object" /> to insert. The value can be <see langword="null" />.</param> <summary>Inserts an element into the collection at the specified index.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <exception cref="T:System.InvalidCastException"> <paramref name="value" /> is not a <see cref="T:System.Windows.Forms.DataGridViewColumn" />.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="value" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> - - -or- - - The column indicated by <paramref name="value" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. - - -or- - - The <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. - - -or- - - The <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. - - -or- - - The column indicated by <paramref name="value" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. - - -or- - - The column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. - - -or- - - The column indicated by <paramref name="value" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. - - -or- - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /> + + -or- + + The column indicated by <paramref name="value" /> already belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control. + + -or- + + The <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.Automatic" /> and the <see cref="P:System.Windows.Forms.DataGridView.SelectionMode" /> property value is <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.FullColumnSelect" /> or <see cref="F:System.Windows.Forms.DataGridViewSelectionMode.ColumnHeaderSelect" />. Use the control <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#BeginInit" /> and <see cref="M:System.Windows.Forms.DataGridView.System#ComponentModel#ISupportInitialize#EndInit" /> methods to temporarily set conflicting property values. + + -or- + + The <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of the column indicated by <paramref name="value" /> is <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader" /> and the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersVisible" /> property value is <see langword="false" />. + + -or- + + The column indicated by <paramref name="value" /> has an <see cref="P:System.Windows.Forms.DataGridViewColumn.InheritedAutoSizeMode" /> property value of <see cref="F:System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill" /> and a <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value of <see langword="true" />. + + -or- + + The column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> property value that would cause the combined <see cref="P:System.Windows.Forms.DataGridViewColumn.FillWeight" /> values of all columns in the control to exceed 65535. + + -or- + + The column indicated by <paramref name="value" /> has <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> and <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property values that would display it among a set of adjacent columns with the opposite <see cref="P:System.Windows.Forms.DataGridViewColumn.Frozen" /> property value. + + -or- + The <see cref="T:System.Windows.Forms.DataGridView" /> control contains at least one row and the column indicated by <paramref name="value" /> has a <see cref="P:System.Windows.Forms.DataGridViewColumn.CellType" /> property value of <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -2232,11 +2232,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -2274,11 +2274,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -2330,13 +2330,13 @@ <summary>Gets or sets the element at the specified index.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewColumn" /> at the specified index.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - - This implementation does not support setting this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + + This implementation does not support setting this property. + ]]></format> </remarks> <exception cref="T:System.NotSupportedException">This property is being set.</exception> @@ -2379,11 +2379,11 @@ <param name="value">The <see cref="T:System.Object" /> to remove from the collection. The value can be <see langword="null" />.</param> <summary>Removes the first occurrence of the specified object from the collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <exception cref="T:System.InvalidCastException"> @@ -2392,32 +2392,32 @@ <paramref name="value" /> is not in the collection.</exception> <exception cref="T:System.ArgumentNullException"> <paramref name="value" /> is <see langword="null" />.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> @@ -2462,41 +2462,41 @@ <param name="index">The location of the element to delete.</param> <summary>Removes the element with the specified index from the collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.DataGridViewColumnCollection> instance is cast to an <xref:System.Collections.IList> interface. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="index" /> is less than zero or greater than the number of columns in the control minus one.</exception> - <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. - - -or- - - This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: - -- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> - -- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> - -- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> - + <exception cref="T:System.InvalidOperationException">The associated <see cref="T:System.Windows.Forms.DataGridView" /> control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column <see cref="P:System.Windows.Forms.DataGridViewColumn.DisplayIndex" /> property values. + + -or- + + This method is being called from a handler for one of the following <see cref="T:System.Windows.Forms.DataGridView" /> events: + +- <see cref="E:System.Windows.Forms.DataGridView.CellEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidating" /> + +- <see cref="E:System.Windows.Forms.DataGridView.CellValidated" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowEnter" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowLeave" /> + +- <see cref="E:System.Windows.Forms.DataGridView.RowValidated" /> + - <see cref="E:System.Windows.Forms.DataGridView.RowValidating" /></exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> diff --git a/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml b/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml index a564f1b1acd..f6d66469005 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml @@ -57,11 +57,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property to <xref:System.Windows.Forms.SortOrder.None>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property to <xref:System.Windows.Forms.SortOrder.None>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -125,14 +125,14 @@ <summary>Creates a new accessible object for the <see cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" />.</summary> <returns>A new <see cref="T:System.Windows.Forms.AccessibleObject" /> for the <see cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A>, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A>, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -185,17 +185,17 @@ <summary>Retrieves the formatted value of the cell to copy to the <see cref="T:System.Windows.Forms.Clipboard" />.</summary> <returns>A <see cref="T:System.Object" /> that represents the value of the cell to copy to the <see cref="T:System.Windows.Forms.Clipboard" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Depending on the value of the <xref:System.Windows.Forms.DataGridView.ClipboardCopyMode%2A> property of the <xref:System.Windows.Forms.DataGridView> control, this method is called by the control's <xref:System.Windows.Forms.DataGridView.GetClipboardContent%2A> method to retrieve a clipboard-formatted value that represents the cell. - - The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the <xref:System.Windows.Forms.DataGridView> control. Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row. - - The supported clipboard formats include <xref:System.Windows.Forms.DataFormats.Text?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.UnicodeText?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.Html?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataFormats.CommaSeparatedValue?displayProperty=nameWithType>. - - For more information, see the <xref:System.Windows.Forms.Clipboard> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Depending on the value of the <xref:System.Windows.Forms.DataGridView.ClipboardCopyMode%2A> property of the <xref:System.Windows.Forms.DataGridView> control, this method is called by the control's <xref:System.Windows.Forms.DataGridView.GetClipboardContent%2A> method to retrieve a clipboard-formatted value that represents the cell. + + The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the <xref:System.Windows.Forms.DataGridView> control. Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row. + + The supported clipboard formats include <xref:System.Windows.Forms.DataFormats.Text?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.UnicodeText?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataFormats.Html?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataFormats.CommaSeparatedValue?displayProperty=nameWithType>. + + For more information, see the <xref:System.Windows.Forms.Clipboard> class. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -240,11 +240,11 @@ <summary>Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified <see cref="T:System.Drawing.Graphics" /> object and cell style.</summary> <returns>The <see cref="T:System.Drawing.Rectangle" /> that bounds the cell's contents.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the cell's contents is computed dynamically when this method is called. This method is called internally when the <xref:System.Windows.Forms.DataGridViewCell.ContentBounds%2A> property is read. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the cell's contents is computed dynamically when this method is called. This method is called internally when the <xref:System.Windows.Forms.DataGridViewCell.ContentBounds%2A> property is read. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -253,7 +253,7 @@ <altmember cref="T:System.Drawing.Rectangle" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.ContentBounds" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetInheritedContextMenuStrip"> @@ -337,11 +337,11 @@ <summary>Gets the style applied to the cell.</summary> <returns>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that includes the style settings of the cell inherited from the cell's parent row, column, and <see cref="T:System.Windows.Forms.DataGridView" />.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -352,7 +352,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewCell.InheritedStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.HasStyle" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.Style" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetPreferredSize"> @@ -396,7 +396,7 @@ <altmember cref="T:System.Drawing.Size" /> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetValue"> @@ -590,26 +590,26 @@ <summary>Gets or sets a value indicating which sort glyph is displayed.</summary> <value>A <see cref="T:System.Windows.Forms.SortOrder" /> value representing the current glyph. The default is <see cref="F:System.Windows.Forms.SortOrder.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is set automatically for columns with the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property set to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic?displayProperty=nameWithType>. You must set this property yourself when sorting by columns with the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property set to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic?displayProperty=nameWithType>. - - - -## Examples - The following code demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property in a programmatic sort. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is set automatically for columns with the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property set to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic?displayProperty=nameWithType>. You must set this property yourself when sorting by columns with the <xref:System.Windows.Forms.DataGridViewColumn.SortMode%2A> property set to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic?displayProperty=nameWithType>. + + + +## Examples + The following code demonstrates how to use the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property in a programmatic sort. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SelectedColumns/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewProgrammaticSort/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewProgrammaticSort/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value when setting this property is not a valid <see cref="T:System.Windows.Forms.SortOrder" /> value.</exception> - <exception cref="T:System.InvalidOperationException">When setting this property, the value of either the <see cref="P:System.Windows.Forms.DataGridViewCell.OwningColumn" /> property or the <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property of the cell is <see langword="null" />. - - -or- - + <exception cref="T:System.InvalidOperationException">When setting this property, the value of either the <see cref="P:System.Windows.Forms.DataGridViewCell.OwningColumn" /> property or the <see cref="P:System.Windows.Forms.DataGridViewElement.DataGridView" /> property of the cell is <see langword="null" />. + + -or- + When changing the value of this property, the specified value is not <see cref="F:System.Windows.Forms.SortOrder.None" /> and the value of the <see cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> property of the owning column is <see cref="F:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.SortOrder" /> diff --git a/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml b/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml index 5aec9f0a9a6..0001e389dea 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml @@ -22,29 +22,29 @@ <Docs> <summary>Defines values for specifying how the height of the column headers is adjusted.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example illustrates the use of this enumeration in a display-only, non-interactive <xref:System.Windows.Forms.DataGridView> control. - + <format type="text/markdown"><. + + + +## Examples + The following code example illustrates the use of this enumeration in a display-only, non-interactive <xref:System.Windows.Forms.DataGridView> control. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.ColumnHeadersHeightSizeMode" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeColumnHeadersHeight" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AutoSize"> diff --git a/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml b/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml index ef9fdd483e3..11bd9c6a38b 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml @@ -22,19 +22,19 @@ <Docs> <summary>Defines how a <see cref="T:System.Windows.Forms.DataGridView" /> column can be sorted by the user.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml b/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml index f16328031fd..ea51265a745 100644 --- a/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml @@ -64,7 +64,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewComboBoxEditingControl" /> <altmember cref="T:System.Windows.Forms.DataGridViewComboBoxColumn" /> <altmember cref="P:System.Windows.Forms.DataGridViewComboBoxColumn.CellTemplate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list">How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list">How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -1006,7 +1006,7 @@ For additional information, see [What's New in Accessibility in the .NET Framewo <altmember cref="P:System.Windows.Forms.ComboBox.Items" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.Value" /> <altmember cref="P:System.Windows.Forms.DataGridViewComboBoxCell.DisplayMember" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="KeyEntersEditMode"> @@ -1045,14 +1045,14 @@ For additional information, see [What's New in Accessibility in the .NET Framewo ## Remarks When the <xref:System.Windows.Forms.DataGridView.EditMode%2A> property of the <xref:System.Windows.Forms.DataGridView> control is set to <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke> or <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2>, the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode. - This method returns `true` if the e parameter indicates one of the following keys or key combinations: F4, ALT+UP ARROW, ALT+DOWN ARROW, or an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). + This method returns `true` if the e parameter indicates one of the following keys or key combinations: F4, ALT+UP ARROW, ALT+DOWN ARROW, or an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.EditMode" /> <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MaxDropDownItems"> diff --git a/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml index 6dc09a921d6..0e10fff09df 100644 --- a/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml @@ -94,7 +94,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewComboBoxCell" /> <altmember cref="T:System.Windows.Forms.DataGridViewComboBoxEditingControl" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.SortMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list">How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list">How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -250,7 +250,7 @@ ## Examples - The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: diff --git a/xml/System.Windows.Forms/DataGridViewContentAlignment.xml b/xml/System.Windows.Forms/DataGridViewContentAlignment.xml index ca1f6d22315..63607cc721c 100644 --- a/xml/System.Windows.Forms/DataGridViewContentAlignment.xml +++ b/xml/System.Windows.Forms/DataGridViewContentAlignment.xml @@ -22,19 +22,19 @@ <Docs> <summary>Defines constants that indicate the alignment of content within a <see cref="T:System.Windows.Forms.DataGridView" /> cell.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet072"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml b/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml index 2a9ecdd6896..f3104aa31d9 100644 --- a/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml +++ b/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml @@ -28,19 +28,19 @@ <Docs> <summary>Represents the state of a data-bound <see cref="T:System.Windows.Forms.DataGridView" /> control when a data error occurred.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewDataErrorContexts/Overview/errorhandling.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DataError/VB/errorhandling.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DataError/VB/errorhandling.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewEditMode.xml b/xml/System.Windows.Forms/DataGridViewEditMode.xml index fb56ad750fb..d5bf49c8060 100644 --- a/xml/System.Windows.Forms/DataGridViewEditMode.xml +++ b/xml/System.Windows.Forms/DataGridViewEditMode.xml @@ -22,21 +22,21 @@ <Docs> <summary>Specifies how a user starts cell editing in the <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet067"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet067"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet067"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewElementStates.xml b/xml/System.Windows.Forms/DataGridViewElementStates.xml index 1a80df0a6b8..c23ca03a7da 100644 --- a/xml/System.Windows.Forms/DataGridViewElementStates.xml +++ b/xml/System.Windows.Forms/DataGridViewElementStates.xml @@ -32,19 +32,19 @@ <Docs> <summary>Specifies the user interface (UI) state of a element within a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet135"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet135"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet135"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml b/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml index cf8faae9e8b..86db7ee6631 100644 --- a/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml +++ b/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml @@ -22,14 +22,14 @@ <Docs> <summary>Specifies the border style that can be applied to the <see cref="P:System.Windows.Forms.DataGridView.ColumnHeadersBorderStyle" /> and <see cref="P:System.Windows.Forms.DataGridView.RowHeadersBorderStyle" /> properties of a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet030"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet030"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet030"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewHeaderCell.xml b/xml/System.Windows.Forms/DataGridViewHeaderCell.xml index 0cf45e3477b..09ee88ac9c6 100644 --- a/xml/System.Windows.Forms/DataGridViewHeaderCell.xml +++ b/xml/System.Windows.Forms/DataGridViewHeaderCell.xml @@ -568,7 +568,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind <altmember cref="P:System.Windows.Forms.DataGridView.EnableHeadersVisualStyles" /> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> <altmember cref="M:System.Windows.Forms.DataGridViewHeaderCell.OnMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseEnterUnsharesRow"> @@ -622,7 +622,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind <altmember cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> <altmember cref="T:System.Windows.Forms.DataGridViewTopLeftHeaderCell" /> <altmember cref="M:System.Windows.Forms.DataGridViewHeaderCell.OnMouseEnter(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseLeaveUnsharesRow"> @@ -673,7 +673,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind <altmember cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> <altmember cref="T:System.Windows.Forms.DataGridViewTopLeftHeaderCell" /> <altmember cref="M:System.Windows.Forms.DataGridViewHeaderCell.OnMouseLeave(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseUpUnsharesRow"> @@ -724,7 +724,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind <altmember cref="T:System.Windows.Forms.DataGridViewColumnHeaderCell" /> <altmember cref="T:System.Windows.Forms.DataGridViewTopLeftHeaderCell" /> <altmember cref="M:System.Windows.Forms.DataGridViewHeaderCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnMouseDown"> diff --git a/xml/System.Windows.Forms/DataGridViewImageCell.xml b/xml/System.Windows.Forms/DataGridViewImageCell.xml index f5a388a3587..b3aabcf3b78 100644 --- a/xml/System.Windows.Forms/DataGridViewImageCell.xml +++ b/xml/System.Windows.Forms/DataGridViewImageCell.xml @@ -29,24 +29,24 @@ <Docs> <summary>Displays a graphic in a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet10"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -99,11 +99,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewImageCell" /> class, configuring it for use with cell values other than <see cref="T:System.Drawing.Icon" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor calls <xref:System.Windows.Forms.DataGridViewImageCell.%23ctor%28System.Boolean%29> with a `valueIsIcon` parameter value of `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor calls <xref:System.Windows.Forms.DataGridViewImageCell.%23ctor%28System.Boolean%29> with a `valueIsIcon` parameter value of `false`. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -135,15 +135,15 @@ <param name="valueIsIcon">The cell will display an <see cref="T:System.Drawing.Icon" /> value.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewImageCell" /> class, optionally configuring it for use with <see cref="T:System.Drawing.Icon" /> cell values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you use this constructor, the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to the value of the `valueIsIcon` parameter. - - To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, use this constructor with a `valueIsIcon` parameter value of `true`. - - If the `valueIsIcon` parameter is `true`, the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> properties return a <xref:System.Type> object representing the <xref:System.Drawing.Icon> type. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you use this constructor, the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to the value of the `valueIsIcon` parameter. + + To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, use this constructor with a `valueIsIcon` parameter value of `true`. + + If the `valueIsIcon` parameter is `true`, the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> properties return a <xref:System.Type> object representing the <xref:System.Drawing.Icon> type. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -181,11 +181,11 @@ <summary>Creates an exact copy of this cell.</summary> <returns>An <see cref="T:System.Object" /> that represents the cloned <see cref="T:System.Windows.Forms.DataGridViewImageCell" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Override the <xref:System.Windows.Forms.DataGridViewImageCell.Clone%2A> method whenever you derive from <xref:System.Windows.Forms.DataGridViewImageCell> and add new properties to the derived class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Override the <xref:System.Windows.Forms.DataGridViewImageCell.Clone%2A> method whenever you derive from <xref:System.Windows.Forms.DataGridViewImageCell> and add new properties to the derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -221,14 +221,14 @@ <summary>Creates a new accessible object for the <see cref="T:System.Windows.Forms.DataGridViewImageCell" />.</summary> <returns>A new <see cref="T:System.Windows.Forms.DataGridViewImageCell.DataGridViewImageCellAccessibleObject" /> for the <see cref="T:System.Windows.Forms.DataGridViewImageCell" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.DataGridViewImageCell.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.DataGridViewImageCell.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A>, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set <xref:System.Windows.Forms.DataGridViewCell.AccessibilityObject%2A>, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -269,13 +269,13 @@ <summary>Gets the default value that is used when creating a new row.</summary> <value>An object containing a default image placeholder, or <see langword="null" /> to display an empty cell.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of this property should be of type <xref:System.Drawing.Image> or type <xref:System.Drawing.Icon>, depending on the value of the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property. - - Whenever a <xref:System.Windows.Forms.DataGridView> is displayed in which new rows can be added, the last row is an empty new row of cells loaded with default values. Override this property to provide a different default image for these cells or to return `null` to avoid displaying images. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of this property should be of type <xref:System.Drawing.Image> or type <xref:System.Drawing.Icon>, depending on the value of the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property. + + Whenever a <xref:System.Windows.Forms.DataGridView> is displayed in which new rows can be added, the last row is an empty new row of cells loaded with default values. Override this property to provide a different default image for these cells or to return `null` to avoid displaying images. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -316,22 +316,22 @@ <summary>Gets or sets the text associated with the image.</summary> <value>The text associated with the image displayed in the cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -375,11 +375,11 @@ <summary>Gets the type of the cell's hosted editing control.</summary> <value>The <see cref="T:System.Type" /> of the underlying editing control. As implemented in this class, this property is always <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewImageCell.EditType%2A> property is always `null` because there is no associated Windows Forms control for editing an image. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewImageCell.EditType%2A> property is always `null` because there is no associated Windows Forms control for editing an image. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -411,19 +411,19 @@ <summary>Gets the type of the formatted value associated with the cell.</summary> <value>A <see cref="T:System.Type" /> object representing display value type of the cell, which is the <see cref="T:System.Drawing.Image" /> type if the <see cref="P:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon" /> property is set to <see langword="false" /> or the <see cref="T:System.Drawing.Icon" /> type otherwise.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of this property is a property is a <xref:System.Type> object representing either the <xref:System.Drawing.Image> type or the <xref:System.Drawing.Icon> type because a <xref:System.Windows.Forms.DataGridViewImageCell> can only handle graphic images. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A?displayProperty=nameWithType> property to determine the type of the cell contents. In this example, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A?displayProperty=nameWithType> property is used to determine whether the cell contains a <xref:System.String> before attempting to convert the value. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of this property is a property is a <xref:System.Type> object representing either the <xref:System.Drawing.Image> type or the <xref:System.Drawing.Icon> type because a <xref:System.Windows.Forms.DataGridViewImageCell> can only handle graphic images. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A?displayProperty=nameWithType> property to determine the type of the cell contents. In this example, the <xref:System.Windows.Forms.DataGridViewCell.FormattedValueType%2A?displayProperty=nameWithType> property is used to determine whether the cell contains a <xref:System.String> before attempting to convert the value. This example is part of a larger example available in the <xref:System.Windows.Forms.DataGridView.SelectionChanged?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidated/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -556,19 +556,19 @@ <summary>Returns a graphic as it would be displayed in the cell.</summary> <returns>An object that represents the formatted image.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridView> control calls this method to convert a cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property. The control passes the cell value to this method in the `value` parameter. - - If the `context` parameter value includes the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.ClipboardContent> value, this method returns the value of the <xref:System.Windows.Forms.DataGridViewImageCell.Description%2A> property for copying to the Clipboard. Otherwise, the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event occurs. - - A <xref:System.Windows.Forms.DataGridView.CellFormatting> event handler can modify both `value` and `cellStyle`. If the handler does not set the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A?displayProperty=nameWithType> property to `true`, however, this method formats `value` using the formatting properties of the `cellStyle` object. - - If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown. - - If formatting is successful and the type of the formatted value matches the value of the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property, this method returns the formatted value. Otherwise, this method returns a standard error graphic in the type indicated by the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridView> control calls this method to convert a cell value into an equivalent display value of the type indicated by the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property. The control passes the cell value to this method in the `value` parameter. + + If the `context` parameter value includes the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.ClipboardContent> value, this method returns the value of the <xref:System.Windows.Forms.DataGridViewImageCell.Description%2A> property for copying to the Clipboard. Otherwise, the <xref:System.Windows.Forms.DataGridView.CellFormatting?displayProperty=nameWithType> event occurs. + + A <xref:System.Windows.Forms.DataGridView.CellFormatting> event handler can modify both `value` and `cellStyle`. If the handler does not set the <xref:System.Windows.Forms.DataGridViewCellFormattingEventArgs.FormattingApplied%2A?displayProperty=nameWithType> property to `true`, however, this method formats `value` using the formatting properties of the `cellStyle` object. + + If formatting is unsuccessful, the <xref:System.Windows.Forms.DataGridView.DataError> event occurs. If there is no handler for this event or the handler sets the <xref:System.Windows.Forms.DataGridViewDataErrorEventArgs.ThrowException%2A?displayProperty=nameWithType> property to `true`, an exception is thrown. + + If formatting is successful and the type of the formatted value matches the value of the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property, this method returns the formatted value. Otherwise, this method returns a standard error graphic in the type indicated by the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridViewImageCell.FormattedValueType" /> @@ -689,13 +689,13 @@ <summary>Gets or sets the graphics layout for the cell.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewImageCellLayout" /> for this cell. The default is <see cref="F:System.Windows.Forms.DataGridViewImageCellLayout.NotSet" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Changing this property will cause the cell to redraw itself. - - Setting the <xref:System.Windows.Forms.DataGridViewImageColumn.ImageLayout%2A> property of the owning column also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ImageLayout%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Changing this property will cause the cell to redraw itself. + + Setting the <xref:System.Windows.Forms.DataGridViewImageColumn.ImageLayout%2A> property of the owning column also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ImageLayout%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The supplied <see cref="T:System.Windows.Forms.DataGridViewImageCellLayout" /> value is invalid.</exception> @@ -841,17 +841,17 @@ <value> <see langword="true" /> if this cell displays an <see cref="T:System.Drawing.Icon" /> value; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, set this property to `true`. When this property is `true`, the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> properties return a <xref:System.Type> object representing the <xref:System.Drawing.Icon> type. - - Setting the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property of the owning column also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - When the value of this property changes for a cell in the row for new records, the image displayed in the cell is updated to the current value of the <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property. - - Unlike the column <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property, the cell <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property does not automatically update the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the associated cell style when you change its value. When you change the cell <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property value to `true`, be sure to set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property to a valid <xref:System.Drawing.Icon>. When you change the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property value to `false`, be sure to set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property to a valid <xref:System.Drawing.Image>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, set this property to `true`. When this property is `true`, the <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> properties return a <xref:System.Type> object representing the <xref:System.Drawing.Icon> type. + + Setting the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property of the owning column also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + When the value of this property changes for a cell in the row for new records, the image displayed in the cell is updated to the current value of the <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property. + + Unlike the column <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property, the cell <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property does not automatically update the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the associated cell style when you change its value. When you change the cell <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property value to `true`, be sure to set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewCell.Style%2A> property to a valid <xref:System.Drawing.Icon>. When you change the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property value to `false`, be sure to set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property to a valid <xref:System.Drawing.Image>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -895,13 +895,13 @@ <summary>Gets or sets the data type of the values in the cell.</summary> <value>The <see cref="T:System.Type" /> of the cell's value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When retrieving this property, if the <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> for the cell has not been set, then the <xref:System.Windows.Forms.DataGridViewColumn.ValueType%2A?displayProperty=nameWithType> for the owning column is used, if it exists. If no owning column exists, the default value type is used, which is the <xref:System.Drawing.Image> type if the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to `false` and the <xref:System.Drawing.Icon> type otherwise. - - The <xref:System.Windows.Forms.DataGridViewCell.Value%2A> is the actual data object contained in the cell, whereas the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> property is the formatted representation of this object. The <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> properties correspond to the data types of these values, respectively. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When retrieving this property, if the <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> for the cell has not been set, then the <xref:System.Windows.Forms.DataGridViewColumn.ValueType%2A?displayProperty=nameWithType> for the owning column is used, if it exists. If no owning column exists, the default value type is used, which is the <xref:System.Drawing.Image> type if the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to `false` and the <xref:System.Drawing.Icon> type otherwise. + + The <xref:System.Windows.Forms.DataGridViewCell.Value%2A> is the actual data object contained in the cell, whereas the <xref:System.Windows.Forms.DataGridViewCell.FormattedValue%2A> property is the formatted representation of this object. The <xref:System.Windows.Forms.DataGridViewImageCell.ValueType%2A> and <xref:System.Windows.Forms.DataGridViewImageCell.FormattedValueType%2A> properties correspond to the data types of these values, respectively. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml b/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml index ac13d558095..8bd5dc05b00 100644 --- a/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml +++ b/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml @@ -22,15 +22,15 @@ <Docs> <summary>Specifies the layout for an image contained in a <see cref="T:System.Windows.Forms.DataGridViewCell" />.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DataGridViewImageCell.ImageLayout" /> diff --git a/xml/System.Windows.Forms/DataGridViewImageColumn.xml b/xml/System.Windows.Forms/DataGridViewImageColumn.xml index 21587e20ba7..f6c7cb83c04 100644 --- a/xml/System.Windows.Forms/DataGridViewImageColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewImageColumn.xml @@ -41,24 +41,24 @@ <Docs> <summary>Hosts a collection of <see cref="T:System.Windows.Forms.DataGridViewImageCell" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewImageColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that display images. A <xref:System.Windows.Forms.DataGridViewImageColumn> has an associated <xref:System.Windows.Forms.DataGridViewImageCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell is capable of containing an <xref:System.Drawing.Image> or an <xref:System.Drawing.Icon>, depending on the value of the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A?displayProperty=nameWithType> property. Displaying icons is useful to accommodate images with transparency. - - By default, empty cells display a default error graphic. To prevent this graphic from appearing for cell values equal to `null` or <xref:System.DBNull.Value?displayProperty=nameWithType>, set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A?displayProperty=nameWithType> property of the cell style object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property to `null` before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control <xref:System.Windows.Forms.DataGridView.AllowUserToAddRows%2A> property value is `true`, you must also either explicitly set the cell value to `null` in a handler for the control <xref:System.Windows.Forms.DataGridView.RowsAdded> event or set the column <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property to an instance of a <xref:System.Windows.Forms.DataGridViewImageCell>-derived type with an overridden <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property that returns `null`. - - The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. - - - -## Examples - The following code example demonstrates how to use images to create a TicTacToe game. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewImageColumn> class is a specialized type of the <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that display images. A <xref:System.Windows.Forms.DataGridViewImageColumn> has an associated <xref:System.Windows.Forms.DataGridViewImageCell> in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. Each cell is capable of containing an <xref:System.Drawing.Image> or an <xref:System.Drawing.Icon>, depending on the value of the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A?displayProperty=nameWithType> property. Displaying icons is useful to accommodate images with transparency. + + By default, empty cells display a default error graphic. To prevent this graphic from appearing for cell values equal to `null` or <xref:System.DBNull.Value?displayProperty=nameWithType>, set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A?displayProperty=nameWithType> property of the cell style object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property to `null` before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control <xref:System.Windows.Forms.DataGridView.AllowUserToAddRows%2A> property value is `true`, you must also either explicitly set the cell value to `null` in a handler for the control <xref:System.Windows.Forms.DataGridView.RowsAdded> event or set the column <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property to an instance of a <xref:System.Windows.Forms.DataGridViewImageCell>-derived type with an overridden <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property that returns `null`. + + The default sort mode for this column type is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. + + + +## Examples + The following code example demonstrates how to use images to create a TicTacToe game. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet0"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -111,11 +111,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewImageColumn" /> class, configuring it for use with cell values of type <see cref="T:System.Drawing.Image" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor calls <xref:System.Windows.Forms.DataGridViewImageColumn.%23ctor%28System.Boolean%29> with a `valuesAreIcons` parameter value of `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor calls <xref:System.Windows.Forms.DataGridViewImageColumn.%23ctor%28System.Boolean%29> with a `valuesAreIcons` parameter value of `false`. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -150,20 +150,20 @@ <see langword="true" /> to indicate that the <see cref="P:System.Windows.Forms.DataGridViewCell.Value" /> property of cells in this column will be set to values of type <see cref="T:System.Drawing.Icon" />; <see langword="false" /> to indicate that they will be set to values of type <see cref="T:System.Drawing.Image" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewImageColumn" /> class, optionally configuring it for use with <see cref="T:System.Drawing.Icon" /> cell values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the column by setting the following properties. - -|Property|Value| -|--------------|-----------| -|<xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewImageCell> with its <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property initialized to the `valuesAreIcons` parameter value.| -|<xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A>|The value of the `valuesAreIcons` parameter.| -|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| -|The <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property.|A standard error graphic of type <xref:System.Drawing.Icon> if `valuesAreIcons` is `true` and type <xref:System.Drawing.Bitmap> if `valuesAreIcons` is `false`.| - - To ensure that the alpha channel of <xref:System.Drawing.Icon> cell values is painted correctly, use this constructor with a `valuesAreIcons` parameter value of `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the column by setting the following properties. + +|Property|Value| +|--------------|-----------| +|<xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A>|A new <xref:System.Windows.Forms.DataGridViewImageCell> with its <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property initialized to the `valuesAreIcons` parameter value.| +|<xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A>|The value of the `valuesAreIcons` parameter.| +|The <xref:System.Windows.Forms.DataGridViewCellStyle.Alignment%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property.|<xref:System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter?displayProperty=nameWithType>| +|The <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the <xref:System.Windows.Forms.DataGridViewCellStyle> object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property.|A standard error graphic of type <xref:System.Drawing.Icon> if `valuesAreIcons` is `true` and type <xref:System.Drawing.Bitmap> if `valuesAreIcons` is `false`.| + + To ensure that the alpha channel of <xref:System.Drawing.Icon> cell values is painted correctly, use this constructor with a `valuesAreIcons` parameter value of `true`. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -222,23 +222,23 @@ <summary>Gets or sets the template used to create new cells.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCell" /> that all other cells in the column are modeled after.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The constructors for the <xref:System.Windows.Forms.DataGridViewImageColumn> class initialize this property to a newly created <xref:System.Windows.Forms.DataGridViewImageCell>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The constructors for the <xref:System.Windows.Forms.DataGridViewImageColumn> class initialize this property to a newly created <xref:System.Windows.Forms.DataGridViewImageCell>. + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). - - - -## Examples - The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). + + + +## Examples + The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]></format> </remarks> <exception cref="T:System.InvalidCastException">The set type is not compatible with type <see cref="T:System.Windows.Forms.DataGridViewImageCell" />.</exception> @@ -276,11 +276,11 @@ <summary>Creates an exact copy of this column.</summary> <returns>An <see cref="T:System.Object" /> that represents the cloned <see cref="T:System.Windows.Forms.DataGridViewImageColumn" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to duplicate a column of cells. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to duplicate a column of cells. + ]]></format> </remarks> </Docs> @@ -321,36 +321,36 @@ <summary>Gets or sets the column's default cell style.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to be applied as the default style.</value> <remarks> - <format type="text/markdown"><. - - To prevent the standard error graphic from appearing for `null` or <xref:System.DBNull.Value?displayProperty=nameWithType> cell values, set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A?displayProperty=nameWithType> property for this cell style object to `null` or your own error graphic before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control <xref:System.Windows.Forms.DataGridView.AllowUserToAddRows%2A> property value is `true`, you must also either explicitly set the cell value to `null` or your own error graphic in a handler for the control <xref:System.Windows.Forms.DataGridView.RowsAdded> event or set the column <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property to an instance of a <xref:System.Windows.Forms.DataGridViewImageCell>-derived type with an overridden <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property that returns `null` or your own error graphic. - - If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property has a value equal to the standard error graphic of type <xref:System.Drawing.Bitmap>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Icon>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value equal to the standard error graphic of type <xref:System.Drawing.Icon>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Bitmap>. - - - -## Examples - The following code example demonstrates the use of this property. - + <format type="text/markdown"><. + + To prevent the standard error graphic from appearing for `null` or <xref:System.DBNull.Value?displayProperty=nameWithType> cell values, set the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A?displayProperty=nameWithType> property for this cell style object to `null` or your own error graphic before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control <xref:System.Windows.Forms.DataGridView.AllowUserToAddRows%2A> property value is `true`, you must also either explicitly set the cell value to `null` or your own error graphic in a handler for the control <xref:System.Windows.Forms.DataGridView.RowsAdded> event or set the column <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property to an instance of a <xref:System.Windows.Forms.DataGridViewImageCell>-derived type with an overridden <xref:System.Windows.Forms.DataGridViewImageCell.DefaultNewRowValue%2A> property that returns `null` or your own error graphic. + + If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property has a value equal to the standard error graphic of type <xref:System.Drawing.Bitmap>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Icon>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value equal to the standard error graphic of type <xref:System.Drawing.Icon>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Bitmap>. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Description"> @@ -405,22 +405,22 @@ <summary>Gets or sets a string that describes the column's image.</summary> <value>The textual description of the column image. The default is <see cref="F:System.String.Empty" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewImageColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -477,13 +477,13 @@ <summary>Gets or sets the icon displayed in the cells of this column when the cell's <see cref="P:System.Windows.Forms.DataGridViewCell.Value" /> property is not set and the cell's <see cref="P:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon" /> property is set to <see langword="true" />.</summary> <value>The <see cref="T:System.Drawing.Icon" /> to display. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property specifies an icons that is displayed in cells with no values when the column is not data-bound and the cell's <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to `true`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. - - Using the <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property rather than the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> property ensures that an alpha channel in an icon is painted correctly. If you want to display an <xref:System.Drawing.Image> instead of an <xref:System.Drawing.Icon>, set the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> property instead and set the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property to `false`. You can also set the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of individual cells to indicate whether the cell displays the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> or the <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property specifies an icons that is displayed in cells with no values when the column is not data-bound and the cell's <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property is set to `true`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. + + Using the <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property rather than the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> property ensures that an alpha channel in an icon is painted correctly. If you want to display an <xref:System.Drawing.Image> instead of an <xref:System.Drawing.Icon>, set the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> property instead and set the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property to `false`. You can also set the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of individual cells to indicate whether the cell displays the <xref:System.Windows.Forms.DataGridViewImageColumn.Image%2A> or the <xref:System.Windows.Forms.DataGridViewImageColumn.Icon%2A> property value. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -532,22 +532,22 @@ <summary>Gets or sets the image displayed in the cells of this column when the cell's <see cref="P:System.Windows.Forms.DataGridViewCell.Value" /> property is not set and the cell's <see cref="P:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon" /> property is set to <see langword="false" />.</summary> <value>The <see cref="T:System.Drawing.Image" /> to display. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -602,20 +602,20 @@ <summary>Gets or sets the image layout in the cells for this column.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewImageCellLayout" /> that specifies the cell layout. The default is <see cref="F:System.Windows.Forms.DataGridViewImageCellLayout.Normal" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewImageColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -709,15 +709,15 @@ <value> <see langword="true" /> if cells display values of type <see cref="T:System.Drawing.Icon" />; <see langword="false" /> if cells display values of type <see cref="T:System.Drawing.Image" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, set this property to `true`. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property has a value equal to the standard error graphic of type <xref:System.Drawing.Bitmap>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Icon>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value equal to the standard error graphic of type <xref:System.Drawing.Icon>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Bitmap>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To ensure that the alpha channel of <xref:System.Drawing.Icon> values is painted correctly, set this property to `true`. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewImageCell.ValueIsIcon%2A> property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + If the <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewImageColumn.DefaultCellStyle%2A> property has a value equal to the standard error graphic of type <xref:System.Drawing.Bitmap>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `true` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Icon>. If <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> has a value equal to the standard error graphic of type <xref:System.Drawing.Icon>, changing the <xref:System.Windows.Forms.DataGridViewImageColumn.ValuesAreIcons%2A> property value to `false` automatically sets <xref:System.Windows.Forms.DataGridViewCellStyle.NullValue%2A> to the standard error graphic of type <xref:System.Drawing.Bitmap>. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewImageColumn.CellTemplate" /> property is <see langword="null" />.</exception> diff --git a/xml/System.Windows.Forms/DataGridViewLinkCell.xml b/xml/System.Windows.Forms/DataGridViewLinkCell.xml index 248795df445..a8bb9927145 100644 --- a/xml/System.Windows.Forms/DataGridViewLinkCell.xml +++ b/xml/System.Windows.Forms/DataGridViewLinkCell.xml @@ -505,7 +505,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewLinkCell.OnKeyUp(System.Windows.Forms.KeyEventArgs,System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="LinkBehavior"> @@ -690,7 +690,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewLinkCell.OnMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseLeaveUnsharesRow"> @@ -735,7 +735,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewLinkCell.OnMouseLeave(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseMoveUnsharesRow"> @@ -780,7 +780,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewLinkCell.OnMouseMove(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MouseUpUnsharesRow"> @@ -825,7 +825,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewLinkCell.OnMouseUp(System.Windows.Forms.DataGridViewCellMouseEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnKeyUp"> diff --git a/xml/System.Windows.Forms/DataGridViewPaintParts.xml b/xml/System.Windows.Forms/DataGridViewPaintParts.xml index 9de54c8aa4f..37cffc1bb16 100644 --- a/xml/System.Windows.Forms/DataGridViewPaintParts.xml +++ b/xml/System.Windows.Forms/DataGridViewPaintParts.xml @@ -28,19 +28,19 @@ <Docs> <summary>Defines values for specifying the parts of a <see cref="T:System.Windows.Forms.DataGridViewCell" /> that are to be painted.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewRow.xml b/xml/System.Windows.Forms/DataGridViewRow.xml index 11700fcbd56..fc041e1deee 100644 --- a/xml/System.Windows.Forms/DataGridViewRow.xml +++ b/xml/System.Windows.Forms/DataGridViewRow.xml @@ -40,14 +40,14 @@ Unlike a <xref:System.Windows.Forms.DataGridViewColumn>, a <xref:System.Windows.Forms.DataGridViewRow> physically contains a collection of all of the cells in that row. You can access this collection through the <xref:System.Windows.Forms.DataGridViewRow.Cells%2A> property. - The <xref:System.Windows.Forms.DataGridViewRow> class is used to access the individual cell elements, as well as to adjust the appearance and behavior of the row user interface (UI), such as height and cell style. Typically, you will want all rows or most rows in the control to share the same characteristics. To set cell styles for all rows in the control, set the properties of the object returned by the <xref:System.Windows.Forms.DataGridView.RowsDefaultCellStyle%2A?displayProperty=nameWithType> property. To set styles for alternating rows, use the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A?displayProperty=nameWithType> property. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). You can also use the <xref:System.Windows.Forms.DataGridView.RowTemplate%2A?displayProperty=nameWithType> property to define a row that will be used as a basis for all rows added to the control. + The <xref:System.Windows.Forms.DataGridViewRow> class is used to access the individual cell elements, as well as to adjust the appearance and behavior of the row user interface (UI), such as height and cell style. Typically, you will want all rows or most rows in the control to share the same characteristics. To set cell styles for all rows in the control, set the properties of the object returned by the <xref:System.Windows.Forms.DataGridView.RowsDefaultCellStyle%2A?displayProperty=nameWithType> property. To set styles for alternating rows, use the <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A?displayProperty=nameWithType> property. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). You can also use the <xref:System.Windows.Forms.DataGridView.RowTemplate%2A?displayProperty=nameWithType> property to define a row that will be used as a basis for all rows added to the control. The <xref:System.Windows.Forms.DataGridView> control will share <xref:System.Windows.Forms.DataGridViewRow> objects across multiple data rows whenever possible to avoid performance penalties. Unless you are working with large amounts of data and experiencing performance issues, you can typically ignore row sharing. A shared row is indicated by an <xref:System.Windows.Forms.DataGridViewBand.Index%2A> property value of -1. Some members of the <xref:System.Windows.Forms.DataGridViewRow> class cannot be used with shared rows, but you can unshare a row by accessing it through the <xref:System.Windows.Forms.DataGridViewRowCollection.Item%2A?displayProperty=nameWithType> property. Rows can also become unshared in other ways. To access a row without unsharing it, use the <xref:System.Windows.Forms.DataGridViewRowCollection.SharedRow%2A?displayProperty=nameWithType> method. When working with large amounts of data, you should be aware of how rows are shared and unshared to avoid performance penalties. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet209"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet209"::: @@ -61,8 +61,8 @@ <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="M:System.Windows.Forms.DataGridViewRow.Clone" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -271,7 +271,7 @@ ## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.Cells%2A> property to set the value of a cell in the row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.Cells%2A> property to set the value of a cell in the row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: @@ -403,7 +403,7 @@ <altmember cref="P:System.Windows.Forms.DataGridView.DataSource" /> <altmember cref="P:System.Windows.Forms.DataGridView.VirtualMode" /> <altmember cref="T:System.Windows.Forms.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CreateAccessibilityInstance"> @@ -660,7 +660,7 @@ ## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewRow.DataBoundItem%2A> property to access a business object bound to a row. This code example is part of a larger example provided in [How to: Access Objects Bound to Windows Forms DataGridView Rows](/dotnet/framework/winforms/controls/how-to-access-objects-bound-to-windows-forms-datagridview-rows). + The following code example demonstrates how to use the <xref:System.Windows.Forms.DataGridViewRow.DataBoundItem%2A> property to access a business object bound to a row. This code example is part of a larger example provided in [How to: Access Objects Bound to Windows Forms DataGridView Rows](/dotnet/desktop/winforms/controls/how-to-access-objects-bound-to-windows-forms-datagridview-rows). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewRow/DataBoundItem/datagridviewobjectbinding.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewObjectBinding/VB/datagridviewobjectbinding.vb" id="Snippet10"::: @@ -719,7 +719,7 @@ ## Remarks The <xref:System.Windows.Forms.DataGridView> control displays its cells using the styles indicated by the cell <xref:System.Windows.Forms.DataGridViewCell.InheritedStyle%2A> property, which inherits styles from other properties of type <xref:System.Windows.Forms.DataGridViewCellStyle>. For cells in this row, the styles specified through the <xref:System.Windows.Forms.DataGridViewRow.DefaultCellStyle%2A> property override the styles specified through the <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataGridViewColumn.DefaultCellStyle%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.DataGridView.RowsDefaultCellStyle%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle%2A?displayProperty=nameWithType> properties, but are overridden by the styles specified through the <xref:System.Windows.Forms.DataGridViewCell.Style%2A?displayProperty=nameWithType> property. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a <xref:System.Windows.Forms.DataGridViewCellStyle> with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single <xref:System.Windows.Forms.DataGridViewCellStyle> to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -736,8 +736,8 @@ <exception cref="T:System.InvalidOperationException">When setting this property, the row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Displayed"> @@ -775,7 +775,7 @@ <remarks>To be added.</remarks> <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DividerHeight"> @@ -832,7 +832,7 @@ </remarks> <exception cref="T:System.InvalidOperationException">When setting this property, the row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="DrawFocus"> @@ -971,7 +971,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowErrorTextNeeded" /> <altmember cref="E:System.Windows.Forms.DataGridView.RowErrorTextChanged" /> <altmember cref="T:System.Windows.Forms.ErrorProvider" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Frozen"> @@ -1025,7 +1025,7 @@ </remarks> <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetContextMenuStrip"> @@ -1071,7 +1071,7 @@ <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="rowIndex" /> is less than zero or greater than or equal to the number of rows in the control minus one.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetErrorText"> @@ -1114,7 +1114,7 @@ <exception cref="T:System.InvalidOperationException">The row belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <exception cref="T:System.ArgumentOutOfRangeException">The row belongs to a <see cref="T:System.Windows.Forms.DataGridView" /> control and <paramref name="rowIndex" /> is less than zero or greater than the number of rows in the control minus one.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetPreferredHeight"> @@ -1161,12 +1161,12 @@ For cell contents to wrap onto multiple lines, the cell style in effect for the cell must have a <xref:System.Windows.Forms.DataGridViewCellStyle.WrapMode%2A> property value of <xref:System.Windows.Forms.DataGridViewTriState.True>. - For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.GetPreferredHeight%2A> method to determine the new padding for a row that has been resized. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.GetPreferredHeight%2A> method to determine the new padding for a row that has been resized. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet40"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet40"::: @@ -1180,9 +1180,9 @@ <altmember cref="T:System.Windows.Forms.DataGridViewAutoSizeRowMode" /> <altmember cref="P:System.Windows.Forms.DataGridViewCellStyle.WrapMode" /> <altmember cref="M:System.Windows.Forms.DataGridViewColumn.GetPreferredWidth(System.Windows.Forms.DataGridViewAutoSizeColumnMode,System.Boolean)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="GetState"> @@ -1239,7 +1239,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewBand.Index" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.State" /> <altmember cref="M:System.Windows.Forms.DataGridViewRowCollection.IndexOf(System.Windows.Forms.DataGridViewRow)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="HeaderCell"> @@ -1347,7 +1347,7 @@ ## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.Height%2A> property to set the height of the first row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.Height%2A> property to set the height of the first row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet208"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet208"::: @@ -1358,7 +1358,7 @@ <exception cref="T:System.InvalidOperationException">When setting this property, the row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.MinimumHeight" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="InheritedStyle"> @@ -1400,7 +1400,7 @@ - <xref:System.Windows.Forms.DataGridView.DefaultCellStyle%2A?displayProperty=nameWithType> - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]></format> </remarks> @@ -1411,8 +1411,8 @@ <altmember cref="P:System.Windows.Forms.DataGridView.AlternatingRowsDefaultCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridView.RowsDefaultCellStyle" /> <altmember cref="P:System.Windows.Forms.DataGridView.DefaultCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control">Cell Styles in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsNewRow"> @@ -1475,7 +1475,7 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/using-the-row-for-new-records-in-the-windows-forms-datagridview-control">Using the Row for New Records in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/using-the-row-for-new-records-in-the-windows-forms-datagridview-control">Using the Row for New Records in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MinimumHeight"> @@ -1526,7 +1526,7 @@ ## Examples - The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.MinimumHeight%2A> property to set the minimum height of the second row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the <xref:System.Windows.Forms.DataGridViewRow.MinimumHeight%2A> property to set the minimum height of the second row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet207"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet207"::: @@ -1538,7 +1538,7 @@ <exception cref="T:System.ArgumentOutOfRangeException">The specified value when setting this property is less than 2.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.Height" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Paint"> @@ -1604,7 +1604,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.RowPostPaint" /> <altmember cref="M:System.Windows.Forms.DataGridViewRow.PaintHeader(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Int32,System.Windows.Forms.DataGridViewElementStates,System.Boolean,System.Boolean,System.Windows.Forms.DataGridViewPaintParts)" /> <altmember cref="M:System.Windows.Forms.DataGridViewRow.PaintCells(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Int32,System.Windows.Forms.DataGridViewElementStates,System.Boolean,System.Boolean,System.Windows.Forms.DataGridViewPaintParts)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="PaintCells"> @@ -1803,7 +1803,7 @@ <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.ReadOnly" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Resizable"> @@ -1863,7 +1863,7 @@ <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.AllowUserToResizeRows" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Selected"> @@ -1910,7 +1910,7 @@ </remarks> <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="SetValues"> @@ -1977,7 +1977,7 @@ <altmember cref="M:System.Windows.Forms.DataGridViewRow.CreateCells(System.Windows.Forms.DataGridView)" /> <altmember cref="M:System.Windows.Forms.DataGridViewCell.SetValue(System.Int32,System.Object)" /> <altmember cref="P:System.Windows.Forms.DataGridView.VirtualMode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="State"> @@ -2017,7 +2017,7 @@ <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewElementStates" /> <altmember cref="M:System.Windows.Forms.DataGridViewRow.GetState(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="ToString"> @@ -2110,7 +2110,7 @@ <exception cref="T:System.InvalidOperationException">The row is in a <see cref="T:System.Windows.Forms.DataGridView" /> control and is a shared row.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="M:System.Windows.Forms.DataGridViewRowCollection.Remove(System.Windows.Forms.DataGridViewRow)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml index 8c7dd8fa251..60a91cc2154 100644 --- a/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml @@ -29,22 +29,22 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.UserDeletingRow" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -86,11 +86,11 @@ <param name="dataGridViewRow">The row the user is deleting.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewRowCancelEventArgs" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor uses the `dataGridViewRow` parameter value to initialize the value of the <xref:System.Windows.Forms.DataGridViewRowCancelEventArgs.Row%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor uses the `dataGridViewRow` parameter value to initialize the value of the <xref:System.Windows.Forms.DataGridViewRowCancelEventArgs.Row%2A> property. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -135,15 +135,15 @@ <summary>Gets the row that the user is deleting.</summary> <value>The row that the user deleted.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewRowCollection.xml b/xml/System.Windows.Forms/DataGridViewRowCollection.xml index f14fdd9f392..911321e0df6 100644 --- a/xml/System.Windows.Forms/DataGridViewRowCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewRowCollection.xml @@ -193,7 +193,7 @@ <exception cref="T:System.ArgumentException">The row returned by the <see cref="P:System.Windows.Forms.DataGridView.RowTemplate" /> property has more cells than there are columns in the control.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Add"> @@ -491,7 +491,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="P:System.Windows.Forms.DataGridViewColumn.CellTemplate" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="AddCopies"> @@ -2223,7 +2223,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="OnCollectionChanged"> @@ -2452,7 +2452,7 @@ </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="System.Collections.ICollection.CopyTo"> diff --git a/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml index 05be5bedb51..14579288f06 100644 --- a/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml @@ -74,6 +74,6 @@ <altmember cref="T:System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewRowContextMenuStripNeededEventArgs.ContextMenuStrip" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml index 537bcef1d74..e1869309e5c 100644 --- a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml @@ -65,7 +65,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ErrorText" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnRowErrorTextNeeded(System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="ErrorText"> diff --git a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml index 6f55edd6b6d..ce58f124a45 100644 --- a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml @@ -66,6 +66,6 @@ <altmember cref="T:System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs" /> <altmember cref="P:System.Windows.Forms.DataGridViewRowErrorTextNeededEventArgs.ErrorText" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.ErrorText" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml b/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml index c945869a54e..9a9a907add6 100644 --- a/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml +++ b/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml @@ -22,31 +22,31 @@ <Docs> <summary>Defines values for specifying how the row header width is adjusted.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example illustrates the use of this enumeration in a display-only, non-interactive <xref:System.Windows.Forms.DataGridView> control. - + <format type="text/markdown"><. + + + +## Examples + The following code example illustrates the use of this enumeration in a display-only, non-interactive <xref:System.Windows.Forms.DataGridView> control. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.RowHeadersWidthSizeMode" /> <altmember cref="Overload:System.Windows.Forms.DataGridView.AutoResizeRowHeadersWidth" /> - <related type="Article" href="/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control">Sizing Options in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="AutoSizeToAllHeaders"> diff --git a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml index 3061a2b616c..b4425d60a76 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml @@ -29,23 +29,23 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.RowPostPaint" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -103,14 +103,14 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewRowPostPaintEventArgs" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentNullException"> - <paramref name="dataGridView" /> is <see langword="null" />. - - -or- - - <paramref name="graphics" /> is <see langword="null" />. - - -or- - + <paramref name="dataGridView" /> is <see langword="null" />. + + -or- + + <paramref name="graphics" /> is <see langword="null" />. + + -or- + <paramref name="inheritedRowStyle" /> is <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Drawing.Graphics" /> @@ -156,21 +156,21 @@ <summary>Gets or sets the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView> and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> represents the small area that was covered. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView> and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ClipBounds%2A> represents the small area that was covered. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -209,19 +209,19 @@ <see langword="true" /> to use the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" /> property to determine the color of the focus rectangle; <see langword="false" /> to use the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.BackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" /> property.</param> <summary>Draws the focus rectangle around the specified bounds.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException"> @@ -269,21 +269,21 @@ <summary>Gets a string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of the <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ErrorText%2A> property is the same as the current row's <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of the <xref:System.Windows.Forms.DataGridViewRowPostPaintEventArgs.ErrorText%2A> property is the same as the current row's <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -323,19 +323,19 @@ <summary>Gets the <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>The <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -375,21 +375,21 @@ <summary>Gets the cell style applied to the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that contains the cell style applied to the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet34"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -397,7 +397,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.DefaultCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsFirstDisplayedRow"> @@ -433,16 +433,16 @@ <value> <see langword="true" /> if the row being painted is currently the first row displayed in the <see cref="T:System.Windows.Forms.DataGridView" />; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -481,16 +481,16 @@ <value> <see langword="true" /> if the current row is the last row in the <see cref="T:System.Windows.Forms.DataGridView" /> that has the <see cref="P:System.Windows.Forms.DataGridViewRow.Visible" /> property set to <see langword="true" />; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPostPaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -718,19 +718,19 @@ <summary>Get the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -771,19 +771,19 @@ <summary>Gets the index of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>The index of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet35"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -822,19 +822,19 @@ <summary>Gets the state of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values that specifies the state of the row.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet34"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml index ccd14407b6e..69f1d8b19b4 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml @@ -39,23 +39,23 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewRowPostPaintEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.RowPostPaint" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example presents a <xref:System.Windows.Forms.DataGridViewRowPostPaintEventHandler> delegate that paints textual content that spans the entire row below the normal cell values. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following code example presents a <xref:System.Windows.Forms.DataGridViewRowPostPaintEventHandler> delegate that paints textual content that spans the entire row below the normal cell values. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.RowPostPaint" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml index 4afb1ab8383..e9d931e6e62 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml @@ -29,19 +29,19 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.RowPrePaint" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -103,14 +103,14 @@ <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewRowPrePaintEventArgs" /> class.</summary> <remarks>To be added.</remarks> <exception cref="T:System.ArgumentNullException"> - <paramref name="dataGridView" /> is <see langword="null" />. - - -or- - - <paramref name="graphics" /> is <see langword="null" />. - - -or- - + <paramref name="dataGridView" /> is <see langword="null" />. + + -or- + + <paramref name="graphics" /> is <see langword="null" />. + + -or- + <paramref name="inheritedRowStyle" /> is <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="T:System.Drawing.Graphics" /> @@ -156,21 +156,21 @@ <summary>Gets or sets the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the area of the <see cref="T:System.Windows.Forms.DataGridView" /> that needs to be repainted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView> and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> represents the small area that was covered. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> property represents the area of the <xref:System.Windows.Forms.DataGridView> that needs to be repainted. For example, if a user covers the entire <xref:System.Windows.Forms.DataGridView> with another window and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> represents the entire <xref:System.Windows.Forms.DataGridView>. If a user covers a small area of the <xref:System.Windows.Forms.DataGridView> and then uncovers it, then <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ClipBounds%2A> represents the small area that was covered. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -209,19 +209,19 @@ <see langword="true" /> to use the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" /> property to determine the color of the focus rectangle; <see langword="false" /> to use the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.BackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" />.</param> <summary>Draws the focus rectangle around the specified bounds.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException"> @@ -270,21 +270,21 @@ <summary>Gets a string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A string that represents an error message for the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ErrorText%2A> property is the same as the current row's <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.ErrorText%2A> property is the same as the current row's <xref:System.Windows.Forms.DataGridViewRow.ErrorText%2A?displayProperty=nameWithType> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -324,19 +324,19 @@ <summary>Gets the <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>The <see cref="T:System.Drawing.Graphics" /> used to paint the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -376,21 +376,21 @@ <summary>Gets the cell style applied to the row.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> that contains the cell style currently applied to the row.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -398,7 +398,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewCellStyle" /> <altmember cref="T:System.Windows.Forms.DataGridViewRow" /> <altmember cref="P:System.Windows.Forms.DataGridViewRow.DefaultCellStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="IsFirstDisplayedRow"> @@ -434,16 +434,16 @@ <value> <see langword="true" /> if the row being painted is currently the first row displayed in the <see cref="T:System.Windows.Forms.DataGridView" />; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -482,16 +482,16 @@ <value> <see langword="true" /> if the row being painted is currently the last row in the <see cref="T:System.Windows.Forms.DataGridView" /> that has the <see cref="P:System.Windows.Forms.DataGridViewRow.Visible" /> property set to <see langword="true" />; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DataGridView> named `DataGridView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DataGridView.RowPrePaint?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -565,11 +565,11 @@ <see langword="true" /> to paint the background of the specified bounds with the color of the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" />; <see langword="false" /> to paint the background of the specified bounds with the color of the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.BackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" />.</param> <summary>Paints the cell backgrounds for the area in the specified bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintCellsBackground%2A> method when you draw the <xref:System.Windows.Forms.DataGridViewRow> and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the <xref:System.ComponentModel.HandledEventArgs.Handled%2A?displayProperty=nameWithType> property to `true`. When <xref:System.ComponentModel.HandledEventArgs.Handled%2A?displayProperty=nameWithType> is `true`, the <xref:System.Windows.Forms.DataGridView.CellPainting> and <xref:System.Windows.Forms.DataGridView.RowPostPaint> events do not occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintCellsBackground%2A> method when you draw the <xref:System.Windows.Forms.DataGridViewRow> and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the <xref:System.ComponentModel.HandledEventArgs.Handled%2A?displayProperty=nameWithType> property to `true`. When <xref:System.ComponentModel.HandledEventArgs.Handled%2A?displayProperty=nameWithType> is `true`, the <xref:System.Windows.Forms.DataGridView.CellPainting> and <xref:System.Windows.Forms.DataGridView.RowPostPaint> events do not occur. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException"> @@ -654,11 +654,11 @@ <see langword="true" /> to paint the row header with the color of the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.SelectionBackColor" /> property of the <see cref="P:System.Windows.Forms.DataGridViewRow.InheritedStyle" />; <see langword="false" /> to paint the row header with the <see cref="P:System.Windows.Forms.DataGridViewCellStyle.BackColor" /> of the <see cref="P:System.Windows.Forms.DataGridView.RowHeadersDefaultCellStyle" /> property.</param> <summary>Paints the entire row header of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintHeader%2A> method when you draw the <xref:System.Windows.Forms.DataGridViewRow> and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the <xref:System.ComponentModel.HandledEventArgs.Handled%2A> property to `true`. When <xref:System.ComponentModel.HandledEventArgs.Handled%2A> is `true`, the <xref:System.Windows.Forms.DataGridView.CellPainting> and <xref:System.Windows.Forms.DataGridView.RowPostPaint> events do not occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.DataGridViewRowPrePaintEventArgs.PaintHeader%2A> method when you draw the <xref:System.Windows.Forms.DataGridViewRow> and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the <xref:System.ComponentModel.HandledEventArgs.Handled%2A> property to `true`. When <xref:System.ComponentModel.HandledEventArgs.Handled%2A> is `true`, the <xref:System.Windows.Forms.DataGridView.CellPainting> and <xref:System.Windows.Forms.DataGridView.RowPostPaint> events do not occur. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException"> @@ -735,14 +735,14 @@ <summary>The cell parts that are to be painted.</summary> <value>A bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewPaintParts" /> values specifying the parts to be painted.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The specified value when setting this property is not a valid bitwise combination of <see cref="T:System.Windows.Forms.DataGridViewPaintParts" /> values.</exception> @@ -781,19 +781,19 @@ <summary>Get the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -834,19 +834,19 @@ <summary>Gets the index of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>The index of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet35"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -885,19 +885,19 @@ <summary>Gets the state of the current <see cref="T:System.Windows.Forms.DataGridViewRow" />.</summary> <value>A bitwise combination of the <see cref="T:System.Windows.Forms.DataGridViewElementStates" /> values that specifies the state of the row.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml index 46b48c87ac7..528e9ce535e 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml @@ -39,23 +39,23 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewRowPrePaintEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.RowPrePaint" /> event of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example presents a <xref:System.Windows.Forms.DataGridViewRowPrePaintEventHandler> delegate that paints a gradient row background if the row is selected. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + <format type="text/markdown"><. + + + +## Examples + The following code example presents a <xref:System.Windows.Forms.DataGridViewRowPrePaintEventHandler> delegate that paints a gradient row background if the row is selected. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.RowPrePaint" /> - <related type="Article" href="/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid">How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml b/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml index 46cb9420368..fe1e8e65b94 100644 --- a/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml @@ -56,7 +56,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> <altmember cref="M:System.Windows.Forms.DataGridView.AreAllCellsSelected(System.Boolean)" /> <altmember cref="M:System.Windows.Forms.DataGridViewColumnCollection.GetColumnCount(System.Windows.Forms.DataGridViewElementStates)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control">Best Practices for Scaling the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName="Clear"> diff --git a/xml/System.Windows.Forms/DataGridViewSelectionMode.xml b/xml/System.Windows.Forms/DataGridViewSelectionMode.xml index a8d657ea52d..6652e662baa 100644 --- a/xml/System.Windows.Forms/DataGridViewSelectionMode.xml +++ b/xml/System.Windows.Forms/DataGridViewSelectionMode.xml @@ -22,19 +22,19 @@ <Docs> <summary>Describes how cells of a DataGridView control can be selected.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet065"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet065"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet065"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml b/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml index 257e26f0bd7..bf0ddd90d33 100644 --- a/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml @@ -29,21 +29,21 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.DataGridView.SortCompare" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -58,7 +58,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.Column" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex1" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex2" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -113,7 +113,7 @@ <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="M:System.Windows.Forms.DataGridView.OnSortCompare(System.Windows.Forms.DataGridViewSortCompareEventArgs)" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CellValue1"> @@ -149,19 +149,19 @@ <summary>Gets the value of the first cell to compare.</summary> <value>The value of the first cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -170,7 +170,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.Column" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex1" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex2" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="CellValue2"> @@ -206,19 +206,19 @@ <summary>Gets the value of the second cell to compare.</summary> <value>The value of the second cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -227,7 +227,7 @@ <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.Column" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex1" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex2" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="Column"> @@ -266,25 +266,25 @@ <summary>Gets the column being sorted.</summary> <value>The <see cref="T:System.Windows.Forms.DataGridViewColumn" /> to sort.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="T:System.Windows.Forms.DataGridViewColumn" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowIndex1"> @@ -319,26 +319,26 @@ <summary>Gets the index of the row containing the first cell to compare.</summary> <value>The index of the row containing the second cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="P:System.Windows.Forms.DataGridView.Rows" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex2" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="RowIndex2"> @@ -373,26 +373,26 @@ <summary>Gets the index of the row containing the second cell to compare.</summary> <value>The index of the row containing the second cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="P:System.Windows.Forms.DataGridView.Rows" /> <altmember cref="P:System.Windows.Forms.DataGridViewSortCompareEventArgs.RowIndex1" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="SortResult"> @@ -431,25 +431,25 @@ <summary>Gets or sets a value indicating the order in which the compared cells will be sorted.</summary> <value>Less than zero if the first cell will be sorted before the second cell; zero if the first cell and second cell have equivalent values; greater than zero if the second cell will be sorted before the first cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="Overload:System.String.Compare" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml b/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml index ee902ce3b9b..2ffcdce151f 100644 --- a/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml @@ -39,24 +39,24 @@ <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewSortCompareEventArgs" /> that contains the event data.</param> <summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.DataGridView.SortCompare" /> event of a <see cref="T:System.Windows.Forms.DataGridView" /> control.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of <xref:System.Windows.Forms.DataGridView.SortCompare> in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of <xref:System.Windows.Forms.DataGridView.SortCompare> in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="E:System.Windows.Forms.DataGridView.SortCompare" /> <altmember cref="T:System.Windows.Forms.DataGridViewSortCompareEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control">How to: Customize Sorting in the Windows Forms DataGridView Control</related> </Docs> </Type> diff --git a/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml b/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml index 57293940b84..1c5301396b2 100644 --- a/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml @@ -481,14 +481,14 @@ For additional information, see [What's New in Accessibility in the .NET Framewo ## Remarks When the <xref:System.Windows.Forms.DataGridView.EditMode%2A> property of the <xref:System.Windows.Forms.DataGridView> control is set to <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke> or <xref:System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2>, the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode. - This method returns `true` if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). + This method returns `true` if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> <altmember cref="P:System.Windows.Forms.DataGridView.EditMode" /> <altmember cref="T:System.Windows.Forms.KeyEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control">Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control</related> </Docs> </Member> <Member MemberName="MaxInputLength"> diff --git a/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml index 517c2d3dcc0..467944c11c8 100644 --- a/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml @@ -37,21 +37,21 @@ <Docs> <summary>Hosts a collection of <see cref="T:System.Windows.Forms.DataGridViewTextBoxCell" /> cells.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewTextBoxColumn> class is a specialized type of <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that enable displaying and editing of text strings. A <xref:System.Windows.Forms.DataGridViewTextBoxColumn> has an associated <xref:System.Windows.Forms.DataGridViewTextBoxCell> object in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. When a <xref:System.Windows.Forms.DataGridViewTextBoxCell> becomes activated, it supplies a <xref:System.Windows.Forms.DataGridViewTextBoxEditingControl> control to handle user input. - - The sort mode for this column type defaults to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. - - - -## Examples - The following code example illustrates the use of this type. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewTextBoxColumn> class is a specialized type of <xref:System.Windows.Forms.DataGridViewColumn> class used to logically host cells that enable displaying and editing of text strings. A <xref:System.Windows.Forms.DataGridViewTextBoxColumn> has an associated <xref:System.Windows.Forms.DataGridViewTextBoxCell> object in every <xref:System.Windows.Forms.DataGridViewRow> that intersects it. When a <xref:System.Windows.Forms.DataGridViewTextBoxCell> becomes activated, it supplies a <xref:System.Windows.Forms.DataGridViewTextBoxEditingControl> control to handle user input. + + The sort mode for this column type defaults to <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. + + + +## Examples + The following code example illustrates the use of this type. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet20"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -87,16 +87,16 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DataGridViewTextBoxColumn" /> class to the default state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor initializes the column by setting the following properties. - -|Property|Value| -|--------------|-----------| -|<xref:System.Windows.Forms.DataGridViewTextBoxColumn.CellTemplate%2A>|A newly created <xref:System.Windows.Forms.DataGridViewTextBoxCell>.| -|<xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A>|<xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>| - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor initializes the column by setting the following properties. + +|Property|Value| +|--------------|-----------| +|<xref:System.Windows.Forms.DataGridViewTextBoxColumn.CellTemplate%2A>|A newly created <xref:System.Windows.Forms.DataGridViewTextBoxCell>.| +|<xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A>|<xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>| + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -146,23 +146,23 @@ <summary>Gets or sets the template used to model cell appearance.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewCell" /> that all other cells in the column are modeled after.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The constructor for the <xref:System.Windows.Forms.DataGridViewTextBoxColumn> class initializes this property to a newly created <xref:System.Windows.Forms.DataGridViewTextBoxCell>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The constructor for the <xref:System.Windows.Forms.DataGridViewTextBoxColumn> class initializes this property to a newly created <xref:System.Windows.Forms.DataGridViewTextBoxCell>. + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). - - - -## Examples - The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the <xref:System.Windows.Forms.DataGridView.InvalidateColumn%2A?displayProperty=nameWithType> method). + + + +## Examples + The following code example demonstrates the use of the <xref:System.Windows.Forms.DataGridViewColumn.CellTemplate%2A?displayProperty=nameWithType> property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]></format> </remarks> <exception cref="T:System.InvalidCastException">The set type is not compatible with type <see cref="T:System.Windows.Forms.DataGridViewTextBoxCell" />.</exception> @@ -217,13 +217,13 @@ <summary>Gets or sets the maximum number of characters that can be entered into the text box.</summary> <value>The maximum number of characters that can be entered into the text box; the default value is 32767.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DataGridViewTextBoxColumn.MaxInputLength%2A> property does not affect the length of text entered programmatically through the cell's value or through cell formatting. It affects only what the user can input and edit. - - Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewTextBoxCell.MaxInputLength%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewTextBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewTextBoxCell.MaxInputLength%2A> property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DataGridViewTextBoxColumn.MaxInputLength%2A> property does not affect the length of text entered programmatically through the cell's value or through cell formatting. It affects only what the user can input and edit. + + Getting or setting this property gets or sets the <xref:System.Windows.Forms.DataGridViewTextBoxCell.MaxInputLength%2A> property of the object returned by the <xref:System.Windows.Forms.DataGridViewTextBoxColumn.CellTemplate%2A> property. Setting this property also sets the <xref:System.Windows.Forms.DataGridViewTextBoxCell.MaxInputLength%2A> property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The value of the <see cref="P:System.Windows.Forms.DataGridViewTextBoxColumn.CellTemplate" /> property is <see langword="null" />.</exception> @@ -265,27 +265,27 @@ <summary>Gets or sets the sort mode for the column.</summary> <value>A <see cref="T:System.Windows.Forms.DataGridViewColumnSortMode" /> that specifies the criteria used to order the rows based on the cell values in a column.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DataGridView> control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>, a sorting glyph is automatically displayed in the column header. - - When the control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic>, you must display the sorting glyph yourself through the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property. - - The default sort mode of a <xref:System.Windows.Forms.DataGridViewTextBoxColumn> is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. The default sort mode for other column types is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. - - The <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the <xref:System.Windows.Forms.DataGridView.Sort%2A> method. - - A <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable> will not prevent the <xref:System.Windows.Forms.DataGridView.ColumnHeaderMouseClick?displayProperty=nameWithType> event from occurring, but it will prevent the header from changing its appearance when it is clicked. - - - -## Examples - The following code example illustrates the use of this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DataGridView> control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>, a sorting glyph is automatically displayed in the column header. + + When the control is sorted using a column with a <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.Programmatic>, you must display the sorting glyph yourself through the <xref:System.Windows.Forms.DataGridViewColumnHeaderCell.SortGlyphDirection%2A> property. + + The default sort mode of a <xref:System.Windows.Forms.DataGridViewTextBoxColumn> is <xref:System.Windows.Forms.DataGridViewColumnSortMode.Automatic>. The default sort mode for other column types is <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable>. + + The <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the <xref:System.Windows.Forms.DataGridView.Sort%2A> method. + + A <xref:System.Windows.Forms.DataGridViewTextBoxColumn.SortMode%2A> property value of <xref:System.Windows.Forms.DataGridViewColumnSortMode.NotSortable> will not prevent the <xref:System.Windows.Forms.DataGridView.ColumnHeaderMouseClick?displayProperty=nameWithType> event from occurring, but it will prevent the header from changing its appearance when it is clicked. + + + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/DateTimePicker.xml b/xml/System.Windows.Forms/DateTimePicker.xml index f2b685455e9..52f6d3f0b5c 100644 --- a/xml/System.Windows.Forms/DateTimePicker.xml +++ b/xml/System.Windows.Forms/DateTimePicker.xml @@ -62,46 +62,46 @@ <Docs> <summary>Represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DateTimePicker> control is used to allow the user to select a date and time, and to display that date and time in the specified format. The <xref:System.Windows.Forms.DateTimePicker> control makes it easy to work with dates and times because it handles a lot of the data validation automatically. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DateTimePicker> control is used to allow the user to select a date and time, and to display that date and time in the specified format. The <xref:System.Windows.Forms.DateTimePicker> control makes it easy to work with dates and times because it handles a lot of the data validation automatically. + > [!NOTE] -> The <xref:System.Windows.Forms.DateTimePicker> control only supports Gregorian calendars. - - When used to represent a date, the <xref:System.Windows.Forms.DateTimePicker> control appears in two parts: a drop-down list with a date represented in text, and a calendar that appears when you click the down-arrow next to the list. The calendar looks like the <xref:System.Windows.Forms.MonthCalendar> control, which can be used for selecting multiple dates. For more information about the <xref:System.Windows.Forms.MonthCalendar> control, see [MonthCalendar Control Overview](/dotnet/framework/winforms/controls/monthcalendar-control-overview-windows-forms). - - You can change the look of the calendar portion of the control by setting the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTitleBackColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTitleForeColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTrailingForeColor%2A>, and <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> properties. - - To use a spin button control (also known as an up-down control) to adjust the date/time value, set the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. The calendar will not drop down when the control is selected. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. - - The <xref:System.Windows.Forms.DateTimePicker.Value%2A> property contains the current date and time the control is set to. You can use the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property or the appropriate member of <xref:System.Windows.Forms.DateTimePicker.Value%2A> to get the date and time value. For more information, see [How to: Set and Return Dates with the Windows Forms DateTimePicker Control](/dotnet/framework/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control). You can limit the dates and times that can be selected by setting the <xref:System.Windows.Forms.DateTimePicker.MinDate%2A> and <xref:System.Windows.Forms.DateTimePicker.MaxDate%2A> properties. - - The values can be displayed in four formats, which are set by the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property: <xref:System.Windows.Forms.DateTimePickerFormat.Long>, <xref:System.Windows.Forms.DateTimePickerFormat.Short>, <xref:System.Windows.Forms.DateTimePickerFormat.Time>, or <xref:System.Windows.Forms.DateTimePickerFormat.Custom>. The default date <xref:System.Windows.Forms.DateTimePicker.Format%2A> is <xref:System.Windows.Forms.DateTimePickerFormat.Long?displayProperty=nameWithType>. - - If you want the <xref:System.Windows.Forms.DateTimePicker> to appear as a control for picking or editing times instead of dates, set the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true` and the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property to <xref:System.Windows.Forms.DateTimePickerFormat.Time>. For more information, see [How to: Display Time with the DateTimePicker Control](/dotnet/framework/winforms/controls/how-to-display-time-with-the-datetimepicker-control). - - If the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property is set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType>, you can create your own format style by setting the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property and building a custom format string. The custom format string can be a combination of custom field characters and other literal characters. For example, you can display the date as "June 01, 2012 - Friday" by setting the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property to "MMMM dd, yyyy - dddd". For more information, see [How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control](/dotnet/framework/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). - +> The <xref:System.Windows.Forms.DateTimePicker> control only supports Gregorian calendars. + + When used to represent a date, the <xref:System.Windows.Forms.DateTimePicker> control appears in two parts: a drop-down list with a date represented in text, and a calendar that appears when you click the down-arrow next to the list. The calendar looks like the <xref:System.Windows.Forms.MonthCalendar> control, which can be used for selecting multiple dates. For more information about the <xref:System.Windows.Forms.MonthCalendar> control, see [MonthCalendar Control Overview](/dotnet/desktop/winforms/controls/monthcalendar-control-overview-windows-forms). + + You can change the look of the calendar portion of the control by setting the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTitleBackColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTitleForeColor%2A>, <xref:System.Windows.Forms.DateTimePicker.CalendarTrailingForeColor%2A>, and <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> properties. + + To use a spin button control (also known as an up-down control) to adjust the date/time value, set the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. The calendar will not drop down when the control is selected. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. + + The <xref:System.Windows.Forms.DateTimePicker.Value%2A> property contains the current date and time the control is set to. You can use the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property or the appropriate member of <xref:System.Windows.Forms.DateTimePicker.Value%2A> to get the date and time value. For more information, see [How to: Set and Return Dates with the Windows Forms DateTimePicker Control](/dotnet/desktop/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control). You can limit the dates and times that can be selected by setting the <xref:System.Windows.Forms.DateTimePicker.MinDate%2A> and <xref:System.Windows.Forms.DateTimePicker.MaxDate%2A> properties. + + The values can be displayed in four formats, which are set by the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property: <xref:System.Windows.Forms.DateTimePickerFormat.Long>, <xref:System.Windows.Forms.DateTimePickerFormat.Short>, <xref:System.Windows.Forms.DateTimePickerFormat.Time>, or <xref:System.Windows.Forms.DateTimePickerFormat.Custom>. The default date <xref:System.Windows.Forms.DateTimePicker.Format%2A> is <xref:System.Windows.Forms.DateTimePickerFormat.Long?displayProperty=nameWithType>. + + If you want the <xref:System.Windows.Forms.DateTimePicker> to appear as a control for picking or editing times instead of dates, set the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true` and the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property to <xref:System.Windows.Forms.DateTimePickerFormat.Time>. For more information, see [How to: Display Time with the DateTimePicker Control](/dotnet/desktop/winforms/controls/how-to-display-time-with-the-datetimepicker-control). + + If the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property is set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType>, you can create your own format style by setting the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property and building a custom format string. The custom format string can be a combination of custom field characters and other literal characters. For example, you can display the date as "June 01, 2012 - Friday" by setting the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property to "MMMM dd, yyyy - dddd". For more information, see [How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control](/dotnet/desktop/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). + > [!CAUTION] -> When a <xref:System.Windows.Forms.DateTimePicker> is data-bound and the backing value is changed to `null`, the value of the <xref:System.Windows.Forms.DateTimePicker> will not be updated and the previous value will be retained. In situations where this behavior is not desirable (for example, when using a set of data-bound controls to page through a recordset) use the <xref:System.Windows.Forms.Binding.Format> event of the <xref:System.Windows.Forms.Binding> class to set the <xref:System.Windows.Forms.DateTimePicker> to a value recognizable as a `null`. - - - -## Examples - The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control. To run this example, paste the following code into a form and call the `CreateMyDateTimePicker` method in the example form's constructor or <xref:System.Windows.Forms.Form.Load> event handling method. - +> When a <xref:System.Windows.Forms.DateTimePicker> is data-bound and the backing value is changed to `null`, the value of the <xref:System.Windows.Forms.DateTimePicker> will not be updated and the previous value will be retained. In situations where this behavior is not desirable (for example, when using a set of data-bound controls to page through a recordset) use the <xref:System.Windows.Forms.Binding.Format> event of the <xref:System.Windows.Forms.Binding> class to set the <xref:System.Windows.Forms.DateTimePicker> to a value recognizable as a `null`. + + + +## Examples + The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control. To run this example, paste the following code into a form and call the `CreateMyDateTimePicker` method in the example form's constructor or <xref:System.Windows.Forms.Form.Load> event handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MonthCalendar" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control">How to: Set and Return Dates with the Windows Forms DateTimePicker Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-display-time-with-the-datetimepicker-control">How to: Display Time with the DateTimePicker Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control">How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control">How to: Set and Return Dates with the Windows Forms DateTimePicker Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-display-time-with-the-datetimepicker-control">How to: Display Time with the DateTimePicker Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control">How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control</related> <related type="Article" href="/dotnet/standard/base-types/custom-date-and-time-format-strings">Custom Date and Time Format Strings</related> </Docs> <Members> @@ -128,15 +128,15 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.DateTimePicker" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -178,11 +178,11 @@ <summary>Gets or sets a value indicating the background color of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The background <see cref="T:System.Drawing.Color" /> of the <see cref="T:System.Windows.Forms.DateTimePicker" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DateTimePicker.BackColor%2A> has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker>. To set the background color for the drop-down calendar of the <xref:System.Windows.Forms.DateTimePicker>, see the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DateTimePicker.BackColor%2A> has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker>. To set the background color for the drop-down calendar of the <xref:System.Windows.Forms.DateTimePicker>, see the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DateTimePicker.CalendarMonthBackground" /> @@ -267,11 +267,11 @@ <summary>Gets or sets the background image for the control.</summary> <value>The background image for the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property/method/event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property/method/event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -351,11 +351,11 @@ <summary>Gets or sets the layout of the background image of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.ProgressBar.BackgroundImageLayout%2A> property has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.ProgressBar.BackgroundImageLayout%2A> property has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker> control. + ]]></format> </remarks> </Docs> @@ -439,20 +439,20 @@ <summary>Gets or sets the font style applied to the calendar.</summary> <value>A <see cref="T:System.Drawing.Font" /> that represents the font style applied to the calendar.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - - - -## Examples - The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A> property. This example creates a new <xref:System.Windows.Forms.DateTimePicker> control, adds it to the <xref:System.Windows.Forms.Control.Controls%2A> collection of a <xref:System.Windows.Forms.Form>, and then initializes the <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A> property to a dynamically defined <xref:System.Drawing.Font>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + + + +## Examples + The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A> property. This example creates a new <xref:System.Windows.Forms.DateTimePicker> control, adds it to the <xref:System.Windows.Forms.Control.Controls%2A> collection of a <xref:System.Windows.Forms.Form>, and then initializes the <xref:System.Windows.Forms.DateTimePicker.CalendarFont%2A> property to a dynamically defined <xref:System.Drawing.Font>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarFont/CPP/calendarfont.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarFont/calendarfont.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarFont/VB/calendarfont.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarFont/VB/calendarfont.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -490,22 +490,22 @@ <summary>Gets or sets the foreground color of the calendar.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the calendar.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.Control.ForeColor%2A> property value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - - - -## Examples - The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property. This example creates a new <xref:System.Windows.Forms.DateTimePicker>, adds it to the <xref:System.Windows.Forms.Control.Controls%2A> collection, and then initializes its <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property to the <xref:System.Drawing.Color.Aqua%2A> constant. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.Control.ForeColor%2A> property value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + + + +## Examples + The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property. This example creates a new <xref:System.Windows.Forms.DateTimePicker>, adds it to the <xref:System.Windows.Forms.Control.Controls%2A> collection, and then initializes its <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property to the <xref:System.Drawing.Color.Aqua%2A> constant. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/CPP/calendarforecolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarForeColor/calendarforecolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/VB/calendarforecolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/VB/calendarforecolor.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value assigned is <see langword="null" />.</exception> @@ -545,22 +545,22 @@ <summary>Gets or sets the background color of the calendar month.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of the calendar month.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultMonthBackColor> field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - - - -## Examples - The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property. After creating a <xref:System.Windows.Forms.DateTimePicker> and adding it to a <xref:System.Windows.Forms.Form>, the example initializes the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property to a <xref:System.Drawing.Color> constant. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultMonthBackColor> field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + + + +## Examples + The following code example demonstrates how to initialize the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property. After creating a <xref:System.Windows.Forms.DateTimePicker> and adding it to a <xref:System.Windows.Forms.Form>, the example initializes the <xref:System.Windows.Forms.DateTimePicker.CalendarMonthBackground%2A> property to a <xref:System.Drawing.Color> constant. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/CPP/calendarmonthbackground.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarMonthBackground/calendarmonthbackground.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/VB/calendarmonthbackground.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/VB/calendarmonthbackground.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value assigned is <see langword="null" />.</exception> @@ -600,13 +600,13 @@ <summary>Gets or sets the background color of the calendar title.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of the calendar title.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTitleBackColor> field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTitleBackColor> field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value assigned is <see langword="null" />.</exception> @@ -646,13 +646,13 @@ <summary>Gets or sets the foreground color of the calendar title.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the calendar title.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTitleForeColor> field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTitleForeColor> field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value assigned is <see langword="null" />.</exception> @@ -692,15 +692,15 @@ <summary>Gets or sets the foreground color of the calendar trailing dates.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the calendar trailing dates.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTrailingForeColor> field value. - - The trailing dates are the ending dates from the previous month or the beginning dates from the next month used to fill the calendar. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a <xref:System.Windows.Forms.DateTimePicker> is created, this property is initially set equal to the <xref:System.Windows.Forms.DateTimePicker.DefaultTrailingForeColor> field value. + + The trailing dates are the ending dates from the previous month or the beginning dates from the next month used to fill the calendar. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The value assigned is <see langword="null" />.</exception> @@ -745,11 +745,11 @@ <value> <see langword="true" /> if the <see cref="P:System.Windows.Forms.DateTimePicker.Value" /> property has been set with a valid <see cref="T:System.DateTime" /> value and the displayed value is able to be updated; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is used to obtain the state of the check box that is displayed if the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property value is `true`. If the <xref:System.Windows.Forms.DateTimePicker.Checked%2A> property value is `true`, the <xref:System.Windows.Forms.DateTimePicker> control displays the properly formatted <xref:System.Windows.Forms.DateTimePicker.Value%2A> property value; otherwise, the control displays the last valid date/time value assigned to the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property or the current date and time (<xref:System.DateTime.Now%2A?displayProperty=nameWithType>) if no value has ever been assigned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is used to obtain the state of the check box that is displayed if the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property value is `true`. If the <xref:System.Windows.Forms.DateTimePicker.Checked%2A> property value is `true`, the <xref:System.Windows.Forms.DateTimePicker> control displays the properly formatted <xref:System.Windows.Forms.DateTimePicker.Value%2A> property value; otherwise, the control displays the last valid date/time value assigned to the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property or the current date and time (<xref:System.DateTime.Now%2A?displayProperty=nameWithType>) if no value has ever been assigned. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DateTimePicker.Value" /> @@ -792,11 +792,11 @@ <Docs> <summary>Occurs when the control is clicked.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -828,21 +828,21 @@ <Docs> <summary>Occurs when the drop-down calendar is dismissed and disappears.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.CloseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.CloseUp> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.CloseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.CloseUp> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet376"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet376"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet376"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DateTimePicker.OnCloseUp(System.EventArgs)" /> @@ -876,14 +876,14 @@ <summary>Creates a new accessibility object for the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <returns>A new <see cref="T:System.Windows.Forms.DateTimePicker.DateTimePickerAccessibleObject" /> for the control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.DateTimePicker.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.DateTimePicker.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1007,51 +1007,51 @@ <summary>Gets or sets the custom date/time format string.</summary> <value>A string that represents the custom date/time format. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + > [!NOTE] -> The <xref:System.Windows.Forms.DateTimePicker.Format%2A> property must be set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType> for this property to affect the formatting of the displayed date and time. - - The following table lists all the valid format strings and their descriptions. - -|Format string|Description| -|-------------------|-----------------| -|d|The one- or two-digit day.| -|dd|The two-digit day. Single-digit day values are preceded by a 0.| -|ddd|The three-character day-of-week abbreviation.| -|dddd|The full day-of-week name.| -|h|The one- or two-digit hour in 12-hour format.| -|hh|The two-digit hour in 12-hour format. Single digit values are preceded by a 0.| -|H|The one- or two-digit hour in 24-hour format.| -|HH|The two-digit hour in 24-hour format. Single digit values are preceded by a 0.| -|m|The one- or two-digit minute.| -|mm|The two-digit minute. Single digit values are preceded by a 0.| -|M|The one- or two-digit month number.| -|MM|The two-digit month number. Single digit values are preceded by a 0.| -|MMM|The three-character month abbreviation.| -|MMMM|The full month name.| -|s|The one- or two-digit seconds.| -|ss|The two-digit seconds. Single digit values are preceded by a 0.| -|t|The one-letter A.M./P.M. abbreviation (A.M. is displayed as "A").| -|tt|The two-letter A.M./P.M. abbreviation (A.M. is displayed as "AM").| -|y|The one-digit year (2001 is displayed as "1").| -|yy|The last two digits of the year (2001 is displayed as "01").| -|yyyy|The full year (2001 is displayed as "2001").| - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property so that the <xref:System.Windows.Forms.DateTimePicker> will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a <xref:System.Windows.Forms.DateTimePicker> control has been created on a <xref:System.Windows.Forms.Form>. - +> The <xref:System.Windows.Forms.DateTimePicker.Format%2A> property must be set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType> for this property to affect the formatting of the displayed date and time. + + The following table lists all the valid format strings and their descriptions. + +|Format string|Description| +|-------------------|-----------------| +|d|The one- or two-digit day.| +|dd|The two-digit day. Single-digit day values are preceded by a 0.| +|ddd|The three-character day-of-week abbreviation.| +|dddd|The full day-of-week name.| +|h|The one- or two-digit hour in 12-hour format.| +|hh|The two-digit hour in 12-hour format. Single digit values are preceded by a 0.| +|H|The one- or two-digit hour in 24-hour format.| +|HH|The two-digit hour in 24-hour format. Single digit values are preceded by a 0.| +|m|The one- or two-digit minute.| +|mm|The two-digit minute. Single digit values are preceded by a 0.| +|M|The one- or two-digit month number.| +|MM|The two-digit month number. Single digit values are preceded by a 0.| +|MMM|The three-character month abbreviation.| +|MMMM|The full month name.| +|s|The one- or two-digit seconds.| +|ss|The two-digit seconds. Single digit values are preceded by a 0.| +|t|The one-letter A.M./P.M. abbreviation (A.M. is displayed as "A").| +|tt|The two-letter A.M./P.M. abbreviation (A.M. is displayed as "AM").| +|y|The one-digit year (2001 is displayed as "1").| +|yy|The last two digits of the year (2001 is displayed as "01").| +|yyyy|The full year (2001 is displayed as "2001").| + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property so that the <xref:System.Windows.Forms.DateTimePicker> will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a <xref:System.Windows.Forms.DateTimePicker> control has been created on a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CustomFormat/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DateTimePickerFormat" /> @@ -1288,11 +1288,11 @@ <value> <see langword="true" /> if the control should redraw its surface using a secondary buffer; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DateTimePicker.DoubleBuffered%2A> property has no effect on the <xref:System.Windows.Forms.DateTimePicker> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DateTimePicker.DoubleBuffered%2A> property has no effect on the <xref:System.Windows.Forms.DateTimePicker> control. + ]]></format> </remarks> </Docs> @@ -1333,11 +1333,11 @@ <Docs> <summary>Occurs when the control is double-clicked.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1369,20 +1369,20 @@ <Docs> <summary>Occurs when the drop-down calendar is shown.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates handling the <xref:System.Windows.Forms.DateTimePicker.DropDown> event of a <xref:System.Windows.Forms.DateTimePicker> and using the <xref:System.Windows.Forms.DateTimePicker.MinDateTime> and <xref:System.Windows.Forms.DateTimePicker.MaxDateTime> fields. To run this example paste the following code in a form that contains a <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates handling the <xref:System.Windows.Forms.DateTimePicker.DropDown> event of a <xref:System.Windows.Forms.DateTimePicker> and using the <xref:System.Windows.Forms.DateTimePicker.MinDateTime> and <xref:System.Windows.Forms.DateTimePicker.MaxDateTime> fields. To run this example paste the following code in a form that contains a <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DateTimePicker.OnDropDown(System.EventArgs)" /> @@ -1425,20 +1425,20 @@ <summary>Gets or sets the alignment of the drop-down calendar on the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The alignment of the drop-down calendar on the control. The default is <see cref="F:System.Windows.Forms.LeftRightAlignment.Left" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The drop-down calendar can be aligned to the left or right of the control. - - - -## Examples - The following code example demonstrates initializing a <xref:System.Windows.Forms.DateTimePicker> by setting the <xref:System.Windows.Forms.DateTimePicker.DropDownAlign%2A>, <xref:System.Windows.Forms.DateTimePicker.Value%2A>, <xref:System.Windows.Forms.DateTimePicker.Format%2A>, and <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> properties. To run this example, paste the following code into a form and call `InitializeDateTimePicker` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The drop-down calendar can be aligned to the left or right of the control. + + + +## Examples + The following code example demonstrates initializing a <xref:System.Windows.Forms.DateTimePicker> by setting the <xref:System.Windows.Forms.DateTimePicker.DropDownAlign%2A>, <xref:System.Windows.Forms.DateTimePicker.Value%2A>, <xref:System.Windows.Forms.DateTimePicker.Format%2A>, and <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> properties. To run this example, paste the following code into a form and call `InitializeDateTimePicker` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.LeftRightAlignment" /> values.</exception> @@ -1482,13 +1482,13 @@ <summary>Gets or sets the foreground color of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The foreground <see cref="T:System.Drawing.Color" /> of the <see cref="T:System.Windows.Forms.DateTimePicker" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DateTimePicker.ForeColor%2A> property has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker> control. - - To set the foreground color for the drop-down calendar of the <xref:System.Windows.Forms.DateTimePicker>, see the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DateTimePicker.ForeColor%2A> property has no effect on the appearance of the <xref:System.Windows.Forms.DateTimePicker> control. + + To set the foreground color for the drop-down calendar of the <xref:System.Windows.Forms.DateTimePicker>, see the <xref:System.Windows.Forms.DateTimePicker.CalendarForeColor%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DateTimePicker.CalendarMonthBackground" /> @@ -1533,13 +1533,13 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DateTimePicker.ForeColor" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> @@ -1585,25 +1585,25 @@ <summary>Gets or sets the format of the date and time displayed in the control.</summary> <value>One of the <see cref="T:System.Windows.Forms.DateTimePickerFormat" /> values. The default is <see cref="F:System.Windows.Forms.DateTimePickerFormat.Long" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property determines the date/time format the date is displayed in. The date/time format is based on the user's regional settings in their operating system. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property determines the date/time format the date is displayed in. The date/time format is based on the user's regional settings in their operating system. + > [!NOTE] -> The <xref:System.Windows.Forms.DateTimePicker.Format%2A> property must be set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType> for the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property to affect the formatting of the displayed date and time. - - To display only time in a <xref:System.Windows.Forms.DateTimePicker>, set the <xref:System.Windows.Forms.DateTimePicker.Format%2A> to <xref:System.Windows.Forms.DateTimePickerFormat.Time>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property so that the <xref:System.Windows.Forms.DateTimePicker> will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a <xref:System.Windows.Forms.DateTimePicker> control has been created on a <xref:System.Windows.Forms.Form>. - +> The <xref:System.Windows.Forms.DateTimePicker.Format%2A> property must be set to <xref:System.Windows.Forms.DateTimePickerFormat.Custom?displayProperty=nameWithType> for the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property to affect the formatting of the displayed date and time. + + To display only time in a <xref:System.Windows.Forms.DateTimePicker>, set the <xref:System.Windows.Forms.DateTimePicker.Format%2A> to <xref:System.Windows.Forms.DateTimePickerFormat.Time>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property so that the <xref:System.Windows.Forms.DateTimePicker> will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a <xref:System.Windows.Forms.DateTimePicker> control has been created on a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CustomFormat/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.DateTimePickerFormat" /> values.</exception> @@ -1637,21 +1637,21 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DateTimePicker.Format" /> property value has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.FormatChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.FormatChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.FormatChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.FormatChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet374"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet374"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet374"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DateTimePicker.Format" /> @@ -1689,11 +1689,11 @@ <returns> <see langword="true" /> if the specified key is a regular input key; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Call this method during window-message preprocessing to determine whether the specified key is a regular input key that should be sent directly to the control or a special key (such as PAGE UP and PAGE DOWN) that should preprocessed. In the latter case, send the key to the control only if it is not consumed by the preprocessing phase. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Call this method during window-message preprocessing to determine whether the specified key is a regular input key that should be sent directly to the control or a special key (such as PAGE UP and PAGE DOWN) that should preprocessed. In the latter case, send the key to the control only if it is not consumed by the preprocessing phase. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Keys" /> @@ -1726,15 +1726,15 @@ <summary>Gets or sets the maximum date and time that can be selected in the control.</summary> <value>The maximum date and time that can be selected in the control. The default is the earlier of `December 31st 9998 12 am` and the <see cref="P:System.Globalization.Calendar.MaxSupportedDateTime" /> property of the current culture's `Calendar`.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -1784,19 +1784,19 @@ The value assigned is greater than the <see cref="F:System.Windows.Forms.DateTim <Docs> <summary>Specifies the maximum date value of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control. This field is read-only.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks The maximum date is set to 12/31/9998 23:59:59. -## Examples - The following code example demonstrates handling the <xref:System.Windows.Forms.DateTimePicker.DropDown> event of a <xref:System.Windows.Forms.DateTimePicker> and using the <xref:System.Windows.Forms.DateTimePicker.MinDateTime> and <xref:System.Windows.Forms.DateTimePicker.MaxDateTime> fields. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. - +## Examples + The following code example demonstrates handling the <xref:System.Windows.Forms.DateTimePicker.DropDown> event of a <xref:System.Windows.Forms.DateTimePicker> and using the <xref:System.Windows.Forms.DateTimePicker.MinDateTime> and <xref:System.Windows.Forms.DateTimePicker.MaxDateTime> fields. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.DateTimePicker.MaxDate" /> @@ -1830,12 +1830,12 @@ The maximum date is set to 12/31/9998 23:59:59. <summary>Gets the maximum date value allowed for the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The maximum date value for the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - + <format type="text/markdown"><![CDATA[ + ## Remarks The maximum date is set to December 31, 9998. - + ]]></format> </remarks> </Docs> @@ -1867,22 +1867,22 @@ The maximum date is set to December 31, 9998. <summary>Gets or sets the minimum date and time that can be selected in the control.</summary> <value>The minimum date and time that can be selected in the control. The default is `1/1/1753 00:00:00`.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> The value assigned is greater than the <see cref="P:System.Windows.Forms.DateTimePicker.MaxDate" /> value. -or- - + The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePicker.MinDateTime" /> value. </exception> <altmember cref="F:System.Windows.Forms.DateTimePicker.MinDateTime" /> @@ -1925,11 +1925,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Gets the minimum date value of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The minimum date is set to 1/1/1753 00:00:00. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The minimum date is set to 1/1/1753 00:00:00. + ]]></format> </remarks> </Docs> @@ -1960,11 +1960,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <summary>Gets the minimum date value allowed for the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The minimum date value for the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The minimum date is set to January 1, 1753. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The minimum date is set to January 1, 1753. + ]]></format> </remarks> </Docs> @@ -2005,11 +2005,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Occurs when the control is clicked with the mouse.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -2050,11 +2050,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Occurs when the control is double-clicked with the mouse.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -2089,15 +2089,15 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="eventargs">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DateTimePicker.CloseUp" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnCloseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnCloseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2136,15 +2136,15 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="eventargs">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DateTimePicker.DropDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnDropDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnDropDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2211,13 +2211,13 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2255,15 +2255,15 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DateTimePicker.FormatChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnFormatChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnFormatChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2329,13 +2329,13 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.HandleCreated" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnHandleCreated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnHandleCreated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2372,13 +2372,13 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.HandleDestroyed" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnHandleDestroyed%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnHandleDestroyed%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2421,13 +2421,13 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="P:System.Windows.Forms.DateTimePicker.RightToLeftLayout" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnRightToLeftLayoutChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnRightToLeftLayoutChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2497,15 +2497,15 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <param name="eventargs">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.DateTimePicker.ValueChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.DateTimePicker.OnValueChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.DateTimePicker.OnValueChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2559,11 +2559,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <value> <see cref="F:System.Windows.Forms.Padding.Empty" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.DateTimePicker.Padding%2A> property has no effect on the <xref:System.Windows.Forms.DateTimePicker> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.DateTimePicker.Padding%2A> property has no effect on the <xref:System.Windows.Forms.DateTimePicker> control. + ]]></format> </remarks> </Docs> @@ -2604,11 +2604,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.DateTimePicker.Padding" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -2693,11 +2693,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <summary>Gets the preferred height of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</summary> <value>The preferred height, in pixels, of the <see cref="T:System.Windows.Forms.DateTimePicker" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The preferred height is the minimum height needed to accommodate the displayed text with the assigned <xref:System.Drawing.Font> applied. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The preferred height is the minimum height needed to accommodate the displayed text with the assigned <xref:System.Drawing.Font> applied. + ]]></format> </remarks> </Docs> @@ -2743,11 +2743,11 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <value> <see langword="true" /> if the layout of the <see cref="T:System.Windows.Forms.DateTimePicker" /> contents is from right to left; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayout%2A> property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayout%2A> property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. + ]]></format> </remarks> </Docs> @@ -2778,21 +2778,21 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DateTimePicker.RightToLeftLayout" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayoutChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayoutChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayoutChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.RightToLeftLayoutChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet377"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet377"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet377"::: + ]]></format> </remarks> </Docs> @@ -2867,20 +2867,20 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <value> <see langword="true" /> if a check box is displayed to the left of the selected date; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set to `true`, a check box is displayed to the left of the date in the control. When the check box is selected, the date/time value can be updated. When the check box is cleared, the date/time value is unable to be changed. - - - -## Examples - The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set to `true`, a check box is displayed to the left of the date in the control. When the check box is selected, the date/time value can be updated. When the check box is cleared, the date/time value is unable to be changed. + + + +## Examples + The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2919,22 +2919,22 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <value> <see langword="true" /> if a spin button control is used to adjust the date/time value; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set to `true`, a spin button control (also known as an up-down control), rather than a drop-down calendar, is used to adjust time values. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. - - To display only time in a <xref:System.Windows.Forms.DateTimePicker>, set the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property to <xref:System.Windows.Forms.DateTimePickerFormat.Time>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. - - - -## Examples - The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set to `true`, a spin button control (also known as an up-down control), rather than a drop-down calendar, is used to adjust time values. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. + + To display only time in a <xref:System.Windows.Forms.DateTimePicker>, set the <xref:System.Windows.Forms.DateTimePicker.Format%2A> property to <xref:System.Windows.Forms.DateTimePickerFormat.Time>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property to `true`. + + + +## Examples + The following code example creates an new instance of a <xref:System.Windows.Forms.DateTimePicker> control and initializes it. The control's <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set. Also, the <xref:System.Windows.Forms.DateTimePicker.ShowCheckBox%2A> property is set so that the control displays a <xref:System.Windows.Forms.CheckBox>, and the <xref:System.Windows.Forms.DateTimePicker.ShowUpDown%2A> property is set so that the control is displayed as a spin button control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.UpDownBase" /> @@ -2989,13 +2989,13 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <summary>Gets or sets the text associated with this control.</summary> <value>A string that represents the text associated with this control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The string returned by this property is equivalent to the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property with the appropriate formatting or custom formatting applied. For example, if the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property is set to 06/01/2001 12:00:00 AM while the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set to "dddd, MMMM dd, yyyy", the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property value is "Friday, June 01, 2001". - - When setting this property, the string must be convertible to an instance of the <xref:System.DateTime> class. It is possible to define a custom format that results in a string that cannot be converted to a valid <xref:System.DateTime> value. Because of this, the string returned from the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property might cause an error if it is passed back to the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property. If the string cannot be converted to a date/time value, the <xref:System.DateTime> class throws a <xref:System.FormatException>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The string returned by this property is equivalent to the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property with the appropriate formatting or custom formatting applied. For example, if the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property is set to 06/01/2001 12:00:00 AM while the <xref:System.Windows.Forms.DateTimePicker.CustomFormat%2A> property is set to "dddd, MMMM dd, yyyy", the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property value is "Friday, June 01, 2001". + + When setting this property, the string must be convertible to an instance of the <xref:System.DateTime> class. It is possible to define a custom format that results in a string that cannot be converted to a valid <xref:System.DateTime> value. Because of this, the string returned from the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property might cause an error if it is passed back to the <xref:System.Windows.Forms.DateTimePicker.Text%2A> property. If the string cannot be converted to a date/time value, the <xref:System.DateTime> class throws a <xref:System.FormatException>. + ]]></format> </remarks> <altmember cref="T:System.DateTime" /> @@ -3112,20 +3112,20 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <summary>Gets or sets the date/time value assigned to the control.</summary> <value>The <see cref="T:System.DateTime" /> value assign to the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property has not been changed in code or by the user, it is set to the current date and time (<xref:System.DateTime.Now%2A?displayProperty=nameWithType>). - - - -## Examples - The following code example demonstrates how use the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property to retrieve the current date value. First, the example displays the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property. The example then increments the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property by one day and displays the property value again. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property has not been changed in code or by the user, it is set to the current date and time (<xref:System.DateTime.Now%2A?displayProperty=nameWithType>). + + + +## Examples + The following code example demonstrates how use the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property to retrieve the current date value. First, the example displays the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property. The example then increments the <xref:System.Windows.Forms.DateTimePicker.Value%2A> property by one day and displays the property value again. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.Value/CPP/value.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Value/value.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.Value/VB/value.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.Value/VB/value.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The set value is less than <see cref="P:System.Windows.Forms.DateTimePicker.MinDate" /> or more than <see cref="P:System.Windows.Forms.DateTimePicker.MaxDate" />.</exception> @@ -3159,23 +3159,23 @@ The value assigned is less than the <see cref="F:System.Windows.Forms.DateTimePi <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.DateTimePicker.Value" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.ValueChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.ValueChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.DateTimePicker.ValueChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.DateTimePicker> named `DateTimePicker1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.DateTimePicker.ValueChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet378"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet378"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet378"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.DateTimePicker.OnValueChanged(System.EventArgs)" /> diff --git a/xml/System.Windows.Forms/DragDropEffects.xml b/xml/System.Windows.Forms/DragDropEffects.xml index af730de7de0..a67cdb7c330 100644 --- a/xml/System.Windows.Forms/DragDropEffects.xml +++ b/xml/System.Windows.Forms/DragDropEffects.xml @@ -29,33 +29,33 @@ <Docs> <summary>Specifies the possible effects of a drag-and-drop operation.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This enumeration is used by the <xref:System.Windows.Forms.DragEventArgs>, <xref:System.Windows.Forms.GiveFeedbackEventArgs>, and <xref:System.Windows.Forms.Control> classes. - - You can use `DragDropEffects` to display different mouse pointers for drag-and-drop operations. For example, you can display a plus symbol for a `Copy` drag-and-drop operation, an arrow symbol for a `Move` drag-and-drop operation, or a red circle with a line through it symbol for a `None` drag-and-drop operation. - - If you want to drop data at a position in the target that is not currently visible, you could scroll the target while dragging. If a target does not support scrolling, you must make sure that the drop position is visible in the target before you begin the drag-and-drop operation. The following are some scenarios when you might want to scroll a target: - -- You're dragging text into a document, and you want to drop the text at a position not visible in the document window. + <format type="text/markdown"><![CDATA[ -- You're dragging a file into a file tree, and you want to drop the file on a node not visible in the file tree. - - - -## Examples +## Remarks + This enumeration is used by the <xref:System.Windows.Forms.DragEventArgs>, <xref:System.Windows.Forms.GiveFeedbackEventArgs>, and <xref:System.Windows.Forms.Control> classes. + + You can use `DragDropEffects` to display different mouse pointers for drag-and-drop operations. For example, you can display a plus symbol for a `Copy` drag-and-drop operation, an arrow symbol for a `Move` drag-and-drop operation, or a red circle with a line through it symbol for a `None` drag-and-drop operation. + + If you want to drop data at a position in the target that is not currently visible, you could scroll the target while dragging. If a target does not support scrolling, you must make sure that the drop position is visible in the target before you begin the drag-and-drop operation. The following are some scenarios when you might want to scroll a target: + +- You're dragging text into a document, and you want to drop the text at a position not visible in the document window. + +- You're dragging a file into a file tree, and you want to drop the file on a node not visible in the file tree. + + + +## Examples The following example demonstrates using the `DragDropEffects` enumeration when the user moves the mouse over the drop target during a drag-and-drop operation. This example is part of a larger example provided for the <xref:System.Windows.Forms.Control.DoDragDrop%2A?displayProperty=nameWithType> method. - + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DragEventArgs" /> <altmember cref="T:System.Windows.Forms.GiveFeedbackEventArgs" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/drag-and-drop-operations-and-clipboard-support">Drag-and-Drop Operations and Clipboard Support</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/drag-and-drop-operations-and-clipboard-support">Drag-and-Drop Operations and Clipboard Support</related> </Docs> <Members> <Member MemberName="All"> diff --git a/xml/System.Windows.Forms/FileDialog.xml b/xml/System.Windows.Forms/FileDialog.xml index 4ff88e1edc6..6efdaedd798 100644 --- a/xml/System.Windows.Forms/FileDialog.xml +++ b/xml/System.Windows.Forms/FileDialog.xml @@ -38,45 +38,45 @@ <Docs> <summary>Displays a dialog box from which the user can select a file.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.FileDialog> is an abstract class that contains common behavior for the <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog> classes. It is not intended to be used directly but contains common behavior for those two classes. You cannot create an instance of <xref:System.Windows.Forms.FileDialog>. Although the class is declared public, you cannot inherit from it, as it contains internal abstract methods. To create a dialog box to select or save a file, use <xref:System.Windows.Forms.OpenFileDialog> or <xref:System.Windows.Forms.SaveFileDialog>. - - <xref:System.Windows.Forms.FileDialog> is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a file. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.FileDialog> is an abstract class that contains common behavior for the <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog> classes. It is not intended to be used directly but contains common behavior for those two classes. You cannot create an instance of <xref:System.Windows.Forms.FileDialog>. Although the class is declared public, you cannot inherit from it, as it contains internal abstract methods. To create a dialog box to select or save a file, use <xref:System.Windows.Forms.OpenFileDialog> or <xref:System.Windows.Forms.SaveFileDialog>. + + <xref:System.Windows.Forms.FileDialog> is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a file. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur. + > [!CAUTION] -> When you use classes derived from <xref:System.Windows.Forms.FileDialog>, such as <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog>, avoid using string literals containing absolute paths. Instead, dynamically obtain the path using one or more of the techniques described in the following table. - - If you want to enable users to select a folder instead of a file, use the <xref:System.Windows.Forms.FolderBrowserDialog>. - - Depending upon the type of application, how data associated with the application is stored, and the reason for accessing the file system, there are many possible ways in which you can create a directory path. The following table shows the techniques for creating paths dynamically. - -|Path or program category|Class and members to use| -|------------------------------|------------------------------| -|Standard Windows paths, such as Program Files, MyDocuments, the Desktop and so on|The <xref:System.Environment?displayProperty=nameWithType> class is the most complete source for these, either through its static methods, such as <xref:System.Environment.SystemDirectory%2A>, or through the <xref:System.Environment.GetFolderPath%2A> method, using one of the <xref:System.Environment.SpecialFolder> enumerated values.| -|Paths related to the current application|The <xref:System.Windows.Forms.Application> class has static members to obtain certain paths, such as <xref:System.Windows.Forms.Application.StartupPath%2A>, <xref:System.Windows.Forms.Application.ExecutablePath%2A>, <xref:System.Windows.Forms.Application.LocalUserAppDataPath%2A>, and <xref:System.Windows.Forms.Application.CommonAppDataPath%2A>.<br /><br /> The <xref:System.IO.Path.GetTempPath%2A> method of the <xref:System.IO.Path?displayProperty=nameWithType> returns the path of the temporary folder.<br /><br /> The <xref:System.IO.Directory.GetCurrentDirectory%2A> method of the <xref:System.IO.Directory?displayProperty=nameWithType> class returns the application's current executing directory.<br /><br /> The <xref:System.IO.DriveInfo.RootDirectory%2A> property of the <xref:System.IO.DriveInfo> class represents the specified drive's root directory.| -|Paths stored as application settings|Access the corresponding applications settings property of the wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. For more information, see [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms).| -|Registry storage|Some applications store directory information in the registry. The <xref:System.Windows.Forms.Application> class has the <xref:System.Windows.Forms.Application.CommonAppDataPath%2A> and <xref:System.Windows.Forms.Application.LocalUserAppDataPath%2A> properties that resolve to a <xref:Microsoft.Win32.RegistryKey> value.| -|ClickOnce applications|For ClickOnce applications, use <xref:System.Windows.Forms.Application> class members such as <xref:System.Windows.Forms.Application.UserAppDataPath%2A>, which will return a pointer to the ClickOnce data directory. For more information, see [Accessing Local and Remote Data in ClickOnce Applications](/visualstudio/deployment/accessing-local-and-remote-data-in-clickonce-applications).| -|International applications|For international applications, retrieve the relative path portion from a string resource in your application by using the <xref:System.Resources.ResourceReader?displayProperty=nameWithType> class. For more information about globalization and localization, see the topic [Globalization and Localization](/dotnet/standard/globalization-localization/).| - - Notice that a full path may be built up using one or more of the described techniques. For example, the <xref:System.Environment.GetFolderPath%2A> method might be used to obtain the path to the MyDocuments folder, then an application setting may be used to add a relative subdirectory portion. - - The <xref:System.IO.Path?displayProperty=nameWithType> class contains static members to assist in manipulating absolute and relative path strings, whereas the <xref:System.IO.File?displayProperty=nameWithType> and <xref:System.IO.Directory?displayProperty=nameWithType> classes have static members that actually manipulate files and directories, respectively. - +> When you use classes derived from <xref:System.Windows.Forms.FileDialog>, such as <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog>, avoid using string literals containing absolute paths. Instead, dynamically obtain the path using one or more of the techniques described in the following table. + + If you want to enable users to select a folder instead of a file, use the <xref:System.Windows.Forms.FolderBrowserDialog>. + + Depending upon the type of application, how data associated with the application is stored, and the reason for accessing the file system, there are many possible ways in which you can create a directory path. The following table shows the techniques for creating paths dynamically. + +|Path or program category|Class and members to use| +|------------------------------|------------------------------| +|Standard Windows paths, such as Program Files, MyDocuments, the Desktop and so on|The <xref:System.Environment?displayProperty=nameWithType> class is the most complete source for these, either through its static methods, such as <xref:System.Environment.SystemDirectory%2A>, or through the <xref:System.Environment.GetFolderPath%2A> method, using one of the <xref:System.Environment.SpecialFolder> enumerated values.| +|Paths related to the current application|The <xref:System.Windows.Forms.Application> class has static members to obtain certain paths, such as <xref:System.Windows.Forms.Application.StartupPath%2A>, <xref:System.Windows.Forms.Application.ExecutablePath%2A>, <xref:System.Windows.Forms.Application.LocalUserAppDataPath%2A>, and <xref:System.Windows.Forms.Application.CommonAppDataPath%2A>.<br /><br /> The <xref:System.IO.Path.GetTempPath%2A> method of the <xref:System.IO.Path?displayProperty=nameWithType> returns the path of the temporary folder.<br /><br /> The <xref:System.IO.Directory.GetCurrentDirectory%2A> method of the <xref:System.IO.Directory?displayProperty=nameWithType> class returns the application's current executing directory.<br /><br /> The <xref:System.IO.DriveInfo.RootDirectory%2A> property of the <xref:System.IO.DriveInfo> class represents the specified drive's root directory.| +|Paths stored as application settings|Access the corresponding applications settings property of the wrapper class derived from <xref:System.Configuration.ApplicationSettingsBase>. For more information, see [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms).| +|Registry storage|Some applications store directory information in the registry. The <xref:System.Windows.Forms.Application> class has the <xref:System.Windows.Forms.Application.CommonAppDataPath%2A> and <xref:System.Windows.Forms.Application.LocalUserAppDataPath%2A> properties that resolve to a <xref:Microsoft.Win32.RegistryKey> value.| +|ClickOnce applications|For ClickOnce applications, use <xref:System.Windows.Forms.Application> class members such as <xref:System.Windows.Forms.Application.UserAppDataPath%2A>, which will return a pointer to the ClickOnce data directory. For more information, see [Accessing Local and Remote Data in ClickOnce Applications](/visualstudio/deployment/accessing-local-and-remote-data-in-clickonce-applications).| +|International applications|For international applications, retrieve the relative path portion from a string resource in your application by using the <xref:System.Resources.ResourceReader?displayProperty=nameWithType> class. For more information about globalization and localization, see the topic [Globalization and Localization](/dotnet/standard/globalization-localization/).| + + Notice that a full path may be built up using one or more of the described techniques. For example, the <xref:System.Environment.GetFolderPath%2A> method might be used to obtain the path to the MyDocuments folder, then an application setting may be used to add a relative subdirectory portion. + + The <xref:System.IO.Path?displayProperty=nameWithType> class contains static members to assist in manipulating absolute and relative path strings, whereas the <xref:System.IO.File?displayProperty=nameWithType> and <xref:System.IO.Directory?displayProperty=nameWithType> classes have static members that actually manipulate files and directories, respectively. + > [!IMPORTANT] -> If the user of your application changes the folder in the <xref:System.Windows.Forms.FileDialog>, then the current working directory for your application is set to the location specified in the <xref:System.Windows.Forms.FileDialog>. To prevent this, set the <xref:System.Windows.Forms.FileDialog.RestoreDirectory%2A> property to `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> method to display the dialog box and return the <xref:System.Windows.Forms.DialogResult>. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. - +> If the user of your application changes the folder in the <xref:System.Windows.Forms.FileDialog>, then the current working directory for your application is set to the location specified in the <xref:System.Windows.Forms.FileDialog>. To prevent this, set the <xref:System.Windows.Forms.FileDialog.RestoreDirectory%2A> property to `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> method to display the dialog box and return the <xref:System.Windows.Forms.DialogResult>. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.CommonDialog" /> @@ -130,15 +130,15 @@ <value> <see langword="true" /> if the dialog box adds an extension to a file name if the user omits the extension; otherwise, <see langword="false" />. The default value is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The extension added to a file name depends on the currently selected file filter and the value of the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property. - - If the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property is `true`, the dialog box adds the first extension from the current file filter that matches an existing file. If no files match the current file filter, the dialog box adds the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property. - - If the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property is `false`, the dialog box adds the first valid file name extension from the current file filter. If the current file filter contains no valid file name extensions, the dialog box adds the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The extension added to a file name depends on the currently selected file filter and the value of the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property. + + If the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property is `true`, the dialog box adds the first extension from the current file filter that matches an existing file. If no files match the current file filter, the dialog box adds the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property. + + If the <xref:System.Windows.Forms.FileDialog.CheckFileExists%2A> property is `false`, the dialog box adds the first valid file name extension from the current file filter. If the current file filter contains no valid file name extensions, the dialog box adds the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.Filter" /> @@ -216,13 +216,13 @@ <value> <see langword="true" /> if this <see cref="T:System.Windows.Forms.FileDialog" /> instance should automatically upgrade appearance and behavior when running on Windows Vista; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the <xref:System.Windows.Forms.FileDialog> class will have a Windows XP-style appearance and behavior on Windows Vista. - - On Windows XP, this property does not have any effect. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the <xref:System.Windows.Forms.FileDialog> class will have a Windows XP-style appearance and behavior on Windows Vista. + + On Windows XP, this property does not have any effect. + ]]></format> </remarks> </Docs> @@ -265,11 +265,11 @@ <value> <see langword="true" /> if the dialog box displays a warning if the user specifies a file name that does not exist; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The default value is `true` for an inheriting <xref:System.Windows.Forms.OpenFileDialog> and `false` for an inheriting <xref:System.Windows.Forms.SaveFileDialog>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The default value is `true` for an inheriting <xref:System.Windows.Forms.OpenFileDialog> and `false` for an inheriting <xref:System.Windows.Forms.SaveFileDialog>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.CheckPathExists" /> @@ -409,19 +409,19 @@ <summary>Gets the custom places collection for this <see cref="T:System.Windows.Forms.FileDialog" /> instance.</summary> <value>The custom places collection for this <see cref="T:System.Windows.Forms.FileDialog" /> instance.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - On Windows XP, this property does not have any effect. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialog.CustomPlaces%2A> collection. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + On Windows XP, this property does not have any effect. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialog.CustomPlaces%2A> collection. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -459,22 +459,22 @@ <summary>Gets or sets the default file name extension.</summary> <value>The default file name extension. The returned string does not include the period. The default value is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the user of your application specifies a file name without an extension, the <xref:System.Windows.Forms.FileDialog> appends an extension to the file name. The extension that is used is determined by the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> properties. If a filter is selected in the <xref:System.Windows.Forms.FileDialog> and the filter specifies an extension, then that extension is used. If the filter selected uses a wildcard in place of the extension, then the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property is used. - - - -## Examples - The following code example demonstrates using the <xref:System.Windows.Forms.RichTextBox.SaveFile%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.RichTextBox.LoadFile%2A?displayProperty=nameWithType> methods with streams. It also demonstrates using the <xref:System.Windows.Forms.FileDialog.FileName%2A>, <xref:System.Windows.Forms.FileDialog.DefaultExt%2A>, <xref:System.Windows.Forms.SaveFileDialog.CreatePrompt%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.SaveFileDialog.OverwritePrompt%2A?displayProperty=nameWithType> members. - - This is a complete example that is ready to run when you copy it to your project. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the user of your application specifies a file name without an extension, the <xref:System.Windows.Forms.FileDialog> appends an extension to the file name. The extension that is used is determined by the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> properties. If a filter is selected in the <xref:System.Windows.Forms.FileDialog> and the filter specifies an extension, then that extension is used. If the filter selected uses a wildcard in place of the extension, then the extension specified in the <xref:System.Windows.Forms.FileDialog.DefaultExt%2A> property is used. + + + +## Examples + The following code example demonstrates using the <xref:System.Windows.Forms.RichTextBox.SaveFile%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.RichTextBox.LoadFile%2A?displayProperty=nameWithType> methods with streams. It also demonstrates using the <xref:System.Windows.Forms.FileDialog.FileName%2A>, <xref:System.Windows.Forms.FileDialog.DefaultExt%2A>, <xref:System.Windows.Forms.SaveFileDialog.CreatePrompt%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.SaveFileDialog.OverwritePrompt%2A?displayProperty=nameWithType> members. + + This is a complete example that is ready to run when you copy it to your project. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/DefaultExt/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -576,26 +576,26 @@ <summary>Gets or sets a string containing the file name selected in the file dialog box.</summary> <value>The file name selected in the file dialog box. The default value is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The file name includes both the file path and the extension. If no files are selected, this method returns an empty string (""). - - When used from the <xref:System.Windows.Forms.SaveFileDialog> class, this property represents the file being saved; when used from the <xref:System.Windows.Forms.OpenFileDialog> class, it represents the file being opened. - - This property can only be the name of one selected file. If you want to return an array containing the names of all selected files in a multiple-selection dialog box, use <xref:System.Windows.Forms.FileDialog.FileNames%2A>. - - - -## Examples - The following code example demonstrates using the <xref:System.Windows.Forms.RichTextBox.SaveFile%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.RichTextBox.LoadFile%2A?displayProperty=nameWithType> methods with streams. It also demonstrates using the <xref:System.Windows.Forms.FileDialog.FileName%2A>, <xref:System.Windows.Forms.FileDialog.DefaultExt%2A>, <xref:System.Windows.Forms.SaveFileDialog.CreatePrompt%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.SaveFileDialog.OverwritePrompt%2A?displayProperty=nameWithType> members. - - This is a complete example that is ready to run when you copy it to your project. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The file name includes both the file path and the extension. If no files are selected, this method returns an empty string (""). + + When used from the <xref:System.Windows.Forms.SaveFileDialog> class, this property represents the file being saved; when used from the <xref:System.Windows.Forms.OpenFileDialog> class, it represents the file being opened. + + This property can only be the name of one selected file. If you want to return an array containing the names of all selected files in a multiple-selection dialog box, use <xref:System.Windows.Forms.FileDialog.FileNames%2A>. + + + +## Examples + The following code example demonstrates using the <xref:System.Windows.Forms.RichTextBox.SaveFile%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.RichTextBox.LoadFile%2A?displayProperty=nameWithType> methods with streams. It also demonstrates using the <xref:System.Windows.Forms.FileDialog.FileName%2A>, <xref:System.Windows.Forms.FileDialog.DefaultExt%2A>, <xref:System.Windows.Forms.SaveFileDialog.CreatePrompt%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.SaveFileDialog.OverwritePrompt%2A?displayProperty=nameWithType> members. + + This is a complete example that is ready to run when you copy it to your project. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/DefaultExt/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.FileNames" /> @@ -644,19 +644,19 @@ <summary>Gets the file names of all selected files in the dialog box.</summary> <value>An array of type <see cref="T:System.String" />, containing the file names of all selected files in the dialog box.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each file name includes both the file path and the extension. If no files are selected, this method returns an empty array. - - - -## Examples - The following code example allows the user to select a number of images and display them in <xref:System.Windows.Forms.PictureBox> controls on a Form. It demonstrates initializing an <xref:System.Windows.Forms.OpenFileDialog>, setting the <xref:System.Windows.Forms.FileDialog.Title%2A> and <xref:System.Windows.Forms.FileDialog.Filter%2A> properties, and allowing the user to select multiple files by setting the <xref:System.Windows.Forms.OpenFileDialog.Multiselect%2A> property to true. This code example assumes that your form already has an <xref:System.Windows.Forms.OpenFileDialog> control named `openFileDialog1`, a <xref:System.Windows.Forms.Button> named `SelectFileButton`, and a <xref:System.Windows.Forms.FlowLayoutPanel> named `flowLayoutPanel1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each file name includes both the file path and the extension. If no files are selected, this method returns an empty array. + + + +## Examples + The following code example allows the user to select a number of images and display them in <xref:System.Windows.Forms.PictureBox> controls on a Form. It demonstrates initializing an <xref:System.Windows.Forms.OpenFileDialog>, setting the <xref:System.Windows.Forms.FileDialog.Title%2A> and <xref:System.Windows.Forms.FileDialog.Filter%2A> properties, and allowing the user to select multiple files by setting the <xref:System.Windows.Forms.OpenFileDialog.Multiselect%2A> property to true. This code example assumes that your form already has an <xref:System.Windows.Forms.OpenFileDialog> control named `openFileDialog1`, a <xref:System.Windows.Forms.Button> named `SelectFileButton`, and a <xref:System.Windows.Forms.FlowLayoutPanel> named `flowLayoutPanel1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/FileNames/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.OpenFileDialog.MultiSelect/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.OpenFileDialog.MultiSelect/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.FileName" /> @@ -688,20 +688,20 @@ <Docs> <summary>Occurs when the user clicks on the **Open** or **Save** button on a file dialog box.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates using the <xref:System.Windows.Forms.FileDialog.FileNames%2A> property, handling the <xref:System.Windows.Forms.FileDialog.FileOk> event and using the <xref:System.Windows.Forms.Application.DoEvents%2A?displayProperty=nameWithType> method. When the example runs, a user can select graphics files from an <xref:System.Windows.Forms.OpenFileDialog> object. The selected files are displayed in the form. The <xref:System.Windows.Forms.Application.DoEvents%2A?displayProperty=nameWithType> method forces a repaint of the form for each graphics file opened. To run this example paste the following code in a form containing a <xref:System.Windows.Forms.PictureBox> named `PictureBox1`, an <xref:System.Windows.Forms.OpenFileDialog> named `OpenFileDialog1`, and a <xref:System.Windows.Forms.Button> named `fileButton`. Call the `InitializePictureBox` and `InitializeOpenFileDialog` methods from the form's constructor or `Load` method. When the example is running, display the dialog box by clicking the button. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates using the <xref:System.Windows.Forms.FileDialog.FileNames%2A> property, handling the <xref:System.Windows.Forms.FileDialog.FileOk> event and using the <xref:System.Windows.Forms.Application.DoEvents%2A?displayProperty=nameWithType> method. When the example runs, a user can select graphics files from an <xref:System.Windows.Forms.OpenFileDialog> object. The selected files are displayed in the form. The <xref:System.Windows.Forms.Application.DoEvents%2A?displayProperty=nameWithType> method forces a repaint of the form for each graphics file opened. To run this example paste the following code in a form containing a <xref:System.Windows.Forms.PictureBox> named `PictureBox1`, an <xref:System.Windows.Forms.OpenFileDialog> named `OpenFileDialog1`, and a <xref:System.Windows.Forms.Button> named `fileButton`. Call the `InitializePictureBox` and `InitializeOpenFileDialog` methods from the form's constructor or `Load` method. When the example is running, display the dialog box by clicking the button. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/CPP/filedialogform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Application/DoEvents/filedialogform.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.FileDialog.OnFileOk(System.ComponentModel.CancelEventArgs)" /> @@ -744,30 +744,30 @@ <summary>Gets or sets the current file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box.</summary> <value>The file filtering options available in the dialog box.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar. - - The following is an example of a filter string: - - `Text files (*.txt)|*.txt|All files (*.*)|*.*` - - You can add several filter patterns to a filter by separating the file types with semicolons, for example: - - `Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*` - - Use the <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> property to set which filtering option is shown first to the user. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> properties to provide a list of filters for the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. - + <format type="text/markdown"><![CDATA[ + +## Remarks + For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar. + + The following is an example of a filter string: + + `Text files (*.txt)|*.txt|All files (*.*)|*.*` + + You can add several filter patterns to a filter by separating the file types with semicolons, for example: + + `Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*` + + Use the <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> property to set which filtering option is shown first to the user. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> properties to provide a list of filters for the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException"> @@ -817,23 +817,23 @@ <summary>Gets or sets the index of the filter currently selected in the file dialog box.</summary> <value>A value containing the index of the filter currently selected in the file dialog box. The default value is 1.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> property to set which filtering option is shown first to the user. You can also use the value of <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> after showing the file dialog to perform special file operations depending upon the filter chosen. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> property to set which filtering option is shown first to the user. You can also use the value of <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> after showing the file dialog to perform special file operations depending upon the filter chosen. + > [!NOTE] -> The index value of the first filter entry is 1. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> properties to provide a list of filters for the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. - +> The index value of the first filter entry is 1. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.Filter%2A> and <xref:System.Windows.Forms.FileDialog.FilterIndex%2A> properties to provide a list of filters for the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.CheckFileExists" /> @@ -877,13 +877,13 @@ <summary>Defines the common dialog box hook procedure that is overridden to add specific functionality to the file dialog box.</summary> <returns>Returns zero if the default dialog box procedure processes the message; returns a nonzero value if the default dialog box procedure ignores the message.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A hook procedure allows the user to connect or insert other routines into a routine or application for the purpose of debugging or enhancing functionality. - - By default, the hook procedure centers the dialog box on the screen in response to a WM_INITDIALOG message. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A hook procedure allows the user to connect or insert other routines into a routine or application for the purpose of debugging or enhancing functionality. + + By default, the hook procedure centers the dialog box on the screen in response to a WM_INITDIALOG message. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -928,32 +928,32 @@ <summary>Gets or sets the initial directory displayed by the file dialog box.</summary> <value>The initial directory displayed by the file dialog box. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> property is typically set using one of the following sources: - -- A path that was previously used in the program, perhaps retained from the last directory or file operation. - -- A path read from a persistent source, such as an application setting, a <xref:Microsoft.Win32.Registry> or a string resource in the application. - -- Standard Windows system and user paths, such as Program Files, MyDocuments, MyMusic, and so on (which you can obtain using the <xref:System.Environment.GetFolderPath%2A> method) - -- A path related to the current application, such as its startup directory (which you can obtain using properties on the <xref:System.Windows.Forms.Application> object). - - For more information about creating dynamic paths, see the <xref:System.Windows.Forms.FileDialog> class overview. - - On Windows Vista, if <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> is set to a full file name instead of just a directory path, the initial directory will default either to the application path, or to the directory from which the user last selected a file. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> property to set what the initial directory is when the dialog box is displayed to the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> property is typically set using one of the following sources: + +- A path that was previously used in the program, perhaps retained from the last directory or file operation. + +- A path read from a persistent source, such as an application setting, a <xref:Microsoft.Win32.Registry> or a string resource in the application. + +- Standard Windows system and user paths, such as Program Files, MyDocuments, MyMusic, and so on (which you can obtain using the <xref:System.Environment.GetFolderPath%2A> method) + +- A path related to the current application, such as its startup directory (which you can obtain using properties on the <xref:System.Windows.Forms.Application> object). + + For more information about creating dynamic paths, see the <xref:System.Windows.Forms.FileDialog> class overview. + + On Windows Vista, if <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> is set to a full file name instead of just a directory path, the initial directory will default either to the application path, or to the directory from which the user last selected a file. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.InitialDirectory%2A> property to set what the initial directory is when the dialog box is displayed to the user. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.RestoreDirectory" /> @@ -1082,11 +1082,11 @@ <summary>Gets values to initialize the <see cref="T:System.Windows.Forms.FileDialog" />.</summary> <value>A bitwise combination of internal values that initializes the <see cref="T:System.Windows.Forms.FileDialog" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.FileDialog.Options%2A> property corresponds to the flags used to initialize a file dialog box using Win32. Use the properties of the <xref:System.Windows.Forms.FileDialog> class to get and set the options. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.FileDialog.Options%2A> property corresponds to the flags used to initialize a file dialog box using Win32. Use the properties of the <xref:System.Windows.Forms.FileDialog> class to get and set the options. + ]]></format> </remarks> </Docs> @@ -1161,15 +1161,15 @@ <value> <see langword="true" /> if the dialog box restores the current directory to the previously selected directory if the user changed the directory while searching for files; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.RestoreDirectory%2A> property to ensure that the previously selected directory is restored when the dialog box is closed. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example uses the <xref:System.Windows.Forms.OpenFileDialog> implementation of <xref:System.Windows.Forms.FileDialog> and illustrates creating, setting of properties, and showing the dialog box. The example uses the <xref:System.Windows.Forms.FileDialog.RestoreDirectory%2A> property to ensure that the previously selected directory is restored when the dialog box is closed. The example requires a form with a <xref:System.Windows.Forms.Button> placed on it and the <xref:System.IO> namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.InitialDirectory" /> @@ -1207,13 +1207,13 @@ <returns> <see langword="true" /> if the file could be opened; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method provides an implementation of <xref:System.Windows.Forms.CommonDialog.RunDialog%2A>, and is invoked when the user of a file dialog invokes <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A>. - - In the derived classes <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog> an invalid file name <xref:System.Exception> can be raised. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method provides an implementation of <xref:System.Windows.Forms.CommonDialog.RunDialog%2A>, and is invoked when the user of a file dialog invokes <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A>. + + In the derived classes <xref:System.Windows.Forms.OpenFileDialog> and <xref:System.Windows.Forms.SaveFileDialog> an invalid file name <xref:System.Exception> can be raised. + ]]></format> </remarks> </Docs> @@ -1260,11 +1260,11 @@ <value> <see langword="true" /> if the dialog box includes a help button; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A <xref:System.Windows.Forms.Control.HelpRequested> event is raised when the user clicks the **Help** button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A <xref:System.Windows.Forms.Control.HelpRequested> event is raised when the user clicks the **Help** button. + ]]></format> </remarks> </Docs> @@ -1370,21 +1370,21 @@ <value> <see langword="true" /> if the dialog box supports multiple file name extensions; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Sometimes users must open and save files that use multiple file name extensions. For example, the application manifest files used by the ClickOnce deployment technology end in the complex file name extension ".exe.manifest". Setting this property to `true` enables you to set the <xref:System.Windows.Forms.FileDialog.Filter%2A> property to a multi-dotted extension. - - If <xref:System.Windows.Forms.FileDialog.SupportMultiDottedExtensions%2A> is `false`, and you assign a multi-dotted extension to <xref:System.Windows.Forms.FileDialog.Filter%2A>, derived controls such as <xref:System.Windows.Forms.SaveFileDialog> will only use the last extension in the string. For example, ".manifest" will be used instead of ".exe.manifest". - - - -## Examples - The following code example saves files with the extension ".data.txt". This code example requires that your application host a <xref:System.Windows.Forms.SaveFileDialog> named `saveFileDialog1` and a <xref:System.Windows.Forms.Button> named `button1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Sometimes users must open and save files that use multiple file name extensions. For example, the application manifest files used by the ClickOnce deployment technology end in the complex file name extension ".exe.manifest". Setting this property to `true` enables you to set the <xref:System.Windows.Forms.FileDialog.Filter%2A> property to a multi-dotted extension. + + If <xref:System.Windows.Forms.FileDialog.SupportMultiDottedExtensions%2A> is `false`, and you assign a multi-dotted extension to <xref:System.Windows.Forms.FileDialog.Filter%2A>, derived controls such as <xref:System.Windows.Forms.SaveFileDialog> will only use the last extension in the string. For example, ".manifest" will be used instead of ".exe.manifest". + + + +## Examples + The following code example saves files with the extension ".data.txt". This code example requires that your application host a <xref:System.Windows.Forms.SaveFileDialog> named `saveFileDialog1` and a <xref:System.Windows.Forms.Button> named `button1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/SupportMultiDottedExtensions/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SupportMultiDottedExtensions/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SupportMultiDottedExtensions/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.Filter" /> @@ -1427,20 +1427,20 @@ <summary>Gets or sets the file dialog box title.</summary> <value>The file dialog box title. The default value is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The string is placed in the title bar of the dialog box. If the title is an empty string, the system uses a default title, which is either "Save As" or "Open". - - - -## Examples - The following code example demonstrates initializing an <xref:System.Windows.Forms.OpenFileDialog>, setting the <xref:System.Windows.Forms.FileDialog.Title%2A> and <xref:System.Windows.Forms.FileDialog.Filter%2A> properties, and allowing the user to select multiple files by setting the <xref:System.Windows.Forms.OpenFileDialog.Multiselect%2A?displayProperty=nameWithType> property to true. To run this example, paste the following code in a form containing an <xref:System.Windows.Forms.OpenFileDialog> named `OpenFileDialog1` and a <xref:System.Windows.Forms.Button> named `fileButton`. Call the `InitializeOpenFileDialog` method in the form's constructor or `Load` method. The example also requires that the `Click` event of the `Button` control is connected to the event handler defined in the example. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The string is placed in the title bar of the dialog box. If the title is an empty string, the system uses a default title, which is either "Save As" or "Open". + + + +## Examples + The following code example demonstrates initializing an <xref:System.Windows.Forms.OpenFileDialog>, setting the <xref:System.Windows.Forms.FileDialog.Title%2A> and <xref:System.Windows.Forms.FileDialog.Filter%2A> properties, and allowing the user to select multiple files by setting the <xref:System.Windows.Forms.OpenFileDialog.Multiselect%2A?displayProperty=nameWithType> property to true. To run this example, paste the following code in a form containing an <xref:System.Windows.Forms.OpenFileDialog> named `OpenFileDialog1` and a <xref:System.Windows.Forms.Button> named `fileButton`. Call the `InitializeOpenFileDialog` method in the form's constructor or `Load` method. The example also requires that the `Click` event of the `Button` control is connected to the event handler defined in the example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/CPP/filedialogform.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Application/DoEvents/filedialogform.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet6"::: + ]]></format> </remarks> </Docs> @@ -1509,11 +1509,11 @@ <value> <see langword="true" /> if the dialog box accepts only valid Win32 file names; otherwise, <see langword="false" />. The default value is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the edit control contains anything but spaces when the user clicks **OK**, the dialog box returns the file name, whether it is valid or not. No default extension is added to the text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the edit control contains anything but spaces when the user clicks **OK**, the dialog box returns the file name, whether it is valid or not. No default extension is added to the text. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/FileDialogCustomPlace.xml b/xml/System.Windows.Forms/FileDialogCustomPlace.xml index 4f2c0c966c4..9f24373fb7f 100644 --- a/xml/System.Windows.Forms/FileDialogCustomPlace.xml +++ b/xml/System.Windows.Forms/FileDialogCustomPlace.xml @@ -50,8 +50,8 @@ ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FileDialog.CustomPlaces" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-add-a-custom-place-to-a-file-dialog-box">How To: Add a Custom Place to a File Dialog Box</related> - <related type="Article" href="/dotnet/framework/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder GUIDs for File Dialog Custom Places</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-add-a-custom-place-to-a-file-dialog-box">How To: Add a Custom Place to a File Dialog Box</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder GUIDs for File Dialog Custom Places</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -96,7 +96,7 @@ <format type="text/markdown">< or the KnownFolders.h file in the Windows SDK. + For a list of the available Windows Vista Known Folders, see [Known Folder GUIDs for File Dialog Custom Places](/dotnet/desktop/winforms/controls/known-folder-guids-for-file-dialog-custom-places) or the KnownFolders.h file in the Windows SDK. @@ -177,7 +177,7 @@ </ReturnValue> <Docs> <summary>Gets or sets the Windows Vista Known Folder GUID for the custom place.</summary> - <value>A <see cref="T:System.Guid" /> that indicates the Windows Vista Known Folder for the custom place. If the custom place was specified with a folder path, then an empty GUID is returned. For a list of the available Windows Vista Known Folders, see <see href="/dotnet/framework/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder GUIDs for File Dialog Custom Places</see> or the KnownFolders.h file in the Windows SDK.</value> + <value>A <see cref="T:System.Guid" /> that indicates the Windows Vista Known Folder for the custom place. If the custom place was specified with a folder path, then an empty GUID is returned. For a list of the available Windows Vista Known Folders, see <see href="/dotnet/desktop/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder GUIDs for File Dialog Custom Places</see> or the KnownFolders.h file in the Windows SDK.</value> <remarks>To be added.</remarks> <altmember cref="P:System.Windows.Forms.FileDialog.CustomPlaces" /> </Docs> diff --git a/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml b/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml index c389ed728b8..b8366b1d4fe 100644 --- a/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml +++ b/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml @@ -43,19 +43,19 @@ <Docs> <summary>Represents a collection of Windows Vista custom places for the <see cref="T:System.Windows.Forms.FileDialog" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - On Windows XP or Windows Server 2003, this class does not have any effect. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection>. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + On Windows XP or Windows Server 2003, this class does not have any effect. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection>. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.FileDialogCustomPlace" /> @@ -137,25 +137,25 @@ <param name="knownFolderGuid">A <see cref="T:System.Guid" /> that represents a Windows Vista Known Folder.</param> <summary>Adds a custom place to the <see cref="T:System.Windows.Forms.FileDialogCustomPlacesCollection" /> collection.</summary> <remarks> - <format type="text/markdown">< or the KnownFolders.h file in the Windows SDK. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection.Add%2A> method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown">< or the KnownFolders.h file in the Windows SDK. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection.Add%2A> method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.FileDialogCustomPlace" /> - <related type="Article" href="/dotnet/framework/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder Guids for File Dialog Custom Places</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/known-folder-guids-for-file-dialog-custom-places">Known Folder Guids for File Dialog Custom Places</related> </Docs> </Member> <Member MemberName="Add"> @@ -191,21 +191,21 @@ <param name="path">A folder path to the custom place.</param> <summary>Adds a custom place to the <see cref="T:System.Windows.Forms.FileDialogCustomPlacesCollection" /> collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The folder is added to custom places only for a particular <xref:System.Windows.Forms.FileDialog> and is not a system or application wide change. - - The folders are positioned in the custom places in the order that they are added to the <xref:System.Windows.Forms.FileDialog>. The last one added will be at the top. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection.Add%2A> method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The folder is added to custom places only for a particular <xref:System.Windows.Forms.FileDialog> and is not a system or application wide change. + + The folders are positioned in the custom places in the order that they are added to the <xref:System.Windows.Forms.FileDialog>. The last one added will be at the top. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.FileDialogCustomPlacesCollection.Add%2A> method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.FileDialogCustomPlace" /> diff --git a/xml/System.Windows.Forms/FlowLayoutPanel.xml b/xml/System.Windows.Forms/FlowLayoutPanel.xml index 0870c465147..5c78308c9a7 100644 --- a/xml/System.Windows.Forms/FlowLayoutPanel.xml +++ b/xml/System.Windows.Forms/FlowLayoutPanel.xml @@ -61,31 +61,31 @@ <Docs> <summary>Represents a panel that dynamically lays out its contents horizontally or vertically.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following example shows how to set the <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> and <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> properties on a <xref:System.Windows.Forms.FlowLayoutPanel> control. Paste the code into the Form1 source file. If your project contains a file named Form1.Designer.cs or Form1.Designer.vb, remove that file from the project. You may need to click the **Show All Files** button in Solution Explorer to see the designer file. - + <format type="text/markdown"><. + + + +## Examples + The following example shows how to set the <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> and <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> properties on a <xref:System.Windows.Forms.FlowLayoutPanel> control. Paste the code into the Form1 source file. If your project contains a file named Form1.Designer.cs or Form1.Designer.vb, remove that file from the project. You may need to click the **Show All Files** button in Solution Explorer to see the designer file. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutPanel" /> <altmember cref="P:System.Windows.Forms.FlowLayoutPanel.FlowDirection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-flowlayoutpanel-control">How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-flowlayoutpanel-control">How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -110,11 +110,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.FlowLayoutPanel" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> and <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> properties to their default values: <xref:System.Windows.Forms.FlowDirection.LeftToRight> and `true`, respectively. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> and <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> properties to their default values: <xref:System.Windows.Forms.FlowDirection.LeftToRight> and `true`, respectively. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FlowLayoutPanel.FlowDirection" /> @@ -157,20 +157,20 @@ <summary>Gets or sets a value indicating the flow direction of the <see cref="T:System.Windows.Forms.FlowLayoutPanel" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.FlowDirection" /> values indicating the direction of consecutive placement of controls in the panel. The default is <see cref="F:System.Windows.Forms.FlowDirection.LeftToRight" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> property is the default property for the <xref:System.Windows.Forms.FlowLayoutPanel> class. - - - -## Examples - The following code example sets the value of <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> depending on the selected <xref:System.Windows.Forms.RadioButton>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> property is the default property for the <xref:System.Windows.Forms.FlowLayoutPanel> class. + + + +## Examples + The following code example sets the value of <xref:System.Windows.Forms.FlowLayoutPanel.FlowDirection%2A> depending on the selected <xref:System.Windows.Forms.RadioButton>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FlowLayoutPanel.WrapContents" /> @@ -326,11 +326,11 @@ <returns> <see langword="true" /> if this object can provide extender properties to the specified object; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.FlowLayoutPanel> instance is cast to an <xref:System.ComponentModel.IExtenderProvider> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.FlowLayoutPanel> instance is cast to an <xref:System.ComponentModel.IExtenderProvider> interface. + ]]></format> </remarks> </Docs> @@ -372,22 +372,22 @@ <value> <see langword="true" /> if the contents should be wrapped; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the area of the panel is too small to contain all its child controls, at least one child control will be clipped regardless of the wrapping mode. - - Subsequent resizing of the panel will reapply the layout to the contained controls. - - - -## Examples - The following code example sets the value of the <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> property depending on the <xref:System.Windows.Forms.CheckBox.Checked%2A> value of a <xref:System.Windows.Forms.CheckBox> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the area of the panel is too small to contain all its child controls, at least one child control will be clipped regardless of the wrapping mode. + + Subsequent resizing of the panel will reapply the layout to the contained controls. + + + +## Examples + The following code example sets the value of the <xref:System.Windows.Forms.FlowLayoutPanel.WrapContents%2A> property depending on the <xref:System.Windows.Forms.CheckBox.Checked%2A> value of a <xref:System.Windows.Forms.CheckBox> control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.FlowLayoutPanel.FlowDirection" /> diff --git a/xml/System.Windows.Forms/Form.xml b/xml/System.Windows.Forms/Form.xml index d39dd61cae9..fc90f7087c9 100644 --- a/xml/System.Windows.Forms/Form.xml +++ b/xml/System.Windows.Forms/Form.xml @@ -100,7 +100,7 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/multiple-document-interface-mdi-applications">Multiple-Document Interface (MDI) Applications</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/multiple-document-interface-mdi-applications">Multiple-Document Interface (MDI) Applications</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -722,7 +722,7 @@ ## Remarks > [!IMPORTANT] -> The <xref:System.Windows.Forms.Form.AutoScale%2A> is obsolete and has been retained for backward compatibility. The non-obsolete alternative is <xref:System.Windows.Forms.ContainerControl.AutoScaleMode%2A?displayProperty=nameWithType>. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> The <xref:System.Windows.Forms.Form.AutoScale%2A> is obsolete and has been retained for backward compatibility. The non-obsolete alternative is <xref:System.Windows.Forms.ContainerControl.AutoScaleMode%2A?displayProperty=nameWithType>. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). You can use this property to allow your form and its controls to automatically adjust based on changes in the font. This can be useful in applications where the font might increase or decrease based on the language specified for use by Windows. @@ -794,7 +794,7 @@ ## Remarks > [!IMPORTANT] -> This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). The value of the <xref:System.Windows.Forms.Form.AutoScaleBaseSize%2A> property is used at form-display time to compute the scaling factor for the form. The autoscaling base size is used by the form as a baseline for comparison to the system's font size to determine how much to scale the form when autoscaling is used. If you want to determine the size a form will auto scale to based on a specific font, use the <xref:System.Windows.Forms.Form.GetAutoScaleSize%2A> method. @@ -1330,7 +1330,7 @@ The size of the client area of the form is the size of the form excluding the borders and the title bar. The client area of a form is the area within a form where controls can be placed. You can use this property to get the proper dimensions when performing graphics operations or when sizing and positioning controls on the form. To get the size of the entire form, use the <xref:System.Windows.Forms.Form.Size%2A> property or use the individual properties <xref:System.Windows.Forms.Control.Height%2A> and <xref:System.Windows.Forms.Control.Width%2A>. > [!NOTE] -> You cannot currently bind to this property using application settings. For more information on application settings, see [Application Settings Overview](/dotnet/framework/winforms/advanced/application-settings-overview). +> You cannot currently bind to this property using application settings. For more information on application settings, see [Application Settings Overview](/dotnet/desktop/winforms/advanced/application-settings-overview). @@ -2227,7 +2227,7 @@ </value> <remarks> <para> - Note: Reading this property is only for tracking purposes. If the Form's border color is changed through other external means (Win32 calls), + Note: Reading this property is only for tracking purposes. If the Form's border color is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. </para> <para> @@ -2362,11 +2362,11 @@ </value> <remarks> <para> - Reading this property is only for tracking purposes. If the window's title bar color is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the window's title bar color is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. </para> <para> - The property only reflects the value that was previously set using this property. The <see cref="E:System.Windows.Forms.Form.FormCaptionBackColorChanged" /> + The property only reflects the value that was previously set using this property. The <see cref="E:System.Windows.Forms.Form.FormCaptionBackColorChanged" /> event is raised accordingly when the value is changed, which allows the property to be participating in binding scenarios. </para> </remarks> @@ -2437,11 +2437,11 @@ </value> <remarks> <para> - Reading this property is only for tracking purposes. If the Form's title bar's text color (window caption text) is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the Form's title bar's text color (window caption text) is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. </para> <para> - The property only reflects the value that was previously set using this property. The <see cref="E:System.Windows.Forms.Form.FormCaptionTextColorChanged" /> + The property only reflects the value that was previously set using this property. The <see cref="E:System.Windows.Forms.Form.FormCaptionTextColorChanged" /> event is raised accordingly when the value is changed, which allows the property to be participating in binding scenarios. </para> </remarks> @@ -2635,7 +2635,7 @@ <value>To be added.</value> <remarks> <para> - Reading this property is only for tracking purposes. If the Form's corner preference is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the Form's corner preference is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. </para> <para> @@ -2726,7 +2726,7 @@ ## Remarks > [!IMPORTANT] -> The <xref:System.Windows.Forms.Form.GetAutoScaleSize%2A> method is obsolete starting with the .NET Framework 2.0. This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> The <xref:System.Windows.Forms.Form.GetAutoScaleSize%2A> method is obsolete starting with the .NET Framework 2.0. This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). You can use this method to determine the size a form would autoscale to for a specific font before applying the font to the form. If you want to determine the size a form is autoscaled to based on the font currently assigned to the form, use the <xref:System.Windows.Forms.Form.AutoScaleBaseSize%2A> property. @@ -6717,7 +6717,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another ## Remarks The <xref:System.Windows.Forms.Form.ProcessCmdKey%2A> method overrides the base <xref:System.Windows.Forms.ContainerControl.ProcessCmdKey%2A?displayProperty=nameWithType> implementation to provide additional handling of main menu command keys and MDI accelerators. - For information about keyboard input, see [Keyboard Input in a Windows Forms Application](/dotnet/framework/winforms/keyboard-input-in-a-windows-forms-application). + For information about keyboard input, see [Keyboard Input in a Windows Forms Application](/dotnet/desktop/winforms/keyboard-input-in-a-windows-forms-application). ]]></format> </remarks> @@ -7763,7 +7763,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another If the owner window is provided, it ensures that the owner is topmost and sets the owner for the form. </para> <para> - This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, attempting to display the form when + This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, attempting to display the form when it is not a top-level window, or setting the form as its own owner. </para> <para> @@ -8197,7 +8197,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another <format type="text/markdown"><. + The <xref:System.Windows.Forms.Form.Shown> event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event. For more information about the order of events of a form, see [Order of Events in Windows Forms](/dotnet/desktop/winforms/order-of-events-in-windows-forms). For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). diff --git a/xml/System.Windows.Forms/GroupBoxRenderer.xml b/xml/System.Windows.Forms/GroupBoxRenderer.xml index d870d20344d..0d71e1249c9 100644 --- a/xml/System.Windows.Forms/GroupBoxRenderer.xml +++ b/xml/System.Windows.Forms/GroupBoxRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a group box control with or without visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%2A> method to draw a group box with a double border if visual styles are enabled. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%2A> method to draw a group box with a double border if visual styles are enabled. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> @@ -101,20 +101,20 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.GroupBoxState" /> values that specifies the visual state of the group box.</param> <summary>Draws a group box control in the specified state and bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.Windows.Forms.VisualStyles.GroupBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a group box with a double border. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.Windows.Forms.VisualStyles.GroupBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a group box with a double border. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -170,20 +170,20 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.GroupBoxState" /> values that specifies the visual state of the group box.</param> <summary>Draws a group box control in the specified state and bounds, with the specified text and font.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.VisualStyles.GroupBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a group box with a double border. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.DrawGroupBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Windows.Forms.VisualStyles.GroupBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a group box with a double border. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -241,11 +241,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.GroupBoxState" /> values that specifies the visual state of the group box.</param> <summary>Draws a group box control in the specified state and bounds, with the specified text, font, and color.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -297,11 +297,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.GroupBoxState" /> values that specifies the visual state of the group box.</param> <summary>Draws a group box control in the specified state and bounds, with the specified text, font, and text formatting.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -355,11 +355,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.GroupBoxState" /> values that specifies the visual state of the group box.</param> <summary>Draws a group box control in the specified state and bounds, with the specified text, font, color, and text formatting.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the group box with the current visual style. Otherwise, this method will draw the group box with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -469,19 +469,19 @@ <value> <see langword="true" /> if the application state is used to determine rendering style; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> is `true`, the <xref:System.Windows.Forms.GroupBoxRenderer> uses the setting from <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> to determine the rendering style. If <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> property to change whether a group box is rendered using visual styles. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> is `true`, the <xref:System.Windows.Forms.GroupBoxRenderer> uses the setting from <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> to determine the rendering style. If <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.GroupBoxRenderer.RenderMatchingApplicationState%2A> property to change whether a group box is rendered using visual styles. This code example is part of a larger example provided for the <xref:System.Windows.Forms.GroupBoxRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/HtmlDocument.xml b/xml/System.Windows.Forms/HtmlDocument.xml index c0583826bc0..8be6198f55d 100644 --- a/xml/System.Windows.Forms/HtmlDocument.xml +++ b/xml/System.Windows.Forms/HtmlDocument.xml @@ -29,50 +29,50 @@ <Docs> <summary>Provides top-level programmatic access to an HTML document hosted by the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument> provides a managed wrapper around Internet Explorer's document object, also known as the HTML Document Object Model (DOM). You obtain an instance of <xref:System.Windows.Forms.HtmlDocument> through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property of the <xref:System.Windows.Forms.WebBrowser> control. - - HTML tags inside of an HTML document can be nested inside one another. <xref:System.Windows.Forms.HtmlDocument> thus represents a document tree, whose children are instances of the <xref:System.Windows.Forms.HtmlElement> class. The following code example shows a simple HTML file. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument> provides a managed wrapper around Internet Explorer's document object, also known as the HTML Document Object Model (DOM). You obtain an instance of <xref:System.Windows.Forms.HtmlDocument> through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property of the <xref:System.Windows.Forms.WebBrowser> control. + + HTML tags inside of an HTML document can be nested inside one another. <xref:System.Windows.Forms.HtmlDocument> thus represents a document tree, whose children are instances of the <xref:System.Windows.Forms.HtmlElement> class. The following code example shows a simple HTML file. + ```html -<HTML> - <BODY> - <DIV name="Span1">Simple HTML Form</DIV> - <FORM> - <SPAN name="TextLabel">Enter Your Name:</SPAN> - <INPUT type="text" size="20" name="Text1"> - </FORM> - </BODY> -</HTML> -``` - - In this example, <xref:System.Windows.Forms.HtmlDocument> represents the entire document inside the `HTML` tags. The `BODY`, `DIV`, `FORM` and `SPAN` tags are represented by individual <xref:System.Windows.Forms.HtmlElement> objects. - - There are several ways you can access the elements in this tree. Use the <xref:System.Windows.Forms.HtmlDocument.Body%2A> property to access the `BODY` tag and all of its children. The <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> property gives you the <xref:System.Windows.Forms.HtmlElement> for the element on an HTML page that has user input focus. All elements within an HTML page can have a name; the <xref:System.Windows.Forms.HtmlDocument.All%2A> collection provides access to each <xref:System.Windows.Forms.HtmlElement> using its name as an index. <xref:System.Windows.Forms.HtmlDocument.GetElementsByTagName%2A> will return an <xref:System.Windows.Forms.HtmlElementCollection> of all <xref:System.Windows.Forms.HtmlElement> objects with a given HTML tag name, such as `DIV` or `TABLE`. <xref:System.Windows.Forms.HtmlDocument.GetElementById%2A> will return the single <xref:System.Windows.Forms.HtmlElement> corresponding to the unique ID that you supply. <xref:System.Windows.Forms.HtmlDocument.GetElementFromPoint%2A> will return the <xref:System.Windows.Forms.HtmlElement> that can be found on the screen at the supplied mouse pointer coordinates. - - You can also use the <xref:System.Windows.Forms.HtmlDocument.Forms%2A> and <xref:System.Windows.Forms.HtmlDocument.Images%2A> collection to iterate through elements that represent user input forms and graphics, respectively. - - <xref:System.Windows.Forms.HtmlDocument> is based on the unmanaged interfaces implemented by Internet Explorer's DHTML DOM: `IHTMLDocument`, `IHTMLDocument2`, `IHTMLDocument3`, and `IHTMLDocument4`. Only the most frequently used properties and methods on these unmanaged interfaces are exposed by <xref:System.Windows.Forms.HtmlDocument>. You can access all other properties and methods directly using the <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> property, which you can cast to the desired unmanaged interface pointer. - - An HTML document may contain frames, which are different windows inside of the <xref:System.Windows.Forms.WebBrowser> control. Each frame displays its own HTML page. The <xref:System.Windows.Forms.HtmlWindow.Frames%2A> collection is available through the <xref:System.Windows.Forms.HtmlDocument.Window%2A> property. You may also use the <xref:System.Windows.Forms.HtmlDocument.Window%2A> property to resize the displayed page, scroll the document, or display alerts and prompts to the user. - - <xref:System.Windows.Forms.HtmlDocument> exposes the most common events you would expect to handle when hosting HTML pages. For events not exposed directly by the interface, you can add a handler for the event using <xref:System.Windows.Forms.HtmlDocument.AttachEventHandler%2A>. - - HTML files may contain `SCRIPT` tags that encapsulate code written in one of the Active Scripting languages, such as JScript or VBScript. The <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> method provides for execution of properties and methods defined in a `SCRIPT` tag. - +<HTML> + <BODY> + <DIV name="Span1">Simple HTML Form</DIV> + <FORM> + <SPAN name="TextLabel">Enter Your Name:</SPAN> + <INPUT type="text" size="20" name="Text1"> + </FORM> + </BODY> +</HTML> +``` + + In this example, <xref:System.Windows.Forms.HtmlDocument> represents the entire document inside the `HTML` tags. The `BODY`, `DIV`, `FORM` and `SPAN` tags are represented by individual <xref:System.Windows.Forms.HtmlElement> objects. + + There are several ways you can access the elements in this tree. Use the <xref:System.Windows.Forms.HtmlDocument.Body%2A> property to access the `BODY` tag and all of its children. The <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> property gives you the <xref:System.Windows.Forms.HtmlElement> for the element on an HTML page that has user input focus. All elements within an HTML page can have a name; the <xref:System.Windows.Forms.HtmlDocument.All%2A> collection provides access to each <xref:System.Windows.Forms.HtmlElement> using its name as an index. <xref:System.Windows.Forms.HtmlDocument.GetElementsByTagName%2A> will return an <xref:System.Windows.Forms.HtmlElementCollection> of all <xref:System.Windows.Forms.HtmlElement> objects with a given HTML tag name, such as `DIV` or `TABLE`. <xref:System.Windows.Forms.HtmlDocument.GetElementById%2A> will return the single <xref:System.Windows.Forms.HtmlElement> corresponding to the unique ID that you supply. <xref:System.Windows.Forms.HtmlDocument.GetElementFromPoint%2A> will return the <xref:System.Windows.Forms.HtmlElement> that can be found on the screen at the supplied mouse pointer coordinates. + + You can also use the <xref:System.Windows.Forms.HtmlDocument.Forms%2A> and <xref:System.Windows.Forms.HtmlDocument.Images%2A> collection to iterate through elements that represent user input forms and graphics, respectively. + + <xref:System.Windows.Forms.HtmlDocument> is based on the unmanaged interfaces implemented by Internet Explorer's DHTML DOM: `IHTMLDocument`, `IHTMLDocument2`, `IHTMLDocument3`, and `IHTMLDocument4`. Only the most frequently used properties and methods on these unmanaged interfaces are exposed by <xref:System.Windows.Forms.HtmlDocument>. You can access all other properties and methods directly using the <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> property, which you can cast to the desired unmanaged interface pointer. + + An HTML document may contain frames, which are different windows inside of the <xref:System.Windows.Forms.WebBrowser> control. Each frame displays its own HTML page. The <xref:System.Windows.Forms.HtmlWindow.Frames%2A> collection is available through the <xref:System.Windows.Forms.HtmlDocument.Window%2A> property. You may also use the <xref:System.Windows.Forms.HtmlDocument.Window%2A> property to resize the displayed page, scroll the document, or display alerts and prompts to the user. + + <xref:System.Windows.Forms.HtmlDocument> exposes the most common events you would expect to handle when hosting HTML pages. For events not exposed directly by the interface, you can add a handler for the event using <xref:System.Windows.Forms.HtmlDocument.AttachEventHandler%2A>. + + HTML files may contain `SCRIPT` tags that encapsulate code written in one of the Active Scripting languages, such as JScript or VBScript. The <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> method provides for execution of properties and methods defined in a `SCRIPT` tag. + > [!NOTE] -> While most of the properties, methods, and events on <xref:System.Windows.Forms.HtmlDocument> have kept the same names as they have on the unmanaged DOM, some have been changed for consistency with the .NET Framework. - - - -## Examples - The following code example uses data from the Northwind database to create an `HTML TABLE` dynamically using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>. The <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. The code should be called after a document has been loaded. - +> While most of the properties, methods, and events on <xref:System.Windows.Forms.HtmlDocument> have kept the same names as they have on the unmanaged DOM, some have been changed for consistency with the .NET Framework. + + + +## Examples + The following code example uses data from the Northwind database to create an `HTML TABLE` dynamically using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>. The <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. The code should be called after a document has been loaded. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/docs/Web/API/Document">document - Web APIs</related> @@ -112,15 +112,15 @@ <summary>Provides the <see cref="T:System.Windows.Forms.HtmlElement" /> which currently has user input focus.</summary> <value>The <see cref="T:System.Windows.Forms.HtmlElement" /> which currently has user input focus.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the document has focus, but no element of the document has been given focus, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> returns the element corresponding to the `<BODY>` tag. - - If the document does not have focus, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> returns `null`. - - If the current element with input focus is a cell (`TD`) in an HTML `TABLE` tag, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> will return the element that contains the `TABLE` element. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the document has focus, but no element of the document has been given focus, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> returns the element corresponding to the `<BODY>` tag. + + If the document does not have focus, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> returns `null`. + + If the current element with input focus is a cell (`TD`) in an HTML `TABLE` tag, <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> will return the element that contains the `TABLE` element. + ]]></format> </remarks> <related type="Article" href="https://learn.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752581(v=vs.85)">activeElement Property</related> @@ -152,13 +152,13 @@ <summary>Gets or sets the <see cref="T:System.Drawing.Color" /> of a hyperlink when clicked by a user.</summary> <value>The <see cref="T:System.Drawing.Color" /> for active links.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A link is active when a user is clicking on it. Change this property to change the color of the link prior to navigation. - - The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A link is active when a user is clicking on it. Change this property to change the color of the link prior to navigation. + + The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752564.aspx">alinkColor Property</related> @@ -190,23 +190,23 @@ <summary>Gets an instance of <see cref="T:System.Windows.Forms.HtmlElementCollection" />, which stores all <see cref="T:System.Windows.Forms.HtmlElement" /> objects for the document.</summary> <value>The <see cref="T:System.Windows.Forms.HtmlElementCollection" /> of all elements in the document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.HtmlDocument.All%2A> collection provides random access to any element in the HTML document, regardless of its position in the document tree. Use it to access any element in an HTML document by name, ID, or index. You may also iterate over all of the elements within a document. - - Some elements, such as `HEAD` and `TITLE`, will never have names associated with them. All other elements will have names only if the author of the HTML file assigned them. You can access elements without names by ID or index. - - You cannot add elements directly to the <xref:System.Windows.Forms.HtmlDocument.All%2A> collection, because all elements in an HTML file outside of the `HTML` tag must have a parent element. Use the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method or the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property on <xref:System.Windows.Forms.HtmlElement> to add new elements to the tree. - - - -## Examples - The following code example iterates through all of the elements in a document and sets `Enabled=True`, enabling any elements that may have been disabled by default to prevent user input while the document was loading. The code example requires that your application contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.HtmlDocument.All%2A> collection provides random access to any element in the HTML document, regardless of its position in the document tree. Use it to access any element in an HTML document by name, ID, or index. You may also iterate over all of the elements within a document. + + Some elements, such as `HEAD` and `TITLE`, will never have names associated with them. All other elements will have names only if the author of the HTML file assigned them. You can access elements without names by ID or index. + + You cannot add elements directly to the <xref:System.Windows.Forms.HtmlDocument.All%2A> collection, because all elements in an HTML file outside of the `HTML` tag must have a parent element. Use the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method or the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property on <xref:System.Windows.Forms.HtmlElement> to add new elements to the tree. + + + +## Examples + The following code example iterates through all of the elements in a document and sets `Enabled=True`, enabling any elements that may have been disabled by default to prevent user input while the document was loading. The code example requires that your application contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752582.aspx">all Property</related> @@ -243,13 +243,13 @@ <param name="eventHandler">The managed code that handles the event.</param> <summary>Adds an event handler for the named HTML DOM event.</summary> <remarks> - <format type="text/markdown">< and the IHTMLDocument interfaces: [IHTMLDocument](https://go.microsoft.com/fwlink/?LinkId=104882), [IHTMLDocument2](https://go.microsoft.com/fwlink/?LinkId=104884), [IHTMLDocument3](https://go.microsoft.com/fwlink/?LinkId=104886), [IHTMLDocument4](https://go.microsoft.com/fwlink/?LinkId=104887), [IHTMLDocument5](https://go.microsoft.com/fwlink/?LinkId=104888). - + <format type="text/markdown">< and the IHTMLDocument interfaces: [IHTMLDocument](https://go.microsoft.com/fwlink/?LinkId=104882), [IHTMLDocument2](https://go.microsoft.com/fwlink/?LinkId=104884), [IHTMLDocument3](https://go.microsoft.com/fwlink/?LinkId=104886), [IHTMLDocument4](https://go.microsoft.com/fwlink/?LinkId=104887), [IHTMLDocument5](https://go.microsoft.com/fwlink/?LinkId=104888). + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752535.aspx">attachEvent Method</related> @@ -281,13 +281,13 @@ <summary>Gets or sets the background color of the HTML document.</summary> <value>The <see cref="T:System.Drawing.Color" /> of the document's background.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument.BackColor%2A> will display when no other element occupies that area of the screen. - - The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument.BackColor%2A> will display when no other element occupies that area of the screen. + + The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlDocument.ForeColor" /> @@ -329,25 +329,25 @@ <summary>Gets the <see cref="T:System.Windows.Forms.HtmlElement" /> for the <c>BODY</c> tag.</summary> <value>The <see cref="T:System.Windows.Forms.HtmlElement" /> object for the <c>BODY</c> tag.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An HTML document is split into two major sections: - -- `HEAD`, which contains the document's title, any document meta-data, and `SCRIPT` elements. - -- `BODY`, which contains all of the elements involved in the on-screen appearance of the document. - - There is no equivalent `Head` property on <xref:System.Windows.Forms.HtmlDocument>. To obtain the `HEAD` element, use <xref:System.Windows.Forms.HtmlDocument.GetElementsByTagName%2A>. - - - -## Examples - The following code example creates a new `DIV` element and appends it to the bottom of the document using the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An HTML document is split into two major sections: + +- `HEAD`, which contains the document's title, any document meta-data, and `SCRIPT` elements. + +- `BODY`, which contains all of the elements involved in the on-screen appearance of the document. + + There is no equivalent `Head` property on <xref:System.Windows.Forms.HtmlDocument>. To obtain the `HEAD` element, use <xref:System.Windows.Forms.HtmlDocument.GetElementsByTagName%2A>. + + + +## Examples + The following code example creates a new `DIV` element and appends it to the bottom of the document using the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet13"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752585.aspx">body Property</related> @@ -385,19 +385,19 @@ <Docs> <summary>Occurs when the user clicks anywhere on the document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example detects a click on the document, finds the element, and uses <xref:System.Windows.Forms.HtmlElement.ScrollIntoView%2A> to align the element with the top of the Web page. - + <format type="text/markdown"><. + + + +## Examples + The following code example detects a click on the document, finds the element, and uses <xref:System.Windows.Forms.HtmlElement.ScrollIntoView%2A> to align the element with the top of the Web page. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752611.aspx">onclick Event</related> @@ -435,18 +435,18 @@ <Docs> <summary>Occurs when the user requests to display the document's context menu.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, if you right-click your mouse on a document or an element in a document, it will display a default context menu particular to the element. Use this event to cancel the display of the context menu and display one of your own. - - - -## Examples - The following code example captures the <xref:System.Windows.Forms.HtmlDocument.ContextMenuShowing> event and uses it to display a <xref:System.Windows.Forms.ContextMenuStrip>. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, if you right-click your mouse on a document or an element in a document, it will display a default context menu particular to the element. Use this event to cancel the display of the context menu and display one of your own. + + + +## Examples + The following code example captures the <xref:System.Windows.Forms.HtmlDocument.ContextMenuShowing> event and uses it to display a <xref:System.Windows.Forms.ContextMenuStrip>. + + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: + ]]></format> </remarks> <related type="Article" href="https://developer.mozilla.org/en-us/docs/web/api/element/contextmenu_event">oncontextmenu Event</related> @@ -478,25 +478,25 @@ <summary>Gets or sets the HTTP cookies associated with this document.</summary> <value>A <see cref="T:System.String" /> containing a list of cookies, with each cookie separated by a semicolon.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property of <xref:System.Windows.Forms.HtmlDocument> exposes all cookies set for a Web page. - - A *cookie* is an arbitrary name/value pair associated with a given Web page. Web developers use cookies to track when users visit or return to a Web site. A cookie is composed of multiple parts, called cookie crumbs, that determine the following: - -- The document set to which the cookie applies; its domain and path. - -- The name and value of the cookie. - -- The expiration date of the cookie. - -- Whether the cookie can only be sent using a secure connection. - - The <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property may contain multiple cookies. - - You can only use the <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property to set one cookie at a time. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property of <xref:System.Windows.Forms.HtmlDocument> exposes all cookies set for a Web page. + + A *cookie* is an arbitrary name/value pair associated with a given Web page. Web developers use cookies to track when users visit or return to a Web site. A cookie is composed of multiple parts, called cookie crumbs, that determine the following: + +- The document set to which the cookie applies; its domain and path. + +- The name and value of the cookie. + +- The expiration date of the cookie. + +- Whether the cookie can only be sent using a secure connection. + + The <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property may contain multiple cookies. + + You can only use the <xref:System.Windows.Forms.HtmlDocument.Cookie%2A> property to set one cookie at a time. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752569.aspx">cookie Property</related> @@ -533,25 +533,25 @@ <summary>Creates a new <see langword="HtmlElement" /> of the specified HTML tag type.</summary> <returns>A new element of the specified tag type.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - `elementTag` may be any of the supported HTML tags in Internet Explorer except for `FRAME` and `IFRAME`. - - <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> returns an element unattached to the current document tree. To add the element to the document, use either the <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> or <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> methods. - - This method will not affect the state of an existing document's source code when you use the <xref:System.Windows.Forms.WebBrowser> control's **View Source** context menu command or the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> and <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> properties of the <xref:System.Windows.Forms.WebBrowser> control. - - When you create new elements with <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>, you will not be able to set certain properties, such as `Name`. In cases where you need to set the Name attribute, assign them as HTML to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of another object in the document. - - - -## Examples - The following code example uses data from the Northwind database to create an HTML table using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>. The <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control called `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + `elementTag` may be any of the supported HTML tags in Internet Explorer except for `FRAME` and `IFRAME`. + + <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> returns an element unattached to the current document tree. To add the element to the document, use either the <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> or <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> methods. + + This method will not affect the state of an existing document's source code when you use the <xref:System.Windows.Forms.WebBrowser> control's **View Source** context menu command or the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> and <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> properties of the <xref:System.Windows.Forms.WebBrowser> control. + + When you create new elements with <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>, you will not be able to set certain properties, such as `Name`. In cases where you need to set the Name attribute, assign them as HTML to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of another object in the document. + + + +## Examples + The following code example uses data from the Northwind database to create an HTML table using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>. The <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control called `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752570.aspx">createElement Method</related> @@ -583,11 +583,11 @@ <summary>Gets the encoding used by default for the current document.</summary> <value>The <see cref="T:System.String" /> representing the encoding that the browser uses when the page is first displayed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The default encoding is the encoding the managed HTML Document Object Model (DOM) will attempt to use when the page is initially loaded. This encoding is derived either from Internet Explorer's **Encoding** settings, or from a `META` tag embedded within the page. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The default encoding is the encoding the managed HTML Document Object Model (DOM) will attempt to use when the page is initially loaded. This encoding is derived either from Internet Explorer's **Encoding** settings, or from a `META` tag embedded within the page. + ]]></format> </remarks> <related type="Article" href="https://developer.mozilla.org/en-us/docs/web/api/document">defaultCharset Property</related> @@ -653,15 +653,15 @@ <summary>Gets or sets the string describing the domain of this document for security purposes.</summary> <value>A valid domain.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, two Web pages in different frames are prevented from accessing each other's content using script; even `www.microsoft.com` and `learn.microsoft.com` are, in this instance, considered different domains. To enable cross-frame scripting for pages from the same top-level domain, you can assign a new value to the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property. In the previous URL example, setting <xref:System.Windows.Forms.HtmlDocument.Domain%2A> to microsoft.com would allow both pages to communicate with one another. - - Strings assigned to the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property must be valid top-level domains. In the previous URL example, you can set <xref:System.Windows.Forms.HtmlDocument.Domain%2A> to microsoft.com, but not to .com, which would enable any page on the Internet to script a page's contents. - - You cannot use the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property to enable cross-frame scripting for pages accessed using two different protocols. If one frame in your page comes from a Web server (the http:// protocol) and another comes from the file system (the file://) protocol, they will not be able to communicate with one another regardless of the value of the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, two Web pages in different frames are prevented from accessing each other's content using script; even `www.microsoft.com` and `learn.microsoft.com` are, in this instance, considered different domains. To enable cross-frame scripting for pages from the same top-level domain, you can assign a new value to the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property. In the previous URL example, setting <xref:System.Windows.Forms.HtmlDocument.Domain%2A> to microsoft.com would allow both pages to communicate with one another. + + Strings assigned to the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property must be valid top-level domains. In the previous URL example, you can set <xref:System.Windows.Forms.HtmlDocument.Domain%2A> to microsoft.com, but not to .com, which would enable any page on the Internet to script a page's contents. + + You cannot use the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property to enable cross-frame scripting for pages accessed using two different protocols. If one frame in your page comes from a Web server (the http:// protocol) and another comes from the file system (the file://) protocol, they will not be able to communicate with one another regardless of the value of the <xref:System.Windows.Forms.HtmlDocument.Domain%2A> property. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The argument for the <c>Domain</c> property must be a valid domain name using Domain Name System (DNS) conventions.</exception> @@ -701,19 +701,19 @@ <summary>Gets the unmanaged interface pointer for this <see cref="T:System.Windows.Forms.HtmlDocument" />.</summary> <value>An <see cref="T:System.Object" /> representing an <c>IDispatch</c> pointer to the unmanaged document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument> is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLDocument2`, you can use this object to query for them. - - To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `IDispatch::Invoke` method. - -## Examples - The following code example casts the <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> to an `IHTMLDocument2` pointer and displays the value of the `lastModified` property, which tells when the owner of the document last updated its contents. The code example requires that you have a <xref:System.Windows.Forms.Button> on your form named `Button6`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument> is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLDocument2`, you can use this object to query for them. + + To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `IDispatch::Invoke` method. + +## Examples + The following code example casts the <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> to an `IHTMLDocument2` pointer and displays the value of the `lastModified` property, which tells when the owner of the document last updated its contents. The code example requires that you have a <xref:System.Windows.Forms.Button> on your form named `Button6`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <related type="Article" href="https://learn.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752574(v=vs.85)">IHTMLDocument2 Interface</related> @@ -817,14 +817,14 @@ <param name="value">The value to assign using the command. Not applicable for all commands.</param> <summary>Executes the specified command against the document.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + > [!NOTE] -> Certain commands, such as copy, have return values. In the current implementation of <xref:System.Windows.Forms.HtmlDocument.ExecCommand%2A>, you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> reference instead. - +> Certain commands, such as copy, have return values. In the current implementation of <xref:System.Windows.Forms.HtmlDocument.ExecCommand%2A>, you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a <xref:System.Windows.Forms.HtmlDocument.DomDocument%2A> reference instead. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/ms536419.aspx">execCommand Method</related> @@ -863,11 +863,11 @@ <Docs> <summary>Sets user input focus on the current document.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Calling <xref:System.Windows.Forms.HtmlDocument.Focus%2A> will set focus on the <xref:System.Windows.Forms.WebBrowser> control, if the control currently does not have focus. If the document is hosted inside of a `FRAME`, this method will put focus on that `FRAME` within the `FRAMESET`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Calling <xref:System.Windows.Forms.HtmlDocument.Focus%2A> will set focus on the <xref:System.Windows.Forms.WebBrowser> control, if the control currently does not have focus. If the document is hosted inside of a `FRAME`, this method will put focus on that `FRAME` within the `FRAMESET`. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752527.aspx">focus Method</related> @@ -937,21 +937,21 @@ <Docs> <summary>Occurs before focus is given to the document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.Focusing> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.Focusing> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.Focusing> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.Focusing> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet424"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet424"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet424"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752520.aspx">onfocusin Event</related> @@ -983,11 +983,11 @@ <summary>Gets or sets the text color for the document.</summary> <value>The color of the text in the document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Drawing.Color><xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Drawing.Color><xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlDocument.BackColor" /> @@ -1022,23 +1022,23 @@ <summary>Gets a collection of all of the <c><FORM></c> elements in the document.</summary> <value>An <see cref="T:System.Windows.Forms.HtmlElementCollection" /> of the <c><FORM></c> elements within the document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An HTML document may have one or more `FORM` elements with input fields for submitting data back to a server. - - You can programmatically submit a `FORM` by obtaining its <xref:System.Windows.Forms.HtmlElement> and calling its `Submit` method using the <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> method. - - To add a new `FORM` to a document, you can either create a new `FORM` tag as a string, and assign it to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of an element previously added to the HTML DOM; or you can use the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method, set its properties using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A>, and add it as a child of an existing element using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A>. - - - -## Examples - The following code example iterates through all of the `Form` elements on a Web page and clears all user input, setting the forms back to their default values. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An HTML document may have one or more `FORM` elements with input fields for submitting data back to a server. + + You can programmatically submit a `FORM` by obtaining its <xref:System.Windows.Forms.HtmlElement> and calling its `Submit` method using the <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> method. + + To add a new `FORM` to a document, you can either create a new `FORM` tag as a string, and assign it to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of an element previously added to the HTML DOM; or you can use the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method, set its properties using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A>, and add it as a child of an existing element using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A>. + + + +## Examples + The following code example iterates through all of the `Form` elements on a Web page and clears all user input, setting the forms back to their default values. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet4"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752591.aspx">forms Property</related> @@ -1076,19 +1076,19 @@ <summary>Retrieves a single <see cref="T:System.Windows.Forms.HtmlElement" /> using the element's <c>ID</c> attribute as a search key.</summary> <returns>Returns the first object with the same <c>ID</c> attribute as the specified value, or <see langword="null" /> if the <paramref name="id" /> cannot be found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If there are multiple elements in the document with the same ID value, <xref:System.Windows.Forms.HtmlDocument.GetElementById%2A> will return the first one it finds. - - - -## Examples - The following code example retrieves a named `TABLE` from a document, counts up the number of rows, and displays the result in the Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> control in your project named `WebBrowser1`, and that you have loaded a Web page with a `TABLE` whose `ID` attribute is `Table1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If there are multiple elements in the document with the same ID value, <xref:System.Windows.Forms.HtmlDocument.GetElementById%2A> will return the first one it finds. + + + +## Examples + The following code example retrieves a named `TABLE` from a document, counts up the number of rows, and displays the result in the Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> control in your project named `WebBrowser1`, and that you have loaded a Web page with a `TABLE` whose `ID` attribute is `Table1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet5"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752543.aspx">getElementById Method</related> @@ -1125,19 +1125,19 @@ <summary>Retrieves the HTML element located at the specified client coordinates.</summary> <returns>The <see cref="T:System.Windows.Forms.HtmlElement" /> at the specified screen location in the document.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument.GetElementFromPoint%2A> uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the <xref:System.Windows.Forms.HtmlWindow.Position%2A> property. - - - -## Examples - The following code example detects a click on the document, finds the element, and uses <xref:System.Windows.Forms.HtmlElement.ScrollIntoView%2A> to align the element with the top of the Web page. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument.GetElementFromPoint%2A> uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the <xref:System.Windows.Forms.HtmlWindow.Position%2A> property. + + + +## Examples + The following code example detects a click on the document, finds the element, and uses <xref:System.Windows.Forms.HtmlElement.ScrollIntoView%2A> to align the element with the top of the Web page. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752576.aspx">elementFromPoint Method</related> @@ -1173,14 +1173,14 @@ <summary>Retrieve a collection of elements with the specified HTML tag.</summary> <returns>The collection of elements who tag name is equal to the <paramref name="tagName" /> argument.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - HTML pages often use the `META` tag to embed arbitrary information about the document. The following HTML code example retrieves all of the `META` tags within an HTML document, finds the `META` tag with the name `Description`, and displays it to the user. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Examples + HTML pages often use the `META` tag to embed arbitrary information about the document. The following HTML code example retrieves all of the `META` tags within an HTML document, finds the `META` tag with the name `Description`, and displays it to the user. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752545.aspx">getElementsByTagName Method</related> @@ -1241,21 +1241,21 @@ <summary>Gets a collection of all image tags in the document.</summary> <value>A collection of <see cref="T:System.Windows.Forms.HtmlElement" /> objects, one for each IMG tag in the document. Elements are returned from the collection in source order.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument.Images%2A> returns a collection of <xref:System.Windows.Forms.HtmlElement> objects. To access attributes, such as `ALT` and `SRC`, that are not directly exposed by <xref:System.Windows.Forms.HtmlElement>, use the <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> method. - - To add a new image to a document, either create a new `IMG` tag as a string, and assign it to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of an element previously added to the HTML DOM; or use the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method, set its properties using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A>, and add it as a child of an existing element using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A>. - - - -## Examples - The following code example examines the `ALT` attribute of all of the images in the document, and sets a default `ALT` attribute if a value is not already set. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument.Images%2A> returns a collection of <xref:System.Windows.Forms.HtmlElement> objects. To access attributes, such as `ALT` and `SRC`, that are not directly exposed by <xref:System.Windows.Forms.HtmlElement>, use the <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> method. + + To add a new image to a document, either create a new `IMG` tag as a string, and assign it to the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property of an element previously added to the HTML DOM; or use the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method, set its properties using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A>, and add it as a child of an existing element using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A>. + + + +## Examples + The following code example examines the `ALT` attribute of all of the images in the document, and sets a default `ALT` attribute if a value is not already set. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet8"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752593.aspx">images Property</related> @@ -1269,28 +1269,28 @@ <Docs> <summary>Executes an Active Scripting function defined in an HTML page.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example executes the contents of a script in a Web page. The code example requires that you have loaded the following Web page. - -``` -<HTML> -<SCRIPT> -function test(name, address) { -window.alert("Name is " + name + "; address is " + address); -} -</SCRIPT> - -<BODY> -</BODY> -</HTML> - -``` - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example executes the contents of a script in a Web page. The code example requires that you have loaded the following Web page. + +``` +<HTML> +<SCRIPT> +function test(name, address) { +window.alert("Name is " + name + "; address is " + address); +} +</SCRIPT> + +<BODY> +</BODY> +</HTML> + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: + ]]></format> </remarks> </Docs> @@ -1332,56 +1332,56 @@ window.alert("Name is " + name + "; address is " + address); <summary>Executes an Active Scripting function defined in an HTML page.</summary> <returns>The object returned by the Active Scripting call.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The underlying type of the object returned by <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling <xref:System.Object.GetType%2A> and using <xref:System.Type.InvokeMember%2A>.) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. - - You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript. - - The <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. - -## Examples - The following code example executes the contents of a script in a Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> in your application called `WebBrowser1`, and that you have loaded the following Web page. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The underlying type of the object returned by <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling <xref:System.Object.GetType%2A> and using <xref:System.Type.InvokeMember%2A>.) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. + + You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript. + + The <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. + +## Examples + The following code example executes the contents of a script in a Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> in your application called `WebBrowser1`, and that you have loaded the following Web page. + ```html -<HTML> - - <HEAD> - <TITLE>Invoke Script Sample</TITLE> - - <SCRIPT> - function MyObject() { - this.Data = "Data for my private object."; - } - // Return a string. - function test() { - return("This is a test."); - } - // Return a JScript object. - function testJScriptObject() { - return(new(MyObject)); - } - // Return a DOM element. - function testElement() { - return(div1); - } - </SCRIPT> - </HEAD> - - <BODY> - - <DIV id="div1"> - </DIV> - - </BODY> - -</HTML> -``` - +<HTML> + + <HEAD> + <TITLE>Invoke Script Sample</TITLE> + + <SCRIPT> + function MyObject() { + this.Data = "Data for my private object."; + } + // Return a string. + function test() { + return("This is a test."); + } + // Return a JScript object. + function testJScriptObject() { + return(new(MyObject)); + } + // Return a DOM element. + function testElement() { + return(div1); + } + </SCRIPT> + </HEAD> + + <BODY> + + <DIV id="div1"> + </DIV> + + </BODY> + +</HTML> +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet12"::: + ]]></format> </remarks> </Docs> @@ -1426,35 +1426,35 @@ window.alert("Name is " + name + "; address is " + address); <summary>Executes an Active Scripting function defined in an HTML page.</summary> <returns>The object returned by the Active Scripting call.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The underlying type of the object returned by <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling <xref:System.Object.GetType%2A> and using <xref:System.Type.InvokeMember%2A>.) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. - - You may call any function written in any Active Scripting language installed on the user's machine, including JScript and VBScript. - - This method will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. - -## Examples - The following code example executes the contents of a script in a Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> in your application called `WebBrowser1`, and that you have loaded the following Web page. - -``` -<HTML> - <SCRIPT> - function test(name, address) { - window.alert("Name is " + name + "; address is " + address); - } - </SCRIPT> - - <BODY> - </BODY> -</HTML> - -``` - + <format type="text/markdown"><![CDATA[ + +## Remarks + The underlying type of the object returned by <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A> will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling <xref:System.Object.GetType%2A> and using <xref:System.Type.InvokeMember%2A>.) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. + + You may call any function written in any Active Scripting language installed on the user's machine, including JScript and VBScript. + + This method will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. + +## Examples + The following code example executes the contents of a script in a Web page. The code example requires that you have a <xref:System.Windows.Forms.WebBrowser> in your application called `WebBrowser1`, and that you have loaded the following Web page. + +``` +<HTML> + <SCRIPT> + function test(name, address) { + window.alert("Name is " + name + "; address is " + address); + } + </SCRIPT> + + <BODY> + </BODY> +</HTML> + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: + ]]></format> </remarks> </Docs> @@ -1485,11 +1485,11 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets or sets the color of hyperlinks.</summary> <value>The color for hyperlinks in the current document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Drawing.Color> type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlDocument.ForeColor" /> @@ -1524,13 +1524,13 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets a list of all the hyperlinks within this HTML document.</summary> <value>An <see cref="T:System.Windows.Forms.HtmlElementCollection" /> of <see cref="T:System.Windows.Forms.HtmlElement" /> objects.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This collection will contain all links created using the `A`, `LINK`, and `AREA` tags in HTML. - - The <xref:System.Windows.Forms.HtmlElement> objects contained within this collection encapsulate the unmanaged `IHTMLLinkElement` interface. To access the properties of the underlying interface safely, use the <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This collection will contain all links created using the `A`, `LINK`, and `AREA` tags in HTML. + + The <xref:System.Windows.Forms.HtmlElement> objects contained within this collection encapsulate the unmanaged `IHTMLLinkElement` interface. To access the properties of the underlying interface safely, use the <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> method. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752595.aspx">links Property</related> @@ -1568,21 +1568,21 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs while focus is leaving a control.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.LosingFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.LosingFocus> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.LosingFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.LosingFocus> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet425"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet425"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet425"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752521.aspx">onfocusout Event</related> @@ -1620,23 +1620,23 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when the user clicks the left mouse button.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseDown> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseDown> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet426"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet426"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet426"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752619.aspx">onmousedown Event</related> @@ -1674,21 +1674,21 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when the mouse is no longer hovering over the document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseLeave> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseLeave> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet427"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet427"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet427"::: + ]]></format> </remarks> <related type="Article" href="https://developer.mozilla.org/en-us/docs/web/api/element/mouseout_event">onmouseout Event</related> @@ -1726,21 +1726,21 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when the mouse is moved over the document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseMove> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseMove> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseMove> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseMove> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet428"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet428"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet428"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752620.aspx">onmousemove Event</related> @@ -1778,21 +1778,21 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when the mouse is moved over the document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseOver> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseOver> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet429"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet429"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet429"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752622.aspx">onmouseover Event</related> @@ -1830,21 +1830,21 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when the user releases the left mouse button.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseUp> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlDocument.MouseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlDocument> named `HtmlDocument1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlDocument.MouseUp> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet430"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet430"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet430"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752623.aspx">onmouseup Event</related> @@ -1955,21 +1955,21 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets a new <see cref="T:System.Windows.Forms.HtmlDocument" /> to use with the <see cref="M:System.Windows.Forms.HtmlDocument.Write(System.String)" /> method.</summary> <returns>A new document for writing.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A> will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in <xref:System.Windows.Forms.WebBrowser> to be raised. - - <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A> always creates a new document in the current window. To open a document in a new window, use the <xref:System.Windows.Forms.HtmlWindow.Open%2A> method on the <xref:System.Windows.Forms.HtmlWindow> class. - - - -## Examples - The following code example prepares the DOM for writing and writes a new document using the <xref:System.Windows.Forms.HtmlDocument.Write%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A> will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in <xref:System.Windows.Forms.WebBrowser> to be raised. + + <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A> always creates a new document in the current window. To open a document in a new window, use the <xref:System.Windows.Forms.HtmlWindow.Open%2A> method on the <xref:System.Windows.Forms.HtmlWindow> class. + + + +## Examples + The following code example prepares the DOM for writing and writes a new document using the <xref:System.Windows.Forms.HtmlDocument.Write%2A> method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752628.aspx">open Method</related> @@ -2002,13 +2002,13 @@ window.alert("Name is " + name + "; address is " + address); <value> <see langword="true" /> if text renders from right to left; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> will not have any value unless it has been set explicitly, either in code or in HTML. - - Unlike the <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> property on Windows Forms controls, <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> on the managed HTML DOM will not affect the direction of Latin text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> will not have any value unless it has been set explicitly, either in code or in HTML. + + Unlike the <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> property on Windows Forms controls, <xref:System.Windows.Forms.HtmlDocument.RightToLeft%2A> on the managed HTML DOM will not affect the direction of Latin text. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752540.aspx">dir Property</related> @@ -2046,20 +2046,20 @@ window.alert("Name is " + name + "; address is " + address); <Docs> <summary>Occurs when navigation to another Web page is halted.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example resets the status bar on a Windows Forms application when the `Stop` event has occurred. The code example requires that you have a <xref:System.Windows.Forms.StatusBar> control named `StatusBar1` in your application. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: - + <format type="text/markdown"><. + + + +## Examples + The following code example resets the status bar on a Windows Forms application when the `Stop` event has occurred. The code example requires that you have a <xref:System.Windows.Forms.StatusBar> control named `StatusBar1` in your application. + + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752561.aspx">onstop Event</related> @@ -2091,21 +2091,21 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets or sets the text value of the <c><TITLE></c> tag in the current HTML document.</summary> <value>The title of the current document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.HtmlDocument.Title%2A> property to identify the document by way of a human-readable name. - - Changes to this property will also reflect in the <xref:System.Windows.Forms.WebBrowser.DocumentTitle%2A> property of the <xref:System.Windows.Forms.WebBrowser> control. - - - -## Examples - The following code example creates an HTML hyperlink to the current document using the URL of the document as the link's location and the title of the document as the link text. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.HtmlDocument.Title%2A> property to identify the document by way of a human-readable name. + + Changes to this property will also reflect in the <xref:System.Windows.Forms.WebBrowser.DocumentTitle%2A> property of the <xref:System.Windows.Forms.WebBrowser> control. + + + +## Examples + The following code example creates an HTML hyperlink to the current document using the URL of the document as the link's location and the title of the document as the link text. The code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" /> @@ -2145,11 +2145,11 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets the URL describing the location of this document.</summary> <value>A <see cref="T:System.Uri" /> representing this document's URL.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is read-only. To navigate to a new document, use the <xref:System.Windows.Forms.WebBrowser.Url%2A> property on the <xref:System.Windows.Forms.WebBrowser> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is read-only. To navigate to a new document, use the <xref:System.Windows.Forms.WebBrowser.Url%2A> property on the <xref:System.Windows.Forms.WebBrowser> control. + ]]></format> </remarks> </Docs> @@ -2180,11 +2180,11 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets or sets the Color of links to HTML pages that the user has already visited.</summary> <value>The color of visited links.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `Color` type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `Color` type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlDocument.BackColor" /> @@ -2226,11 +2226,11 @@ window.alert("Name is " + name + "; address is " + address); <summary>Gets the <see cref="T:System.Windows.Forms.HtmlWindow" /> associated with this document.</summary> <value>The window for this document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - All HTML documents have an HTML DOM object called a window, which can be used to manipulate the screen size of the document and open new windows, as well as access other important objects, such as an <xref:System.Windows.Forms.HtmlHistory>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + All HTML documents have an HTML DOM object called a window, which can be used to manipulate the screen size of the document and open new windows, as well as access other important objects, such as an <xref:System.Windows.Forms.HtmlHistory>. + ]]></format> </remarks> <related type="Article" href="https://msdn.microsoft.com/library/aa752599.aspx">parentWindow Property</related> @@ -2265,21 +2265,21 @@ window.alert("Name is " + name + "; address is " + address); <param name="text">The HTML text to write into the document.</param> <summary>Writes a new HTML page.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - All calls to <xref:System.Windows.Forms.HtmlDocument.Write%2A> should be preceded by a call to <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A>, which will clear the current document and all of its variables. Your calls to <xref:System.Windows.Forms.HtmlDocument.Write%2A> will create a new HTML document in its place. To change only a specific portion of the document, obtain the appropriate <xref:System.Windows.Forms.HtmlElement> and set its <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property. - - It is recommended that you write an entire valid HTML document using the <xref:System.Windows.Forms.HtmlDocument.Write%2A> method, including `HTML` and `BODY` tags. However, if you write just HTML elements, the Document Object Model (DOM) will supply these elements for you. - - - -## Examples - The following code example opens a new <xref:System.Windows.Forms.HtmlDocument> and writes in a new HTML file. - + <format type="text/markdown"><![CDATA[ + +## Remarks + All calls to <xref:System.Windows.Forms.HtmlDocument.Write%2A> should be preceded by a call to <xref:System.Windows.Forms.HtmlDocument.OpenNew%2A>, which will clear the current document and all of its variables. Your calls to <xref:System.Windows.Forms.HtmlDocument.Write%2A> will create a new HTML document in its place. To change only a specific portion of the document, obtain the appropriate <xref:System.Windows.Forms.HtmlElement> and set its <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property. + + It is recommended that you write an entire valid HTML document using the <xref:System.Windows.Forms.HtmlDocument.Write%2A> method, including `HTML` and `BODY` tags. However, if you write just HTML elements, the Document Object Model (DOM) will supply these elements for you. + + + +## Examples + The following code example opens a new <xref:System.Windows.Forms.HtmlDocument> and writes in a new HTML file. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.HtmlDocument.OpenNew(System.Boolean)" /> diff --git a/xml/System.Windows.Forms/HtmlElement.xml b/xml/System.Windows.Forms/HtmlElement.xml index eb75e6b8998..297d155831a 100644 --- a/xml/System.Windows.Forms/HtmlElement.xml +++ b/xml/System.Windows.Forms/HtmlElement.xml @@ -29,27 +29,27 @@ <Docs> <summary>Represents an HTML element inside of a Web page.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement> represents any possible type of element in an HTML document, such as `BODY`, `TABLE`, and `FORM`, among others. The class exposes the most common properties you can expect to find on all elements. - - Most elements can have *child elements*: other HTML elements that are placed underneath them. Use the <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> property to test whether a given element has children, and the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection to iterate through them. The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property returns the <xref:System.Windows.Forms.HtmlElement> in which the current element is nested. - - You often need access to attributes, properties, and methods on the underlying element that are not directly exposed by <xref:System.Windows.Forms.HtmlElement>, such as the `SRC` attribute on an `IMG` element or the `Submit` method on a `FORM`. The <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> methods enable you to retrieve and alter any attribute or property on a specific element, while <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> provides access to any methods not exposed in the managed Document Object Model (DOM). If your application has unmanaged code permission, you can also access unexposed properties and methods with the <xref:System.Windows.Forms.HtmlElement.DomElement%2A> attribute. - - Use the <xref:System.Windows.Forms.HtmlElement.TagName%2A> property to test whether an element is of a specific type. - - Any HTML document can be modified at run time. You can create new <xref:System.Windows.Forms.HtmlElement> objects with the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method of <xref:System.Windows.Forms.HtmlDocument>, and add them to another element using the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> methods. You can also create the elements as HTML tags and assign them to an existing element's <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property. - - - -## Examples - The following code example shows how to examine an arbitrary HTML document and derive a string describing the HTML elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. This code example requires that your application hosts a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement> represents any possible type of element in an HTML document, such as `BODY`, `TABLE`, and `FORM`, among others. The class exposes the most common properties you can expect to find on all elements. + + Most elements can have *child elements*: other HTML elements that are placed underneath them. Use the <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> property to test whether a given element has children, and the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection to iterate through them. The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property returns the <xref:System.Windows.Forms.HtmlElement> in which the current element is nested. + + You often need access to attributes, properties, and methods on the underlying element that are not directly exposed by <xref:System.Windows.Forms.HtmlElement>, such as the `SRC` attribute on an `IMG` element or the `Submit` method on a `FORM`. The <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> methods enable you to retrieve and alter any attribute or property on a specific element, while <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> provides access to any methods not exposed in the managed Document Object Model (DOM). If your application has unmanaged code permission, you can also access unexposed properties and methods with the <xref:System.Windows.Forms.HtmlElement.DomElement%2A> attribute. + + Use the <xref:System.Windows.Forms.HtmlElement.TagName%2A> property to test whether an element is of a specific type. + + Any HTML document can be modified at run time. You can create new <xref:System.Windows.Forms.HtmlElement> objects with the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method of <xref:System.Windows.Forms.HtmlDocument>, and add them to another element using the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> methods. You can also create the elements as HTML tags and assign them to an existing element's <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property. + + + +## Examples + The following code example shows how to examine an arbitrary HTML document and derive a string describing the HTML elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. This code example requires that your application hosts a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=104876">IHTMLElement Interface</related> @@ -90,13 +90,13 @@ <summary>Gets an <see cref="T:System.Windows.Forms.HtmlElementCollection" /> of all elements underneath the current element.</summary> <value>A collection of all elements that are direct or indirect children of the current element. If the current element is a <c>TABLE</c>, for example, <see cref="P:System.Windows.Forms.HtmlElement.All" /> will return every <c>TH</c>, <c>TR</c>, and <c>TD</c> element within the table, as well as any other elements, such as <c>DIV</c> and <c>SPAN</c> elements, contained within the cells.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To access only those elements which have the current element as their direct parent, use the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection instead. - - Elements in this collection will not necessarily be returned in source order. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To access only those elements which have the current element as their direct parent, use the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection instead. + + Elements in this collection will not necessarily be returned in source order. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.Children" /> @@ -139,23 +139,23 @@ <summary>Adds an element to another element's subtree.</summary> <returns>The element after it has been added to the tree.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The HTML Document Object Model (DOM) enables you to alter the run-time contents of an HTML file in a number of ways. Use <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> to add new elements to an existing document, or to move an element on the page. - - If an element has already been parented, appending an element to another element will automatically remove that element from its previous parent. - - Any additions made to a document at run-time using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> will not be persisted when you call the <xref:System.Windows.Forms.WebBrowser.ShowSaveAsDialog%2A> method on the <xref:System.Windows.Forms.WebBrowser> control. - - - -## Examples - The following code example creates a new hyperlink using the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method and adds it to end of a page using `AppendChild` on the `BODY` element. The example requires that your application contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The HTML Document Object Model (DOM) enables you to alter the run-time contents of an HTML file in a number of ways. Use <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> to add new elements to an existing document, or to move an element on the page. + + If an element has already been parented, appending an element to another element will automatically remove that element from its previous parent. + + Any additions made to a document at run-time using <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> will not be persisted when you call the <xref:System.Windows.Forms.WebBrowser.ShowSaveAsDialog%2A> method on the <xref:System.Windows.Forms.WebBrowser> control. + + + +## Examples + The following code example creates a new hyperlink using the <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A> method and adds it to end of a page using `AppendChild` on the `BODY` element. The example requires that your application contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.HtmlDocument.CreateElement(System.String)" /> @@ -193,15 +193,15 @@ <param name="eventHandler">The managed code that handles the event.</param> <summary>Adds an event handler for a named event on the HTML Document Object Model (DOM).</summary> <remarks> - <format type="text/markdown">< and the IHTMLElement interfaces: [IHTMLElement](https://go.microsoft.com/fwlink/?LinkId=104876), [IHTMLElement2](https://go.microsoft.com/fwlink/?LinkId=104877), [IHTMLElement3](https://go.microsoft.com/fwlink/?LinkId=104878), [IHTMLElement4](https://go.microsoft.com/fwlink/?LinkId=104879). - + <format type="text/markdown">< and the IHTMLElement interfaces: [IHTMLElement](https://go.microsoft.com/fwlink/?LinkId=104876), [IHTMLElement2](https://go.microsoft.com/fwlink/?LinkId=104877), [IHTMLElement3](https://go.microsoft.com/fwlink/?LinkId=104878), [IHTMLElement4](https://go.microsoft.com/fwlink/?LinkId=104879). + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener">EventTarget.addEventListener()</related> @@ -234,19 +234,19 @@ <value> <see langword="true" /> if element can have child elements; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Some elements, such as `IMG` and `SCRIPT`, cannot have any children. Use this property before you call <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> on an arbitrary element. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.HtmlElement.Click> event on <xref:System.Windows.Forms.HtmlDocument>. If an element was not previous selected using a mouse click, the code assigns the element to a private class variable named `MoveElement`. If an element was selected, the code attempts to append it to the element that was just clicked. This code example requires that your application hosts a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`, and that you have already added an event handler for the <xref:System.Windows.Forms.HtmlElement.Click> event on <xref:System.Windows.Forms.HtmlDocument>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Some elements, such as `IMG` and `SCRIPT`, cannot have any children. Use this property before you call <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> on an arbitrary element. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.HtmlElement.Click> event on <xref:System.Windows.Forms.HtmlDocument>. If an element was not previous selected using a mouse click, the code assigns the element to a private class variable named `MoveElement`. If an element was selected, the code attempts to append it to the element that was just clicked. This code example requires that your application hosts a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`, and that you have already added an event handler for the <xref:System.Windows.Forms.HtmlElement.Click> event on <xref:System.Windows.Forms.HtmlDocument>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -283,25 +283,25 @@ <summary>Gets an <see cref="T:System.Windows.Forms.HtmlElementCollection" /> of all children of the current element.</summary> <value>A collection of all <see cref="T:System.Windows.Forms.HtmlElement" /> objects that have the current element as a parent.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Many of the elements inside of an HTML file can have other HTML elements underneath them. The <xref:System.Windows.Forms.HtmlElement.Children%2A> collection provides a simple mechanism for exploring the tree structure of a document. - - <xref:System.Windows.Forms.HtmlElement.Children%2A> only exposes elements whose direct parent is the current element. If you have an <xref:System.Windows.Forms.HtmlElement> for a `TABLE` element, <xref:System.Windows.Forms.HtmlElement.Children%2A> will give you all of the `TR` (row) elements inside of the `TABLE`. To retrieve the `TD` (cell) elements contained inside of the `TR` elements, you will need to use either the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection on each individual `TR` element, or use the <xref:System.Windows.Forms.HtmlElement.All%2A> collection on <xref:System.Windows.Forms.HtmlElement>. - - Elements in this collection are not guaranteed to be in source order. - - If <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> is `false`, `Children` will always be empty. - - - -## Examples - The following code example examines an arbitrary HTML document and derive a string describing the elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. It does this by searching the `Children` collection of all elements recursively, starting with the HTML element at the top of the document. This code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Many of the elements inside of an HTML file can have other HTML elements underneath them. The <xref:System.Windows.Forms.HtmlElement.Children%2A> collection provides a simple mechanism for exploring the tree structure of a document. + + <xref:System.Windows.Forms.HtmlElement.Children%2A> only exposes elements whose direct parent is the current element. If you have an <xref:System.Windows.Forms.HtmlElement> for a `TABLE` element, <xref:System.Windows.Forms.HtmlElement.Children%2A> will give you all of the `TR` (row) elements inside of the `TABLE`. To retrieve the `TD` (cell) elements contained inside of the `TR` elements, you will need to use either the <xref:System.Windows.Forms.HtmlElement.Children%2A> collection on each individual `TR` element, or use the <xref:System.Windows.Forms.HtmlElement.All%2A> collection on <xref:System.Windows.Forms.HtmlElement>. + + Elements in this collection are not guaranteed to be in source order. + + If <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> is `false`, `Children` will always be empty. + + + +## Examples + The following code example examines an arbitrary HTML document and derive a string describing the elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. It does this by searching the `Children` collection of all elements recursively, starting with the HTML element at the top of the document. This code example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.All" /> @@ -333,25 +333,25 @@ <Docs> <summary>Occurs when the user clicks on the element with the left mouse button.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.Click> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.Click> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - If the user clicks on an element that does not currently have input focus, the <xref:System.Windows.Forms.HtmlElement.Click> event will occur after the <xref:System.Windows.Forms.HtmlElement.Focusing> event, but before the <xref:System.Windows.Forms.HtmlElement.LostFocus> event for that element. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Click> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Click> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.Click> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.Click> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + If the user clicks on an element that does not currently have input focus, the <xref:System.Windows.Forms.HtmlElement.Click> event will occur after the <xref:System.Windows.Forms.HtmlElement.Focusing> event, but before the <xref:System.Windows.Forms.HtmlElement.LostFocus> event for that element. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Click> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Click> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet432"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet432"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet432"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/click_event">onclick Event</related> @@ -383,35 +383,35 @@ <summary>Gets the bounds of the client area of the element in the HTML document.</summary> <value>The client area occupied by the element, minus any area taken by borders and scroll bars. To obtain the position and dimensions of the element inclusive of its adornments, use <see cref="P:System.Windows.Forms.HtmlElement.OffsetRectangle" /> instead.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.ClientRectangle%2A> will return position data only for elements that have been assigned an explicit height and width, or elements that use absolute positioning. A document is absolutely positioned if its position style is set to `absolute`, after which it can be positioned at any coordinate on the HTML page. - - - -## Examples - Assume you have loaded the following HTML page into a hosted instance of the <xref:System.Windows.Forms.WebBrowser> control. - -``` -<HTML> - - <BODY> - - <DIV id="div1" style="position:absolute;top:100px;left:100px;border- style:solid;border-width:1px;"> - Edit this text. - </DIV> - - </BODY> - -</HTML> -``` - - The following code example demonstrates retrieving this element and expanding its dimensions if the client area is less than 400 pixels wide by 50 pixels high, and also sets the `DIV` to the `contentEditable` state so that the user can input text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.ClientRectangle%2A> will return position data only for elements that have been assigned an explicit height and width, or elements that use absolute positioning. A document is absolutely positioned if its position style is set to `absolute`, after which it can be positioned at any coordinate on the HTML page. + + + +## Examples + Assume you have loaded the following HTML page into a hosted instance of the <xref:System.Windows.Forms.WebBrowser> control. + +``` +<HTML> + + <BODY> + + <DIV id="div1" style="position:absolute;top:100px;left:100px;border- style:solid;border-width:1px;"> + Edit this text. + </DIV> + + </BODY> + +</HTML> +``` + + The following code example demonstrates retrieving this element and expanding its dimensions if the client area is less than 400 pixels wide by 50 pixels high, and also sets the `DIV` to the `contentEditable` state so that the user can input text. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.OffsetRectangle" /> @@ -482,11 +482,11 @@ <summary>Gets the <see cref="T:System.Windows.Forms.HtmlDocument" /> to which this element belongs.</summary> <value>The parent document of this element.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Some HTML pages can host frames using the `FRAMESET` tags. In this case, each individual `FRAME` element will contain its own instance of <xref:System.Windows.Forms.HtmlDocument>. This property is most useful when you have received a reference to an element in an event handler from the <xref:System.Windows.Forms.HtmlElementEventArgs>, and need to perform some action on the document in which the element resides. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Some HTML pages can host frames using the `FRAMESET` tags. In this case, each individual `FRAME` element will contain its own instance of <xref:System.Windows.Forms.HtmlDocument>. This property is most useful when you have received a reference to an element in an event handler from the <xref:System.Windows.Forms.HtmlElementEventArgs>, and need to perform some action on the document in which the element resides. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.HtmlDocument" /> @@ -528,19 +528,19 @@ <summary>Gets an unmanaged interface pointer for this element.</summary> <value>The COM <c>IUnknown</c> pointer for the element, which you can cast to one of the HTML element interfaces, such as <c>IHTMLElement</c>.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement> is a wrapper for the Internet Explorer Document Object Model (DOM), which is written using the Component Object Model (COM). If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLElement`, you can use this object to query for them. - - In order to use the unmanaged interfaces, you will need to import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `Invoke` method. - -## Examples - The following code example uses unmanaged interfaces to take the currently selected text and convert it into a hyperlink, with the URL chosen by the user. This code was written under the assumption that your form has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`, and that you have added the unmanaged MSHTML library as a reference to your project. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement> is a wrapper for the Internet Explorer Document Object Model (DOM), which is written using the Component Object Model (COM). If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLElement`, you can use this object to query for them. + + In order to use the unmanaged interfaces, you will need to import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `Invoke` method. + +## Examples + The following code example uses unmanaged interfaces to take the currently selected text and convert it into a hyperlink, with the URL chosen by the user. This code was written under the assumption that your form has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`, and that you have added the unmanaged MSHTML library as a reference to your project. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlDocument.DomDocument" /> @@ -573,25 +573,25 @@ <Docs> <summary>Occurs when the user clicks the left mouse button over an element twice, in rapid succession.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. - - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DoubleClick> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.DoubleClick> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DoubleClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DoubleClick> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. + + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DoubleClick> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.DoubleClick> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DoubleClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DoubleClick> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet433"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet433"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet433"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/dblclick_event">ondblclick Event</related> @@ -623,27 +623,27 @@ <Docs> <summary>Occurs when the user drags text to various locations.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event occurs when text is dragged to the following locations: - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event occurs when text is dragged to the following locations: + - Within or between HTML pages hosted in the <xref:System.Windows.Forms.WebBrowser> control or Internet Explorer. - To another application. - To the Windows desktop. - - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.Drag> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.Drag> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Drag> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Drag> event. - + + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.Drag> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.Drag> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Drag> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Drag> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet434"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet434"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet434"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/drag_event">ondrag Event</related> @@ -675,23 +675,23 @@ <Docs> <summary>Occurs when a user finishes a drag operation.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DragEnd> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.DragEnd> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragEnd> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragEnd> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DragEnd> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.DragEnd> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragEnd> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragEnd> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet435"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet435"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet435"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/dragend_event">ondragend Event</related> @@ -723,16 +723,16 @@ <Docs> <summary>Occurs when the user is no longer dragging an item over this element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragLeave> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragLeave> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet436"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet436"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet436"::: + ]]></format> </remarks> </Docs> @@ -763,23 +763,23 @@ <Docs> <summary>Occurs when the user drags text over the element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DragOver> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.DragOver> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragOver> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.DragOver> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.DragOver> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.DragOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.DragOver> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet437"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet437"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet437"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/dragover_event">ondragover Event</related> @@ -812,11 +812,11 @@ <value> <see langword="true" /> if the element allows user input; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - For `FORM` elements such as text boxes and radio buttons, setting <xref:System.Windows.Forms.HtmlElement.Enabled%2A> to `false` will prevent the user from using these form fields. For other elements, such as `DIV` or `SPAN`, setting <xref:System.Windows.Forms.HtmlElement.Enabled%2A> to `false` will cause all text within the element to appear shaded; however, the text will still be selectable. To cancel selection, add an event handler for the unexposed `onselectstart` event using the <xref:System.Windows.Forms.HtmlElement.AttachEventHandler%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + For `FORM` elements such as text boxes and radio buttons, setting <xref:System.Windows.Forms.HtmlElement.Enabled%2A> to `false` will prevent the user from using these form fields. For other elements, such as `DIV` or `SPAN`, setting <xref:System.Windows.Forms.HtmlElement.Enabled%2A> to `false` will cause all text within the element to appear shaded; however, the text will still be selectable. To cancel selection, add an event handler for the unexposed `onselectstart` event using the <xref:System.Windows.Forms.HtmlElement.AttachEventHandler%2A> method. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/htmlfieldsetelement">disabled Property</related> @@ -883,11 +883,11 @@ <summary>Gets the next element below this element in the document tree.</summary> <value>An <see cref="T:System.Windows.Forms.HtmlElement" /> representing the first element contained underneath the current element, in source order.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use <xref:System.Windows.Forms.HtmlElement.FirstChild%2A> in conjunction with <xref:System.Windows.Forms.HtmlElement.NextSibling%2A> to walk the document tree for an HTML document. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use <xref:System.Windows.Forms.HtmlElement.FirstChild%2A> in conjunction with <xref:System.Windows.Forms.HtmlElement.NextSibling%2A> to walk the document tree for an HTML document. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/node/firstchild">firstChild Property</related> @@ -919,13 +919,13 @@ <Docs> <summary>Puts user input focus on the current element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the focus on an element both gives that element focus and makes it the active element; for example, the element that has focus will be returned by the <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> property of <xref:System.Windows.Forms.HtmlDocument>. - - Any key strokes entered by a user after <xref:System.Windows.Forms.HtmlElement.Focus%2A> has been called will be sent to that element. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the focus on an element both gives that element focus and makes it the active element; for example, the element that has focus will be returned by the <xref:System.Windows.Forms.HtmlDocument.ActiveElement%2A> property of <xref:System.Windows.Forms.HtmlDocument>. + + Any key strokes entered by a user after <xref:System.Windows.Forms.HtmlElement.Focus%2A> has been called will be sent to that element. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/htmlorforeignelement/focus">focus Method</related> @@ -957,25 +957,25 @@ <Docs> <summary>Occurs when the element first receives user input focus.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An element that had focus before the user switched to another application using the taskbar or the ALT+TAB keys will receive the <xref:System.Windows.Forms.HtmlElement.Focusing> and <xref:System.Windows.Forms.HtmlElement.GotFocus> events again when the user switches back to your application. - - You cannot cancel the default behavior of this event. To remove focus from an element, call <xref:System.Windows.Forms.HtmlElement.Focus%2A> on a different element from within the <xref:System.Windows.Forms.HtmlElement.GotFocus> event. - - A <xref:System.Windows.Forms.HtmlElement.Focusing> event on an element will also occur on that element's parents and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Focusing> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Focusing> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An element that had focus before the user switched to another application using the taskbar or the ALT+TAB keys will receive the <xref:System.Windows.Forms.HtmlElement.Focusing> and <xref:System.Windows.Forms.HtmlElement.GotFocus> events again when the user switches back to your application. + + You cannot cancel the default behavior of this event. To remove focus from an element, call <xref:System.Windows.Forms.HtmlElement.Focus%2A> on a different element from within the <xref:System.Windows.Forms.HtmlElement.GotFocus> event. + + A <xref:System.Windows.Forms.HtmlElement.Focusing> event on an element will also occur on that element's parents and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.Focusing> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.Focusing> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet438"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet438"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet438"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/focusin_event">onfocusin Event</related> @@ -1011,21 +1011,21 @@ <summary>Retrieves the value of the named attribute on the element.</summary> <returns>The value of this attribute on the element, as a <see cref="T:System.String" /> value. If the specified attribute does not exist on this element, returns an empty string.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An attribute in HTML is any valid name/value pair for that element. <xref:System.Windows.Forms.HtmlElement> exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to manipulate attributes not exposed on the managed Document Object Model (DOM). - - <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> are case-insensitive. - - - -## Examples - The following code example retrieves all of the `META` tags within an HTML document, using <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> to find the `META` tag with the name `Description`. The example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An attribute in HTML is any valid name/value pair for that element. <xref:System.Windows.Forms.HtmlElement> exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to manipulate attributes not exposed on the managed Document Object Model (DOM). + + <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> are case-insensitive. + + + +## Examples + The following code example retrieves all of the `META` tags within an HTML document, using <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> to find the `META` tag with the name `Description`. The example requires that your application has a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/getattribute">getAttribute Method</related> @@ -1120,33 +1120,33 @@ <Docs> <summary>Occurs when the element has received user input focus.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can neither cancel this event's default behavior, nor prevent it from bubbling. To remove focus from an element, call <xref:System.Windows.Forms.HtmlElement.Focus%2A> on a different element from within the <xref:System.Windows.Forms.HtmlElement.GotFocus> event. - - - -## Examples - Save the following HTML code into a file, and load the file into a <xref:System.Windows.Forms.WebBrowser> control in a Windows Forms project. - -``` -<HTML> - <BODY> - <FORM name="form1"> - <INPUT type="text" size=20 name="text1"> - <INPUT type="text" size=20 name="text2"> - <INPUT type="text" size=20 name="text3"> - </FORM> - </BODY> -</HTML> -``` - - The following code example prevents the next `INPUT` element in the tab order from receiving user input focus if the previous element contains less than five characters. The example requires that the previously mentioned HTML file is loaded into an instance of the <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can neither cancel this event's default behavior, nor prevent it from bubbling. To remove focus from an element, call <xref:System.Windows.Forms.HtmlElement.Focus%2A> on a different element from within the <xref:System.Windows.Forms.HtmlElement.GotFocus> event. + + + +## Examples + Save the following HTML code into a file, and load the file into a <xref:System.Windows.Forms.WebBrowser> control in a Windows Forms project. + +``` +<HTML> + <BODY> + <FORM name="form1"> + <INPUT type="text" size=20 name="text1"> + <INPUT type="text" size=20 name="text2"> + <INPUT type="text" size=20 name="text3"> + </FORM> + </BODY> +</HTML> +``` + + The following code example prevents the next `INPUT` element in the tab order from receiving user input focus if the previous element contains less than five characters. The example requires that the previously mentioned HTML file is loaded into an instance of the <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet15"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/focus_event">onfocus Event</related> @@ -1184,11 +1184,11 @@ <summary>Gets or sets a label by which to identify the element.</summary> <value>The unique identifier for the element.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.Id%2A> must be unique; you cannot have two elements with the same <xref:System.Windows.Forms.HtmlElement.Id%2A> inside of the same document. Use the <xref:System.Windows.Forms.HtmlElement.Name%2A> property to give the same identifier to a group of logically related elements. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.Id%2A> must be unique; you cannot have two elements with the same <xref:System.Windows.Forms.HtmlElement.Id%2A> inside of the same document. Use the <xref:System.Windows.Forms.HtmlElement.Name%2A> property to give the same identifier to a group of logically related elements. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.Name" /> @@ -1228,21 +1228,21 @@ <summary>Gets or sets the HTML markup underneath this element.</summary> <value>The HTML markup that defines the child elements of the current element.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - There are several ways to add new elements to an existing HTML page, such as the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> and <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> methods. Using <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> is often the fastest way to add new content when you have to set many attributes or styles on your new elements. - - <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> differs from <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> in that <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will not include the HTML that represents the object you are calling. See <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> for more information about the difference between these two properties. - - Setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> destroys any children previously appended to the element. If you retrieve an element from the DOM and then assign new HTML to its parents' <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, your reference to that element will be useless, and its behavior when it calls its properties and methods is undefined. - - For some elements, setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> is not a valid operation. Some HTML tags have no closing tag, such as the `IMG` tag, and therefore cannot contain nested elements. Some tags, such as the `SCRIPT` tag, can only contain text content; setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will result in an error. For both types of tags, the <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> property will return `false`. However, you also cannot set <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> on `TABLE` and `TR` elements, as assigning malformed HTML to these elements could corrupt the rendering of the document. Use <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or the `insertRow` and `insertCell` methods on the unmanaged `IHTMLTable` interface to add rows and cells to a `TABLE`. - - If you need only to assign text to an element and not HTML markup, use the <xref:System.Windows.Forms.HtmlElement.InnerText%2A> property instead. - - Assigning a value to <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will destroy any text values previously assigned using <xref:System.Windows.Forms.HtmlElement.InnerText%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + There are several ways to add new elements to an existing HTML page, such as the <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> and <xref:System.Windows.Forms.HtmlElement.InsertAdjacentElement%2A> methods. Using <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> is often the fastest way to add new content when you have to set many attributes or styles on your new elements. + + <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> differs from <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> in that <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will not include the HTML that represents the object you are calling. See <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> for more information about the difference between these two properties. + + Setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> destroys any children previously appended to the element. If you retrieve an element from the DOM and then assign new HTML to its parents' <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, your reference to that element will be useless, and its behavior when it calls its properties and methods is undefined. + + For some elements, setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> is not a valid operation. Some HTML tags have no closing tag, such as the `IMG` tag, and therefore cannot contain nested elements. Some tags, such as the `SCRIPT` tag, can only contain text content; setting <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will result in an error. For both types of tags, the <xref:System.Windows.Forms.HtmlElement.CanHaveChildren%2A> property will return `false`. However, you also cannot set <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> on `TABLE` and `TR` elements, as assigning malformed HTML to these elements could corrupt the rendering of the document. Use <xref:System.Windows.Forms.HtmlElement.AppendChild%2A> or the `insertRow` and `insertCell` methods on the unmanaged `IHTMLTable` interface to add rows and cells to a `TABLE`. + + If you need only to assign text to an element and not HTML markup, use the <xref:System.Windows.Forms.HtmlElement.InnerText%2A> property instead. + + Assigning a value to <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will destroy any text values previously assigned using <xref:System.Windows.Forms.HtmlElement.InnerText%2A>. + ]]></format> </remarks> <exception cref="T:System.NotSupportedException">Creating child elements on this element is not allowed.</exception> @@ -1285,21 +1285,21 @@ <summary>Gets or sets the text assigned to the element.</summary> <value>The element's text, absent any HTML markup. If the element contains child elements, only the text in those child elements will be preserved.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you attempt to assign HTML to an element with <xref:System.Windows.Forms.HtmlElement.InnerText%2A>, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, <xref:System.Windows.Forms.HtmlElement.InnerText%2A> will return all of the text in that HTML with the markup removed. - - Assigning a value to <xref:System.Windows.Forms.HtmlElement.InnerText%2A> will destroy any child elements that belong to the element. - - - -## Examples - The following code creates a new hyperlink using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>, and assigns text to the link using the <xref:System.Windows.Forms.HtmlElement.InnerText%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you attempt to assign HTML to an element with <xref:System.Windows.Forms.HtmlElement.InnerText%2A>, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, <xref:System.Windows.Forms.HtmlElement.InnerText%2A> will return all of the text in that HTML with the markup removed. + + Assigning a value to <xref:System.Windows.Forms.HtmlElement.InnerText%2A> will destroy any child elements that belong to the element. + + + +## Examples + The following code creates a new hyperlink using <xref:System.Windows.Forms.HtmlDocument.CreateElement%2A>, and assigns text to the link using the <xref:System.Windows.Forms.HtmlElement.InnerText%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: + ]]></format> </remarks> <exception cref="T:System.NotSupportedException">The specified element cannot contain text (for example, an <c>IMG</c> element).</exception> @@ -1347,21 +1347,21 @@ <summary>Insert a new element into the Document Object Model (DOM).</summary> <returns>The <see cref="T:System.Windows.Forms.HtmlElement" /> that was just inserted. If insertion failed, this will return <see langword="null" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Do not call this method until after the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event on the <xref:System.Windows.Forms.WebBrowser> control has occurred. Calling this method before then can result in an exception, as the document will not have finished loading. - - Whether a value of <xref:System.Windows.Forms.HtmlElementInsertionOrientation> is valid will depend on the type of the element. For example, <xref:System.Windows.Forms.HtmlElementInsertionOrientation.AfterBegin> is valid if the element is a `DIV`, but not if it is a `SCRIPT` or `IMG` element, neither of which can contain child elements. - - - -## Examples - The following code example inserts a `DIV` element into the top of every page that users view outside of the ADatum.com server. The example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. Your sample must also import the namespace <xref:System.Text.RegularExpressions>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Do not call this method until after the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event on the <xref:System.Windows.Forms.WebBrowser> control has occurred. Calling this method before then can result in an exception, as the document will not have finished loading. + + Whether a value of <xref:System.Windows.Forms.HtmlElementInsertionOrientation> is valid will depend on the type of the element. For example, <xref:System.Windows.Forms.HtmlElementInsertionOrientation.AfterBegin> is valid if the element is a `DIV`, but not if it is a `SCRIPT` or `IMG` element, neither of which can contain child elements. + + + +## Examples + The following code example inserts a `DIV` element into the top of every page that users view outside of the ADatum.com server. The example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control named `WebBrowser1`. Your sample must also import the namespace <xref:System.Text.RegularExpressions>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet9"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/insertadjacentelement">insertAdjacentElement Method</related> @@ -1413,11 +1413,11 @@ <summary>Executes an unexposed method on the underlying DOM element of this element.</summary> <returns>The element returned by this method, represented as an <see cref="T:System.Object" />. If this <see cref="T:System.Object" /> is another HTML element, and you have a reference to the unmanaged MSHTML library added to your project, you can cast it to its appropriate unmanaged interface.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method can be used to call methods from the Document Object Model (DOM) that do not have equivalents in managed code. Use this version of <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> to execute unexposed methods that take no arguments. For an example, see <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method can be used to call methods from the Document Object Model (DOM) that do not have equivalents in managed code. Use this version of <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> to execute unexposed methods that take no arguments. For an example, see <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A>. + ]]></format> </remarks> </Docs> @@ -1466,19 +1466,19 @@ <summary>Executes a function defined in the current HTML page by a scripting language.</summary> <returns>The element returned by the function, represented as an <see cref="T:System.Object" />. If this <see cref="T:System.Object" /> is another HTML element, and you have a reference to the unmanaged MSHTML library added to your project, you can cast it to its appropriate unmanaged interface.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method can be used to call methods from the Document Object Model (DOM) that do not have equivalents in managed code. All arguments supplied to <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> will be converted to Win32 `VARIANT` data types before they are passed to the named scripting function. - - - -## Examples - The following code example gets a `TABLE` called `dataTable` and uses the unexposed `moveRow` method to move a row from the end of the table to the beginning. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method can be used to call methods from the Document Object Model (DOM) that do not have equivalents in managed code. All arguments supplied to <xref:System.Windows.Forms.HtmlElement.InvokeMember%2A> will be converted to Win32 `VARIANT` data types before they are passed to the named scripting function. + + + +## Examples + The following code example gets a `TABLE` called `dataTable` and uses the unexposed `moveRow` method to move a row from the end of the table to the beginning. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet11"::: + ]]></format> </remarks> </Docs> @@ -1509,25 +1509,25 @@ <Docs> <summary>Occurs when the user presses a key on the keyboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.KeyDown> occurs before <xref:System.Windows.Forms.HtmlElement.KeyPress>, which in turns occurs before <xref:System.Windows.Forms.HtmlElement.KeyUp>. - - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.KeyDown> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.KeyDown> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyDown> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.KeyDown> occurs before <xref:System.Windows.Forms.HtmlElement.KeyPress>, which in turns occurs before <xref:System.Windows.Forms.HtmlElement.KeyUp>. + + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.KeyDown> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.KeyDown> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyDown> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet442"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet442"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet442"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/keydown_event">onkeydown Event</related> @@ -1559,25 +1559,25 @@ <Docs> <summary>Occurs when the user presses and releases a key on the keyboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.KeyPress> occurs after <xref:System.Windows.Forms.HtmlElement.KeyDown> and before <xref:System.Windows.Forms.HtmlElement.KeyUp>. - - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.KeyPress> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.KeyPress> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyPress> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyPress> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.KeyPress> occurs after <xref:System.Windows.Forms.HtmlElement.KeyDown> and before <xref:System.Windows.Forms.HtmlElement.KeyUp>. + + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.KeyPress> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.KeyPress> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyPress> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyPress> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet443"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet443"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet443"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/keypress_event">onkeypress Event</related> @@ -1609,25 +1609,25 @@ <Docs> <summary>Occurs when the user releases a key on the keyboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.KeyUp> occurs after <xref:System.Windows.Forms.HtmlElement.KeyPress>, which occurs after <xref:System.Windows.Forms.HtmlElement.KeyDown>. - - You cannot cancel this event. - - A <xref:System.Windows.Forms.HtmlElement.KeyUp> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyUp> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.KeyUp> occurs after <xref:System.Windows.Forms.HtmlElement.KeyPress>, which occurs after <xref:System.Windows.Forms.HtmlElement.KeyDown>. + + You cannot cancel this event. + + A <xref:System.Windows.Forms.HtmlElement.KeyUp> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.KeyUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.KeyUp> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet444"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet444"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet444"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/document/keyup_event">onkeyup Event</related> @@ -1659,16 +1659,16 @@ <Docs> <summary>Occurs when the element is losing user input focus.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.LosingFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.LosingFocus> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.LosingFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.LosingFocus> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet440"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet440"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet440"::: + ]]></format> </remarks> </Docs> @@ -1699,25 +1699,25 @@ <Docs> <summary>Occurs when the element has lost user input focus.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An element will no longer receive key stroke events after <xref:System.Windows.Forms.HtmlElement.LostFocus> occurs until it is given focus again, either by the user selecting it on the page or by the application calling the <xref:System.Windows.Forms.HtmlElement.Focus%2A> method on that element. - - You cannot cancel this event. - - An <xref:System.Windows.Forms.HtmlElement.LostFocus> event on an element will also occur on that element's parents and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.LostFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.LostFocus> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An element will no longer receive key stroke events after <xref:System.Windows.Forms.HtmlElement.LostFocus> occurs until it is given focus again, either by the user selecting it on the page or by the application calling the <xref:System.Windows.Forms.HtmlElement.Focus%2A> method on that element. + + You cannot cancel this event. + + An <xref:System.Windows.Forms.HtmlElement.LostFocus> event on an element will also occur on that element's parents and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.LostFocus> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.LostFocus> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet441"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet441"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet441"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/focusout_event">onfocusout Event</related> @@ -1749,23 +1749,23 @@ <Docs> <summary>Occurs when the user presses a mouse button.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseDown> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.MouseDown> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseDown> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseDown> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.MouseDown> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseDown> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet446"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet446"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet446"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/mousedown_event">onmousedown Event</related> @@ -1797,16 +1797,16 @@ <Docs> <summary>Occurs when the user first moves the mouse cursor over the current element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseEnter> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseEnter> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseEnter> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseEnter> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet449"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet449"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet449"::: + ]]></format> </remarks> </Docs> @@ -1837,16 +1837,16 @@ <Docs> <summary>Occurs when the user moves the mouse cursor off of the current element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseLeave> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseLeave> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseLeave> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet450"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet450"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet450"::: + ]]></format> </remarks> </Docs> @@ -1877,23 +1877,23 @@ <Docs> <summary>Occurs when the user moves the mouse cursor across the element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You cannot cancel this event. - - A <xref:System.Windows.Forms.HtmlElement.MouseMove> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseMove> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseMove> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You cannot cancel this event. + + A <xref:System.Windows.Forms.HtmlElement.MouseMove> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseMove> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseMove> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet445"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet445"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet445"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/mousemove_event">onmousemove Event</related> @@ -1925,23 +1925,23 @@ <Docs> <summary>Occurs when the mouse cursor enters the bounds of the element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseOver> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.MouseOver> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseOver> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseOver> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.MouseOver> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseOver> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseOver> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet447"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet447"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet447"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/mouseover_event">onmouseover Event</related> @@ -1973,23 +1973,23 @@ <Docs> <summary>Occurs when the user releases a mouse button.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseUp> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - A <xref:System.Windows.Forms.HtmlElement.MouseUp> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseUp> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can cancel the default action for a <xref:System.Windows.Forms.HtmlElement.MouseUp> event on an element by setting the <xref:System.Windows.Forms.HtmlElementEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + A <xref:System.Windows.Forms.HtmlElement.MouseUp> event on an element will also occur on that element's parent elements and on the <xref:System.Windows.Forms.HtmlDocument> class itself, unless you set the <xref:System.Windows.Forms.HtmlElementEventArgs.BubbleEvent%2A> property of the <xref:System.Windows.Forms.HtmlElementEventArgs> class to `true`. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.HtmlElement.MouseUp> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.HtmlElement> named `HtmlElement1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.HtmlElement.MouseUp> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet448"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet448"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet448"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/mouseup_event">onmouseup Event</related> @@ -2035,13 +2035,13 @@ <summary>Gets or sets the name of the element.</summary> <value>A <see cref="T:System.String" /> representing the element's name.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.HtmlElement.Name%2A> property to retrieve elements from a document using the <xref:System.Windows.Forms.HtmlElementCollection.GetElementsByName%2A> method on the <xref:System.Windows.Forms.HtmlElement.All%2A> property of <xref:System.Windows.Forms.HtmlDocument>. - - When applied to `INPUT` elements, <xref:System.Windows.Forms.HtmlElement.Name%2A> defines the variable name for that element's data when its form is submitted to the server. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.HtmlElement.Name%2A> property to retrieve elements from a document using the <xref:System.Windows.Forms.HtmlElementCollection.GetElementsByName%2A> method on the <xref:System.Windows.Forms.HtmlElement.All%2A> property of <xref:System.Windows.Forms.HtmlDocument>. + + When applied to `INPUT` elements, <xref:System.Windows.Forms.HtmlElement.Name%2A> defines the variable name for that element's data when its form is submitted to the server. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/html/attributes">name Property</related> @@ -2074,11 +2074,11 @@ <summary>Gets the next element at the same level as this element in the document tree.</summary> <value>An <see cref="T:System.Windows.Forms.HtmlElement" /> representing the element to the right of the current element.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use <xref:System.Windows.Forms.HtmlElement.NextSibling%2A> in conjunction with <xref:System.Windows.Forms.HtmlElement.FirstChild%2A> to walk the document tree for an HTML element. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use <xref:System.Windows.Forms.HtmlElement.NextSibling%2A> in conjunction with <xref:System.Windows.Forms.HtmlElement.FirstChild%2A> to walk the document tree for an HTML element. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/node/nextsibling">nextSibling Property</related> @@ -2109,49 +2109,49 @@ </ReturnValue> <Docs> <summary>Gets the element from which <see cref="P:System.Windows.Forms.HtmlElement.OffsetRectangle" /> is calculated.</summary> - <value>The element from which the offsets are calculated. - + <value>The element from which the offsets are calculated. + If an element's parent or another element in the element's hierarchy uses relative or absolute positioning, <see langword="OffsetParent" /> will be the first relatively or absolutely positioned element in which the current element is nested. If none of the elements above the current element are absolutely or relatively positioned, <see langword="OffsetParent" /> will be the <c>BODY</c> tag of the document.</value> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example shows how <xref:System.Windows.Forms.HtmlElement.OffsetParent%2A> and <xref:System.Windows.Forms.HtmlElement.OffsetRectangle%2A> differ for `span1`, `span2` and `span3`: - -``` -<HTML> - <BODY id="documentBody"> - - <DIV id="div1"> - <SPAN id="span1">Placeholder text 1.</SPAN> - </DIV> - - <DIV id="div2" style="position:relative;top:100px;left:100px;"> - <SPAN id="span2">Placeholder text 2.</SPAN> - </DIV> - - <DIV id="div3" style="position:absolute;top:200px;left:200px;"> - <DIV id="div4" style="position:relative;top:100px;left:100px;"> - <SPAN id="span3">Placeholder text 3.</SPAN> - </DIV> - </DIV> - - </BODY> -</HTML> -``` - + <format type="text/markdown"><. + + + +## Examples + The following code example shows how <xref:System.Windows.Forms.HtmlElement.OffsetParent%2A> and <xref:System.Windows.Forms.HtmlElement.OffsetRectangle%2A> differ for `span1`, `span2` and `span3`: + +``` +<HTML> + <BODY id="documentBody"> + + <DIV id="div1"> + <SPAN id="span1">Placeholder text 1.</SPAN> + </DIV> + + <DIV id="div2" style="position:relative;top:100px;left:100px;"> + <SPAN id="span2">Placeholder text 2.</SPAN> + </DIV> + + <DIV id="div3" style="position:absolute;top:200px;left:200px;"> + <DIV id="div4" style="position:relative;top:100px;left:100px;"> + <SPAN id="span3">Placeholder text 3.</SPAN> + </DIV> + </DIV> + + </BODY> +</HTML> +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/htmlelement/offsetparent">offsetParent Property</related> @@ -2181,53 +2181,53 @@ </ReturnValue> <Docs> <summary>Gets the location of an element relative to its parent.</summary> - <value>The x- and y-coordinate positions of the element, and its width and its height, in relation to its parent. - + <value>The x- and y-coordinate positions of the element, and its width and its height, in relation to its parent. + If an element's parent is relatively or absolutely positioned, <see cref="P:System.Windows.Forms.HtmlElement.OffsetRectangle" /> will return the offset of the parent element. If the element itself is relatively positioned with respect to its parent, <see cref="P:System.Windows.Forms.HtmlElement.OffsetRectangle" /> will return the offset from its parent.</value> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example shows how <xref:System.Windows.Forms.HtmlElement.OffsetParent%2A> and <xref:System.Windows.Forms.HtmlElement.OffsetRectangle%2A> differ for `span1`, `span2` and `span3`: - -``` -<HTML> - <BODY id="documentBody"> - - <DIV id="div1"> - <SPAN id="span1">Placeholder text 1.</SPAN> - </DIV> - - <DIV id="div2" style="position:relative;top:100px;left:100px;"> - <SPAN id="span2">Placeholder text 2.</SPAN> - </DIV> - - <DIV id="div3" style="position:absolute;top:200px;left:200px;"> - <DIV id="div4" style="position:relative;top:100px;left:100px;"> - <SPAN id="span3">Placeholder text 3.</SPAN> - </DIV> - </DIV> - - </BODY> -</HTML> -``` - + <format type="text/markdown"><. + + + +## Examples + The following code example shows how <xref:System.Windows.Forms.HtmlElement.OffsetParent%2A> and <xref:System.Windows.Forms.HtmlElement.OffsetRectangle%2A> differ for `span1`, `span2` and `span3`: + +``` +<HTML> + <BODY id="documentBody"> + + <DIV id="div1"> + <SPAN id="span1">Placeholder text 1.</SPAN> + </DIV> + + <DIV id="div2" style="position:relative;top:100px;left:100px;"> + <SPAN id="span2">Placeholder text 2.</SPAN> + </DIV> + + <DIV id="div3" style="position:absolute;top:200px;left:200px;"> + <DIV id="div4" style="position:relative;top:100px;left:100px;"> + <SPAN id="span3">Placeholder text 3.</SPAN> + </DIV> + </DIV> + + </BODY> +</HTML> +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.OffsetParent" /> @@ -2271,11 +2271,11 @@ <returns> <see langword="true" /> if both parameters are <see langword="null" />, or if both elements have the same underlying COM interface; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The equality operator tests the `IUnknown` pointers of the underlying COM objects wrapped by the supplied <xref:System.Windows.Forms.HtmlElement> classes. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The equality operator tests the `IUnknown` pointers of the underlying COM objects wrapped by the supplied <xref:System.Windows.Forms.HtmlElement> classes. + The equivalent method for this operator is <xref:System.Windows.Forms.HtmlElement.Equals%2A?displayProperty=nameWithType>]]></format> </remarks> </Docs> @@ -2350,63 +2350,63 @@ <summary>Gets or sets the current element's HTML code.</summary> <value>The HTML code for the current element and its children.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Whereas <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will return all HTML contained in the current element excluding the current element's surrounding tags, <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> includes the current element's tag as well as the HTML that tag contains, for example: - - `<HTML>` - - `<BODY>` - - `<DIV id="div1">` - - `Hello` - - `<DIV id="div2">` - - `World` - - `<DIV id="div3">` - - `How are you?` - - `</DIV>` - - `</DIV>` - - `</DIV>` - - `</BODY>` - - `</HTML>` - - In this example, calling <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> on `div2` will return: - - `<DIV id="div2">` - - `World` - - `<DIV id="div3">` - - `How are you?` - - `</DIV>` - - `</DIV>` - - Calling <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will return: - - `World` - - `<DIV id="div3">` - - `How are you?` - - `</DIV>` - - If you assign a new value to <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A>, the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Whereas <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will return all HTML contained in the current element excluding the current element's surrounding tags, <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> includes the current element's tag as well as the HTML that tag contains, for example: + + `<HTML>` + + `<BODY>` + + `<DIV id="div1">` + + `Hello` + + `<DIV id="div2">` + + `World` + + `<DIV id="div3">` + + `How are you?` + + `</DIV>` + + `</DIV>` + + `</DIV>` + + `</BODY>` + + `</HTML>` + + In this example, calling <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A> on `div2` will return: + + `<DIV id="div2">` + + `World` + + `<DIV id="div3">` + + `How are you?` + + `</DIV>` + + `</DIV>` + + Calling <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> will return: + + `World` + + `<DIV id="div3">` + + `How are you?` + + `</DIV>` + + If you assign a new value to <xref:System.Windows.Forms.HtmlElement.OuterHtml%2A>, the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.HtmlElement.InnerHtml" /> @@ -2445,13 +2445,13 @@ <summary>Gets or sets the current element's text.</summary> <value>The text inside the current element, and in the element's children.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you attempt to assign HTML to an element with <xref:System.Windows.Forms.HtmlElement.OuterText%2A>, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, <xref:System.Windows.Forms.HtmlElement.OuterText%2A> will return all of the text in that HTML with the markup removed. - - Assigning a value to <xref:System.Windows.Forms.HtmlElement.OuterText%2A> will destroy any child elements that belong to the element. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you attempt to assign HTML to an element with <xref:System.Windows.Forms.HtmlElement.OuterText%2A>, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the <xref:System.Windows.Forms.HtmlElement.InnerHtml%2A> property, <xref:System.Windows.Forms.HtmlElement.OuterText%2A> will return all of the text in that HTML with the markup removed. + + Assigning a value to <xref:System.Windows.Forms.HtmlElement.OuterText%2A> will destroy any child elements that belong to the element. + ]]></format> </remarks> <exception cref="T:System.NotSupportedException">You cannot set text outside of this element.</exception> @@ -2486,21 +2486,21 @@ <summary>Gets the current element's parent element.</summary> <value>The element above the current element in the HTML document's hierarchy.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property enables discovery of an element's context. It is most useful inside of event handlers such as <xref:System.Windows.Forms.HtmlElement.Click>, which can fire for any element anywhere in the document's object hierarchy. - - The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property of the HTML element (the top of an HTML document) points back to itself. If you call <xref:System.Windows.Forms.HtmlElement.Parent%2A> inside a loop, verify that the loop's break condition compares the type of the current element and the type of the `Parent` property, or else your code may execute an infinite loop. - - - -## Examples - The following code example finds all of the `IMG` tags in a document, and uses the <xref:System.Windows.Forms.HtmlElement.Parent%2A> property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property enables discovery of an element's context. It is most useful inside of event handlers such as <xref:System.Windows.Forms.HtmlElement.Click>, which can fire for any element anywhere in the document's object hierarchy. + + The <xref:System.Windows.Forms.HtmlElement.Parent%2A> property of the HTML element (the top of an HTML document) points back to itself. If you call <xref:System.Windows.Forms.HtmlElement.Parent%2A> inside a loop, verify that the loop's break condition compares the type of the current element and the type of the `Parent` property, or else your code may execute an infinite loop. + + + +## Examples + The following code example finds all of the `IMG` tags in a document, and uses the <xref:System.Windows.Forms.HtmlElement.Parent%2A> property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/node/parentelement">parentElement Property</related> @@ -2535,11 +2535,11 @@ <param name="eventName">The name of the event to raise.</param> <summary>Causes the named event to call all registered event handlers.</summary> <remarks> - <format type="text/markdown">< method. For more information about how to use the DOM through the <xref:System.Windows.Forms.HtmlElement> class, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model). - + <format type="text/markdown">< method. For more information about how to use the DOM through the <xref:System.Windows.Forms.HtmlElement> class, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model). + ]]></format> </remarks> </Docs> @@ -2570,13 +2570,13 @@ <Docs> <summary>Removes focus from the current element, if that element has focus.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Calling this method raises the <xref:System.Windows.Forms.HtmlElement.LostFocus> event for the element. - - When focus is cleared from an element using this method, it is given to the document containing the element, not to the next element in the tab order. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Calling this method raises the <xref:System.Windows.Forms.HtmlElement.LostFocus> event for the element. + + When focus is cleared from an element using this method, it is given to the document containing the element, not to the next element in the tab order. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/htmlorforeignelement/blur">blur Method</related> @@ -2611,14 +2611,14 @@ <param name="alignWithTop">If <see langword="true" />, the top of the object will be displayed at the top of the window. If <see langword="false" />, the bottom of the object will be displayed at the bottom of the window.</param> <summary>Scrolls through the document containing this element until the top or bottom edge of this element is aligned with the document's window.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example finds an element by name and scrolls through the page so that the top of the element is aligned with the top of the visible page. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example finds an element by name and scrolls through the page so that the top of the element is aligned with the top of the visible page. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet12"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/scrollintoview">scrollIntoView Method</related> @@ -2650,11 +2650,11 @@ <summary>Gets or sets the distance between the edge of the element and the left edge of its content.</summary> <value>The distance, in pixels, between the left edge of the element and the left edge of its content.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The full dimensions of the scroll area are available using <xref:System.Windows.Forms.HtmlElement.ScrollRectangle%2A>; `ScrollLeft` and <xref:System.Windows.Forms.HtmlElement.ScrollTop%2A> are exposed independently because these are the only two properties of the scroll area that developers can set. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The full dimensions of the scroll area are available using <xref:System.Windows.Forms.HtmlElement.ScrollRectangle%2A>; `ScrollLeft` and <xref:System.Windows.Forms.HtmlElement.ScrollTop%2A> are exposed independently because these are the only two properties of the scroll area that developers can set. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/scrollleft">scrollLeft Property</related> @@ -2686,13 +2686,13 @@ <summary>Gets the dimensions of an element's scrollable region.</summary> <value>The size and coordinate location of the scrollable area of an element.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An element will have a scrollable region if its content exceeds the size of its dimensions, unless the overflow style on the element forbids rendering scrollbars. - - You cannot modify the size of the scroll area directly, but you can modify the distance between the edges of the scroll area and the edges of the element. Use the <xref:System.Windows.Forms.HtmlElement.ScrollLeft%2A> and <xref:System.Windows.Forms.HtmlElement.ScrollTop%2A> properties to achieve this. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An element will have a scrollable region if its content exceeds the size of its dimensions, unless the overflow style on the element forbids rendering scrollbars. + + You cannot modify the size of the scroll area directly, but you can modify the distance between the edges of the scroll area and the edges of the element. Use the <xref:System.Windows.Forms.HtmlElement.ScrollLeft%2A> and <xref:System.Windows.Forms.HtmlElement.ScrollTop%2A> properties to achieve this. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/scrollleft">scrollLeft Property</related> @@ -2727,11 +2727,11 @@ <summary>Gets or sets the distance between the edge of the element and the top edge of its content.</summary> <value>The distance, in pixels, between the top edge of the element and the top edge of its content.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The full dimensions of the scroll area are available using <xref:System.Windows.Forms.HtmlElement.ScrollRectangle%2A>; <xref:System.Windows.Forms.HtmlElement.ScrollLeft%2A> and `ScrollTop` are exposed independently because these are the only two properties of the scroll area that developers can set. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The full dimensions of the scroll area are available using <xref:System.Windows.Forms.HtmlElement.ScrollRectangle%2A>; <xref:System.Windows.Forms.HtmlElement.ScrollLeft%2A> and `ScrollTop` are exposed independently because these are the only two properties of the scroll area that developers can set. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/scrolltop">scrollTop Property</related> @@ -2768,25 +2768,25 @@ <param name="value">The new value of this attribute.</param> <summary>Sets the value of the named attribute on the element.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An attribute in HTML is any valid name-value pair for that element. <xref:System.Windows.Forms.HtmlElement> exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to manipulate attributes not exposed on the managed Document Object Model (DOM). - - If `attributeName` is not a defined attribute on an element, <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> will define it on the element as a new attribute. - - <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> are case-insensitive. - - To set the `class` attribute on an <xref:System.Windows.Forms.HtmlElement> , you must refer to the attribute as `className` when specifying the first argument to <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> - - - -## Examples - The following code example adds a new `IMG` element to the current document, using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to set the `SRC` attribute for the image. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An attribute in HTML is any valid name-value pair for that element. <xref:System.Windows.Forms.HtmlElement> exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to manipulate attributes not exposed on the managed Document Object Model (DOM). + + If `attributeName` is not a defined attribute on an element, <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> will define it on the element as a new attribute. + + <xref:System.Windows.Forms.HtmlElement.GetAttribute%2A> and <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> are case-insensitive. + + To set the `class` attribute on an <xref:System.Windows.Forms.HtmlElement> , you must refer to the attribute as `className` when specifying the first argument to <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> + + + +## Examples + The following code example adds a new `IMG` element to the current document, using <xref:System.Windows.Forms.HtmlElement.SetAttribute%2A> to set the `SRC` attribute for the image. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet13"::: + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/element/setattribute">setAttribute Method</related> @@ -2824,19 +2824,19 @@ <summary>Gets or sets a semicolon-delimited list of styles for the current element.</summary> <value>A string consisting of all of the element's styles.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The HTML Document Object Model (DOM) uses styles as defined in the World Wide Web Consortiums Cascading Style Sheets specification to control the display of an element. Styles in the <xref:System.Windows.Forms.HtmlElement.Style%2A> property take the form of colon-delimited name-value pairs, with each pair separated by a semicolon, as follows: - - `style-name1:value1;...;[style-nameN:valueN;]` - - To set the font for a `DIV` element to 14-point Times New Roman bold, for example, you would assign the following string: - - `font-face:Times New Roman;font-size:14px;font-weight:bold;` - - For a full list of all available styles in the HTML DOM, see [STYLE Attribute](https://developer.mozilla.org/en-us/docs/web/html/global_attributes/style). - + <format type="text/markdown"><![CDATA[ + +## Remarks + The HTML Document Object Model (DOM) uses styles as defined in the World Wide Web Consortiums Cascading Style Sheets specification to control the display of an element. Styles in the <xref:System.Windows.Forms.HtmlElement.Style%2A> property take the form of colon-delimited name-value pairs, with each pair separated by a semicolon, as follows: + + `style-name1:value1;...;[style-nameN:valueN;]` + + To set the font for a `DIV` element to 14-point Times New Roman bold, for example, you would assign the following string: + + `font-face:Times New Roman;font-size:14px;font-weight:bold;` + + For a full list of all available styles in the HTML DOM, see [STYLE Attribute](https://developer.mozilla.org/en-us/docs/web/html/global_attributes/style). + ]]></format> </remarks> </Docs> @@ -2867,13 +2867,13 @@ <summary>Gets or sets the location of this element in the tab order.</summary> <value>The numeric index of the element in the tab order.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.HtmlElement.TabIndex%2A> determines which element in an HTML document will next receive focus when the user presses the TAB key. By default, the only elements included in the tab order are `INPUT` elements, the `SELECT` control, and any element whose `contentEditable` property is set to `true`. You can include any HTML element in the tab order, such as a `DIV`, by assigning it an explicit <xref:System.Windows.Forms.HtmlElement.TabIndex%2A>. - - Valid values for <xref:System.Windows.Forms.HtmlElement.TabIndex%2A> range from -32767 to 32767. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.HtmlElement.TabIndex%2A> determines which element in an HTML document will next receive focus when the user presses the TAB key. By default, the only elements included in the tab order are `INPUT` elements, the `SELECT` control, and any element whose `contentEditable` property is set to `true`. You can include any HTML element in the tab order, such as a `DIV`, by assigning it an explicit <xref:System.Windows.Forms.HtmlElement.TabIndex%2A>. + + Valid values for <xref:System.Windows.Forms.HtmlElement.TabIndex%2A> range from -32767 to 32767. + ]]></format> </remarks> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/html/global_attributes/tabindex">tabIndex Property</related> @@ -2911,19 +2911,19 @@ <summary>Gets the name of the HTML tag.</summary> <value>The name used to create this element using HTML markup.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Many elements in the HTML Document Object Model have attributes, properties, and methods that are unique to those elements; such as the `HREF` attribute on the `A` element, or the `Submit` method on `FORM`. Use <xref:System.Windows.Forms.HtmlElement.TagName%2A> when you have an element of a potentially arbitrary type, and need to perform a type-specific operation. - - - -## Examples - The following code example finds all of the `IMG` tags in a document, and uses the `TagName` property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Many elements in the HTML Document Object Model have attributes, properties, and methods that are unique to those elements; such as the `HREF` attribute on the `A` element, or the `Submit` method on `FORM`. Use <xref:System.Windows.Forms.HtmlElement.TagName%2A> when you have an element of a potentially arbitrary type, and need to perform a type-specific operation. + + + +## Examples + The following code example finds all of the `IMG` tags in a document, and uses the `TagName` property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.HtmlDocument.GetElementsByTagName(System.String)" /> diff --git a/xml/System.Windows.Forms/HtmlWindow.xml b/xml/System.Windows.Forms/HtmlWindow.xml index 50bbc82cca8..28eb2c76a4f 100644 --- a/xml/System.Windows.Forms/HtmlWindow.xml +++ b/xml/System.Windows.Forms/HtmlWindow.xml @@ -1506,7 +1506,7 @@ The following example displays a <xref:System.Windows.Forms.HtmlWindow.Confirm%2 ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> + <related type="Article" href="/dotnet/desktop/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/screen/left">screenLeft Property</related> <related type="ExternalDocumentation" href="https://developer.mozilla.org/en-us/docs/web/api/screen/top">screenTop Property</related> </Docs> diff --git a/xml/System.Windows.Forms/IDataGridViewEditingCell.xml b/xml/System.Windows.Forms/IDataGridViewEditingCell.xml index 2ca87015c06..2af622603a3 100644 --- a/xml/System.Windows.Forms/IDataGridViewEditingCell.xml +++ b/xml/System.Windows.Forms/IDataGridViewEditingCell.xml @@ -21,15 +21,15 @@ <Docs> <summary>Defines common functionality for a cell that allows the manipulation of its value.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -65,13 +65,13 @@ <summary>Gets or sets the formatted value of the cell.</summary> <value>An <see cref="T:System.Object" /> that contains the cell's value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The formatted value represents the value as it is displayed in the cell's user interface. The formatted value may be different in absolute value and even data type than the actual value contained in the cell. - - Implementations of this property typically return a value retrieved by calling the <xref:System.Windows.Forms.IDataGridViewEditingCell.GetEditingCellFormattedValue%2A> method and passing in the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.Formatting> value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The formatted value represents the value as it is displayed in the cell's user interface. The formatted value may be different in absolute value and even data type than the actual value contained in the cell. + + Implementations of this property typically return a value retrieved by calling the <xref:System.Windows.Forms.IDataGridViewEditingCell.GetEditingCellFormattedValue%2A> method and passing in the <xref:System.Windows.Forms.DataGridViewDataErrorContexts.Formatting> value. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -106,11 +106,11 @@ <value> <see langword="true" /> if the value of the cell has changed; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is set to `true` to indicate that the cell value has been modified and that its user interface (UI) may need to be updated to reflect this change in value. The owning cell or table should reset this property to `false` after an update. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is set to `true` to indicate that the cell value has been modified and that its user interface (UI) may need to be updated to reflect this change in value. The owning cell or table should reset this property to `false` after an update. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -149,13 +149,13 @@ <summary>Retrieves the formatted value of the cell.</summary> <returns>An <see cref="T:System.Object" /> that represents the formatted version of the cell contents.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The formatted value represents the value as it is displayed in the cell's user interface. The formatted value may be different in absolute value and even data type than the actual value contained in the cell. - - To set the formatted value of the cell, use the <xref:System.Windows.Forms.IDataGridViewEditingCell.EditingCellFormattedValue%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The formatted value represents the value as it is displayed in the cell's user interface. The formatted value may be different in absolute value and even data type than the actual value contained in the cell. + + To set the formatted value of the cell, use the <xref:System.Windows.Forms.IDataGridViewEditingCell.EditingCellFormattedValue%2A> property. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridViewDataErrorContexts" /> @@ -195,11 +195,11 @@ <see langword="true" /> to select the cell contents; otherwise, <see langword="false" />.</param> <summary>Prepares the currently selected cell for editing.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The purpose of this method is to prepare the cell and its contents for editing. For example, you might want to put the insertion point at the end of the cell contents, or change how the contents are aligned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The purpose of this method is to prepare the cell and its contents for editing. For example, you might want to put the insertion point at the end of the cell contents, or change how the contents are aligned. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/IDataGridViewEditingControl.xml b/xml/System.Windows.Forms/IDataGridViewEditingControl.xml index b76e8277935..f4bb9921b7f 100644 --- a/xml/System.Windows.Forms/IDataGridViewEditingControl.xml +++ b/xml/System.Windows.Forms/IDataGridViewEditingControl.xml @@ -21,35 +21,35 @@ <Docs> <summary>Defines common functionality for controls that are hosted within cells of a <see cref="T:System.Windows.Forms.DataGridView" />.</summary> <remarks> - <format type="text/markdown"><. - - Cell types such as <xref:System.Windows.Forms.DataGridViewCheckBoxCell> that provide a user interface (UI) for specifying values without hosting an editing control implement the <xref:System.Windows.Forms.IDataGridViewEditingCell> interface. The UI in this case is displayed regardless of whether the cell is in edit mode. - - Other cell types, such as <xref:System.Windows.Forms.DataGridViewButtonCell>, provide a UI but do not store user-specified values. In this case, the cell type does not implement <xref:System.Windows.Forms.IDataGridViewEditingCell> or host an editing control. - - - -## Examples - The following code example provides an implementation of this interface that derives from <xref:System.Windows.Forms.DateTimePicker>. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - + <format type="text/markdown"><. + + Cell types such as <xref:System.Windows.Forms.DataGridViewCheckBoxCell> that provide a user interface (UI) for specifying values without hosting an editing control implement the <xref:System.Windows.Forms.IDataGridViewEditingCell> interface. The UI in this case is displayed regardless of whether the cell is in edit mode. + + Other cell types, such as <xref:System.Windows.Forms.DataGridViewButtonCell>, provide a UI but do not store user-specified values. In this case, the cell type does not implement <xref:System.Windows.Forms.IDataGridViewEditingCell> or host an editing control. + + + +## Examples + The following code example provides an implementation of this interface that derives from <xref:System.Windows.Forms.DateTimePicker>. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet300"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet300"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet300"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -60,7 +60,7 @@ <altmember cref="T:System.Windows.Forms.DataGridViewTextBoxCell" /> <altmember cref="P:System.Windows.Forms.DataGridViewCell.EditType" /> <altmember cref="T:System.Windows.Forms.DataGridViewTextBoxEditingControl" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells">How to: Host Controls in Windows Forms DataGridView Cells</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells">How to: Host Controls in Windows Forms DataGridView Cells</related> </Docs> <Members> <Member MemberName="ApplyCellStyleToEditingControl"> @@ -92,19 +92,19 @@ <param name="dataGridViewCellStyle">The <see cref="T:System.Windows.Forms.DataGridViewCellStyle" /> to use as the model for the UI.</param> <summary>Changes the control's user interface (UI) to be consistent with the specified cell style.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet303"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet303"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet303"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -173,19 +173,19 @@ <summary>Gets or sets the formatted value of the cell being modified by the editor.</summary> <value>An <see cref="T:System.Object" /> that represents the formatted value of the cell.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet301"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet301"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet301"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -219,11 +219,11 @@ <summary>Gets or sets the index of the hosting cell's parent row.</summary> <value>The index of the row that contains the cell, or -1 if there is no parent row.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.IDataGridViewEditingControl> interface does not define a corresponding `ColumnIndex` property. You can use the <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlDataGridView%2A> property to retrieve the parent <xref:System.Windows.Forms.DataGridView> control and use the <xref:System.Windows.Forms.DataGridView.CurrentCellAddress%2A?displayProperty=nameWithType> property to determine the row and column indexes of the active cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.IDataGridViewEditingControl> interface does not define a corresponding `ColumnIndex` property. You can use the <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlDataGridView%2A> property to retrieve the parent <xref:System.Windows.Forms.DataGridView> control and use the <xref:System.Windows.Forms.DataGridView.CurrentCellAddress%2A?displayProperty=nameWithType> property to determine the row and column indexes of the active cell. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -258,11 +258,11 @@ <value> <see langword="true" /> if the value of the control differs from the cell value; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlValueChanged%2A> property is set to `true` to indicate that the hosting cell's state has changed and its user interface (UI) needs to be updated to reflect this change in value. The owning cell or table will reset this property to `false` after an update. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlValueChanged%2A> property is set to `true` to indicate that the hosting cell's state has changed and its user interface (UI) needs to be updated to reflect this change in value. The owning cell or table will reset this property to `false` after an update. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -307,21 +307,21 @@ <returns> <see langword="true" /> if the specified key is a regular input key that should be handled by the editing control; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet305"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet305"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet305"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -353,19 +353,19 @@ <summary>Gets the cursor used when the mouse pointer is over the <see cref="P:System.Windows.Forms.DataGridView.EditingPanel" /> but not over the editing control.</summary> <value>A <see cref="T:System.Windows.Forms.Cursor" /> that represents the mouse pointer used for the editing panel.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet311"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet311"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet311"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -404,13 +404,13 @@ <summary>Retrieves the formatted value of the cell.</summary> <returns>An <see cref="T:System.Object" /> that represents the formatted version of the cell contents.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The formatted value represents the value as it is displayed in the control's user interface. The formatted value may be different in absolute value and even data type from the actual value contained in the control. - - To set the formatted value of the control, use the <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlFormattedValue%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The formatted value represents the value as it is displayed in the control's user interface. The formatted value may be different in absolute value and even data type from the actual value contained in the control. + + To set the formatted value of the control, use the <xref:System.Windows.Forms.IDataGridViewEditingControl.EditingControlFormattedValue%2A> property. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -451,11 +451,11 @@ <see langword="true" /> to select all of the cell's content; otherwise, <see langword="false" />.</param> <summary>Prepares the currently selected cell for editing.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The purpose of this method is to prepare the control and its contents for editing. For example, you might want to put the insertion point at the end of the contents, or change how the contents are aligned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The purpose of this method is to prepare the control and its contents for editing. For example, you might want to put the insertion point at the end of the contents, or change how the contents are aligned. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> @@ -488,11 +488,11 @@ <value> <see langword="true" /> if the contents need to be repositioned; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Some situations require that cell contents reposition when the value changes. For example, cell contents may need to reposition when a cell wraps text and the contents become larger. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Some situations require that cell contents reposition when the value changes. For example, cell contents may need to reposition when a cell wraps text and the contents become larger. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DataGridView" /> diff --git a/xml/System.Windows.Forms/LayoutSettings.xml b/xml/System.Windows.Forms/LayoutSettings.xml index 538e128561c..10870b9efe4 100644 --- a/xml/System.Windows.Forms/LayoutSettings.xml +++ b/xml/System.Windows.Forms/LayoutSettings.xml @@ -29,19 +29,19 @@ <Docs> <summary>Provides a base class for collecting layout scheme characteristics.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutPanel" /> @@ -107,11 +107,11 @@ <summary>Gets the current table layout engine.</summary> <value>The <see cref="T:System.Windows.Forms.Layout.LayoutEngine" /> currently being used.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutSettings.LayoutEngine%2A> property is typically used in two contexts: the container that uses a layout scheme, and the child control of the container to which the layout scheme is applied. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutSettings.LayoutEngine%2A> property is typically used in two contexts: the container that uses a layout scheme, and the child control of the container to which the layout scheme is applied. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.LayoutEngine" /> diff --git a/xml/System.Windows.Forms/ListView.xml b/xml/System.Windows.Forms/ListView.xml index 5430b03c8b3..9e9150d10db 100644 --- a/xml/System.Windows.Forms/ListView.xml +++ b/xml/System.Windows.Forms/ListView.xml @@ -3315,7 +3315,7 @@ When this property is set to `false`, selected items in the <xref:System.Windows ## Remarks The <xref:System.Windows.Forms.ListView> insertion mark feature lets you visually indicate the expected drop location in a drag-and-drop operation when an item is dragged to a new position. This feature works only when the <xref:System.Windows.Forms.ListView.AutoArrange%2A> property is set to `true` and when the <xref:System.Windows.Forms.ListView> control does not sort the items automatically. To prevent automatic sorting, the <xref:System.Windows.Forms.ListView.Sorting%2A> property must be set to <xref:System.Windows.Forms.SortOrder.None?displayProperty=nameWithType> and the <xref:System.Windows.Forms.ListView.View%2A> property must be set to <xref:System.Windows.Forms.View.LargeIcon?displayProperty=nameWithType>, <xref:System.Windows.Forms.View.SmallIcon?displayProperty=nameWithType>, or <xref:System.Windows.Forms.View.Tile?displayProperty=nameWithType>. Additionally, the insertion mark feature may not be visible with the <xref:System.Windows.Forms.ListView> grouping feature because the grouping feature orders the items by group membership. - The <xref:System.Windows.Forms.ListViewInsertionMark> class is typically used in a handler for the <xref:System.Windows.Forms.Control.DragOver?displayProperty=nameWithType> or <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event to update the position of the insertion mark as an item is dragged. It is also used in a handler for the <xref:System.Windows.Forms.Control.DragDrop?displayProperty=nameWithType> or <xref:System.Windows.Forms.Control.MouseUp?displayProperty=nameWithType> event to insert a dragged item at the correct location. For more information, see <xref:System.Windows.Forms.ListViewInsertionMark> and [How to: Display an Insertion Mark in a Windows Forms ListView Control](/dotnet/framework/winforms/controls/how-to-display-an-insertion-mark-in-a-windows-forms-listview-control). + The <xref:System.Windows.Forms.ListViewInsertionMark> class is typically used in a handler for the <xref:System.Windows.Forms.Control.DragOver?displayProperty=nameWithType> or <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event to update the position of the insertion mark as an item is dragged. It is also used in a handler for the <xref:System.Windows.Forms.Control.DragDrop?displayProperty=nameWithType> or <xref:System.Windows.Forms.Control.MouseUp?displayProperty=nameWithType> event to insert a dragged item at the correct location. For more information, see <xref:System.Windows.Forms.ListViewInsertionMark> and [How to: Display an Insertion Mark in a Windows Forms ListView Control](/dotnet/desktop/winforms/controls/how-to-display-an-insertion-mark-in-a-windows-forms-listview-control). > [!NOTE] > The insertion mark feature is available only on Windows XP and Windows Server 2003 when your application calls the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method. On earlier operating systems, any code relating to the insertion mark has no effect and the insertion mark will not appear. As a result, any code that depends on the insertion mark feature might not work correctly. You might want to include code that determines whether this feature is available, and provide alternate functionality when it is unavailable. For example, you might want to bypass all code that implements drag-and-drop item repositioning when running on operating systems that do not support insertion marks. diff --git a/xml/System.Windows.Forms/ListViewItem.xml b/xml/System.Windows.Forms/ListViewItem.xml index e8708ecb2aa..678f3f297af 100644 --- a/xml/System.Windows.Forms/ListViewItem.xml +++ b/xml/System.Windows.Forms/ListViewItem.xml @@ -61,47 +61,47 @@ <Docs> <summary>Represents an item in a <see cref="T:System.Windows.Forms.ListView" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListView> control is similar to a <xref:System.Windows.Forms.ListBox> in that it displays a list of items. The main difference is that the <xref:System.Windows.Forms.ListView> control provides a number of different ways items can be viewed by the user. The <xref:System.Windows.Forms.ListViewItem> class defines the appearance, behavior, and data associated with an item that is displayed in the <xref:System.Windows.Forms.ListView> control. <xref:System.Windows.Forms.ListViewItem> objects can be displayed in the <xref:System.Windows.Forms.ListView> control in one of four different views. Items can be displayed as large or small icons or as small icons in a vertical list. Items can also have subitems that contain information that is related to the parent item. The fourth view style, details view, allows you to display the item and its subitems in a grid with column headers that can be used to identify the information being displayed in a subitem. - - Most of the properties of the <xref:System.Windows.Forms.ListViewItem> class provide ways to change the display of the item in the <xref:System.Windows.Forms.ListView> control it is associated with. The <xref:System.Windows.Forms.ListViewItem.BackColor%2A>, <xref:System.Windows.Forms.ListViewItem.ForeColor%2A>, and <xref:System.Windows.Forms.ListViewItem.Font%2A> properties allow you to change how the text of the item is displayed in the <xref:System.Windows.Forms.ListView> control. The <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property allows you to specify the image to load from the <xref:System.Windows.Forms.ImageList> that is assigned to the <xref:System.Windows.Forms.ListView> control (by setting the <xref:System.Windows.Forms.ListView.LargeImageList%2A> or <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties of the <xref:System.Windows.Forms.ListView>). Items can display check boxes in order to obtain item choices from the user in a way similar to a <xref:System.Windows.Forms.CheckedListBox> control. You can use the <xref:System.Windows.Forms.ListViewItem.Checked%2A> property to determine if an item is checked, or to select or clear the check box at run time. Items can display any number of subitems when the <xref:System.Windows.Forms.ListView.View%2A> property of the associated <xref:System.Windows.Forms.ListView> control is set to <xref:System.Windows.Forms.View.Details> and columns are defined in the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection> of the <xref:System.Windows.Forms.ListView> control. You can add subitems to an item by calling the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection.Add%2A> method of the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class. The <xref:System.Windows.Forms.ListViewItem.SubItems%2A> property allows you to gain access to the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class and its members. - - Some of the properties and methods of the <xref:System.Windows.Forms.ListViewItem> class are item-specific versions of properties and methods in the <xref:System.Windows.Forms.ListView> control. For example, the <xref:System.Windows.Forms.ListViewItem.EnsureVisible%2A> method is similar to the <xref:System.Windows.Forms.ListView> version of the method, but the <xref:System.Windows.Forms.ListViewItem> version affects only the current item. - - The <xref:System.Windows.Forms.ListViewItem> class also provides methods that are not versions of <xref:System.Windows.Forms.ListView> methods. The <xref:System.Windows.Forms.ListViewItem.BeginEdit%2A> method places the item's text into edit mode so the user can change the item's text (when the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `true`). The <xref:System.Windows.Forms.ListViewItem.Clone%2A> method allows you to create copies of existing <xref:System.Windows.Forms.ListViewItem> objects to reuse in other <xref:System.Windows.Forms.ListView> controls. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: - -- <xref:System.Windows.Forms.ListView.View%2A> - -- <xref:System.Windows.Forms.ListView.LabelEdit%2A> - -- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> - -- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> - -- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> - -- <xref:System.Windows.Forms.ListView.GridLines%2A> - -- <xref:System.Windows.Forms.ListView.Sorting%2A> - - You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListView> control is similar to a <xref:System.Windows.Forms.ListBox> in that it displays a list of items. The main difference is that the <xref:System.Windows.Forms.ListView> control provides a number of different ways items can be viewed by the user. The <xref:System.Windows.Forms.ListViewItem> class defines the appearance, behavior, and data associated with an item that is displayed in the <xref:System.Windows.Forms.ListView> control. <xref:System.Windows.Forms.ListViewItem> objects can be displayed in the <xref:System.Windows.Forms.ListView> control in one of four different views. Items can be displayed as large or small icons or as small icons in a vertical list. Items can also have subitems that contain information that is related to the parent item. The fourth view style, details view, allows you to display the item and its subitems in a grid with column headers that can be used to identify the information being displayed in a subitem. + + Most of the properties of the <xref:System.Windows.Forms.ListViewItem> class provide ways to change the display of the item in the <xref:System.Windows.Forms.ListView> control it is associated with. The <xref:System.Windows.Forms.ListViewItem.BackColor%2A>, <xref:System.Windows.Forms.ListViewItem.ForeColor%2A>, and <xref:System.Windows.Forms.ListViewItem.Font%2A> properties allow you to change how the text of the item is displayed in the <xref:System.Windows.Forms.ListView> control. The <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property allows you to specify the image to load from the <xref:System.Windows.Forms.ImageList> that is assigned to the <xref:System.Windows.Forms.ListView> control (by setting the <xref:System.Windows.Forms.ListView.LargeImageList%2A> or <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties of the <xref:System.Windows.Forms.ListView>). Items can display check boxes in order to obtain item choices from the user in a way similar to a <xref:System.Windows.Forms.CheckedListBox> control. You can use the <xref:System.Windows.Forms.ListViewItem.Checked%2A> property to determine if an item is checked, or to select or clear the check box at run time. Items can display any number of subitems when the <xref:System.Windows.Forms.ListView.View%2A> property of the associated <xref:System.Windows.Forms.ListView> control is set to <xref:System.Windows.Forms.View.Details> and columns are defined in the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection> of the <xref:System.Windows.Forms.ListView> control. You can add subitems to an item by calling the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection.Add%2A> method of the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class. The <xref:System.Windows.Forms.ListViewItem.SubItems%2A> property allows you to gain access to the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class and its members. + + Some of the properties and methods of the <xref:System.Windows.Forms.ListViewItem> class are item-specific versions of properties and methods in the <xref:System.Windows.Forms.ListView> control. For example, the <xref:System.Windows.Forms.ListViewItem.EnsureVisible%2A> method is similar to the <xref:System.Windows.Forms.ListView> version of the method, but the <xref:System.Windows.Forms.ListViewItem> version affects only the current item. + + The <xref:System.Windows.Forms.ListViewItem> class also provides methods that are not versions of <xref:System.Windows.Forms.ListView> methods. The <xref:System.Windows.Forms.ListViewItem.BeginEdit%2A> method places the item's text into edit mode so the user can change the item's text (when the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `true`). The <xref:System.Windows.Forms.ListViewItem.Clone%2A> method allows you to create copies of existing <xref:System.Windows.Forms.ListViewItem> objects to reuse in other <xref:System.Windows.Forms.ListView> controls. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: + +- <xref:System.Windows.Forms.ListView.View%2A> + +- <xref:System.Windows.Forms.ListView.LabelEdit%2A> + +- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> + +- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> + +- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> + +- <xref:System.Windows.Forms.ListView.GridLines%2A> + +- <xref:System.Windows.Forms.ListView.Sorting%2A> + + You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListView" /> <altmember cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" /> - <related type="Article" href="/dotnet/framework/winforms/controls/listview-control-windows-forms">ListView Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/listview-control-windows-forms">ListView Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -136,31 +136,31 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with default values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: - -- <xref:System.Windows.Forms.ListView.View%2A> - -- <xref:System.Windows.Forms.ListView.LabelEdit%2A> - -- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> - -- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> - -- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> - -- <xref:System.Windows.Forms.ListView.GridLines%2A> - -- <xref:System.Windows.Forms.ListView.Sorting%2A> - - You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: + +- <xref:System.Windows.Forms.ListView.View%2A> + +- <xref:System.Windows.Forms.ListView.LabelEdit%2A> + +- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> + +- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> + +- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> + +- <xref:System.Windows.Forms.ListView.GridLines%2A> + +- <xref:System.Windows.Forms.ListView.Sorting%2A> + + You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -199,11 +199,11 @@ <param name="text">The text to display for the item. This should not exceed 259 characters.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified item text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> </Docs> @@ -278,14 +278,14 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class and assigns it to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListView" /> @@ -352,11 +352,11 @@ <param name="imageIndex">The zero-based index of the image within the <see cref="T:System.Windows.Forms.ImageList" /> associated with the <see cref="T:System.Windows.Forms.ListView" /> that contains the item.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified item text and the image index position of the item's icon.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -392,13 +392,13 @@ <param name="imageKey">The name of the image within the <see cref="P:System.Windows.Forms.ListViewItem.ImageList" /> of the owning <see cref="T:System.Windows.Forms.ListView" /> to display in the <see cref="T:System.Windows.Forms.ListViewItem" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified text and image.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> </Docs> @@ -432,16 +432,16 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified item text and assigns it to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListView" /> @@ -525,11 +525,11 @@ <param name="imageKey">The name of the image within the <see cref="P:System.Windows.Forms.ListViewItem.ImageList" /> of the owning <see cref="T:System.Windows.Forms.ListView" /> to display in the <see cref="T:System.Windows.Forms.ListViewItem" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified item and subitem text and image.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + ]]></format> </remarks> </Docs> @@ -570,14 +570,14 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with an array of strings representing subitems, and assigns the item to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListView" /> @@ -613,11 +613,11 @@ <param name="imageIndex">The zero-based index of the image within the <see cref="T:System.Windows.Forms.ImageList" /> associated with the <see cref="T:System.Windows.Forms.ListView" /> that contains the item.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the image index position of the item's icon and an array of <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> (for example, to indicate special formatting or to use the subitems in multiple items). - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> (for example, to indicate special formatting or to use the subitems in multiple items). + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" /> @@ -661,11 +661,11 @@ <param name="imageKey">The name of the image within the <see cref="P:System.Windows.Forms.ListViewItem.ImageList" /> of the owning <see cref="T:System.Windows.Forms.ListView" /> to display in the <see cref="T:System.Windows.Forms.ListViewItem" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified subitems and image.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + ]]></format> </remarks> </Docs> @@ -701,16 +701,16 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified item text and the image index position of the item's icon, and assigns the item to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -749,18 +749,18 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified text, image, and group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - - The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + + The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + ]]></format> </remarks> </Docs> @@ -803,14 +803,14 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the image index position of the item's icon and an array of strings representing subitems, and assigns the item to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -856,16 +856,16 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with subitems containing the specified text, image, and group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> </Docs> @@ -908,14 +908,14 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the image index position of the item's icon and an array of <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" /> objects, and assigns the item to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> object (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> object (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -962,16 +962,16 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the specified subitems, image, and group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. - - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor is useful when you create <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects before adding them to a <xref:System.Windows.Forms.ListViewItem> (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. + + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> </Docs> @@ -1019,15 +1019,15 @@ <param name="font">A <see cref="T:System.Drawing.Font" /> that represents the font to display the item's text in.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the image index position of the item's icon; the foreground color, background color, and font of the item; and an array of strings representing subitems.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a form that contains a <xref:System.Windows.Forms.ListView> control that manually sorts items when a column in the <xref:System.Windows.Forms.ListView> control is clicked. The example defines a class called `ListViewItemComparer` that implements the <xref:System.Collections.IComparer?displayProperty=nameWithType> interface that performs the <xref:System.Windows.Forms.ListViewItem> comparison. The example creates an instance of `ListViewItemComparer` and uses it to set the <xref:System.Windows.Forms.ListView.ListViewItemSorter%2A> property of the <xref:System.Windows.Forms.ListView> control. The <xref:System.Windows.Forms.ListView.Sort%2A> method call in the <xref:System.Windows.Forms.ListView.ColumnClick> event handler uses the methods defined in `ListViewItemComparer` to perform the sort of items, based on the column that is clicked. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a form that contains a <xref:System.Windows.Forms.ListView> control that manually sorts items when a column in the <xref:System.Windows.Forms.ListView> control is clicked. The example defines a class called `ListViewItemComparer` that implements the <xref:System.Collections.IComparer?displayProperty=nameWithType> interface that performs the <xref:System.Windows.Forms.ListViewItem> comparison. The example creates an instance of `ListViewItemComparer` and uses it to set the <xref:System.Windows.Forms.ListView.ListViewItemSorter%2A> property of the <xref:System.Windows.Forms.ListView> control. The <xref:System.Windows.Forms.ListView.Sort%2A> method call in the <xref:System.Windows.Forms.ListView.ColumnClick> event handler uses the methods defined in `ListViewItemComparer` to perform the sort of items, based on the column that is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListView.ColumnClick/CPP/listviewsort1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Overview/listviewsort1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListView.ColumnClick/VB/listviewsort1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListView.ColumnClick/VB/listviewsort1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -1078,11 +1078,11 @@ <param name="font">A <see cref="T:System.Drawing.Font" /> to apply to the item text.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the subitems containing the specified text, image, colors, and font.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + ]]></format> </remarks> </Docs> @@ -1131,14 +1131,14 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the image index position of the item's icon; the foreground color, background color, and font of the item; and an array of strings representing subitems. Assigns the item to the specified group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -1192,16 +1192,16 @@ <param name="group">The <see cref="T:System.Windows.Forms.ListViewGroup" /> to assign the item to.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListViewItem" /> class with the subitems containing the specified text, image, colors, font, and group.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor allows you to specify the group to which an item belongs. - - The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor allows you to specify the group to which an item belongs. + + The `imageKey` parameter specifies an image in the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> associated with the owning <xref:System.Windows.Forms.ListView> control, which can be accessed with the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + ]]></format> </remarks> </Docs> @@ -1243,13 +1243,13 @@ <summary>Gets or sets the background color of the item's text.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the background color of the item's text.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to change the color displayed behind the item text. This property can be used if you want to use different background and foreground color combinations (using the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to set the foreground color) to differentiate one item from another. For example, you could set the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to <xref:System.Drawing.Color.Red%2A> to identify items that have failed validation or are missing subitem information. - - If you want to use the same background color for all subitems of an item, set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to change the color displayed behind the item text. This property can be used if you want to use different background and foreground color combinations (using the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to set the foreground color) to differentiate one item from another. For example, you could set the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to <xref:System.Drawing.Color.Red%2A> to identify items that have failed validation or are missing subitem information. + + If you want to use the same background color for all subitems of an item, set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Color" /> @@ -1283,11 +1283,11 @@ <Docs> <summary>Places the item text into edit mode.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is effective only if the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control that contains the item is set to `true`. You can use this method at run time to force the item's text to display in edit mode. For example, if you are validating the item text edited by the user, and an item fails validation, you could select the item in the <xref:System.Windows.Forms.ListView> control and call the <xref:System.Windows.Forms.ListViewItem.BeginEdit%2A> method to force the user to change the text that failed validation. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is effective only if the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control that contains the item is set to `true`. You can use this method at run time to force the item's text to display in edit mode. For example, if you are validating the item text edited by the user, and an item fails validation, you could select the item in the <xref:System.Windows.Forms.ListView> control and call the <xref:System.Windows.Forms.ListViewItem.BeginEdit%2A> method to force the user to change the text that failed validation. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Windows.Forms.ListView.LabelEdit" /> property of the associated <see cref="T:System.Windows.Forms.ListView" /> is not set to <see langword="true" />.</exception> @@ -1326,15 +1326,15 @@ <summary>Gets the bounding rectangle of the item, including subitems.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounding rectangle of the item.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to obtain the bounding rectangle of an entire item. If you want to obtain the bounding rectangle for a portion of the entire item, use the <xref:System.Windows.Forms.ListViewItem.GetBounds%2A> method. The <xref:System.Windows.Forms.ListView> class provides a <xref:System.Windows.Forms.ListView.GetItemRect%2A> method that allows you to get the bounding rectangle of any item located within the control. - - The returned bounding rectangle uses client control coordinates that are relative to the top-left corner of the currently visible area of the containing <xref:System.Windows.Forms.ListBox>. If the <xref:System.Windows.Forms.ListBox> is scrollable and positioned so that the <xref:System.Windows.Forms.ListViewItem> is not visible, the coordinates returned may be negative. - - When the <xref:System.Windows.Forms.ListView.View%2A?displayProperty=nameWithType> property has a value of <xref:System.Windows.Forms.View.List>, the width of the bounding rectangle is the width of the column containing the item, not the width of the text in the item. If the <xref:System.Windows.Forms.ListView.Columns%2A?displayProperty=nameWithType> collection does not contain any columns, the default column width of 60 pixels is used. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to obtain the bounding rectangle of an entire item. If you want to obtain the bounding rectangle for a portion of the entire item, use the <xref:System.Windows.Forms.ListViewItem.GetBounds%2A> method. The <xref:System.Windows.Forms.ListView> class provides a <xref:System.Windows.Forms.ListView.GetItemRect%2A> method that allows you to get the bounding rectangle of any item located within the control. + + The returned bounding rectangle uses client control coordinates that are relative to the top-left corner of the currently visible area of the containing <xref:System.Windows.Forms.ListBox>. If the <xref:System.Windows.Forms.ListBox> is scrollable and positioned so that the <xref:System.Windows.Forms.ListViewItem> is not visible, the coordinates returned may be negative. + + When the <xref:System.Windows.Forms.ListView.View%2A?displayProperty=nameWithType> property has a value of <xref:System.Windows.Forms.View.List>, the width of the bounding rectangle is the width of the column containing the item, not the width of the text in the item. If the <xref:System.Windows.Forms.ListView.Columns%2A?displayProperty=nameWithType> collection does not contain any columns, the default column width of 60 pixels is used. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Rectangle" /> @@ -1383,36 +1383,36 @@ <value> <see langword="true" /> if the item is checked; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is useful only if the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.ListView> control the item is contained in is set to `true`. You can use this property to determine if the item has been checked by the user or through code at run time. To determine all the items that are checked in a <xref:System.Windows.Forms.ListView> control, you can use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property. To take action when an item has been checked, you can create an event handler for the <xref:System.Windows.Forms.ListView.ItemCheck> property of the <xref:System.Windows.Forms.ListView> control. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: - -- <xref:System.Windows.Forms.ListView.View%2A> - -- <xref:System.Windows.Forms.ListView.LabelEdit%2A> - -- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> - -- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> - -- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> - -- <xref:System.Windows.Forms.ListView.GridLines%2A> - -- <xref:System.Windows.Forms.ListView.Sorting%2A> - - You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is useful only if the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.ListView> control the item is contained in is set to `true`. You can use this property to determine if the item has been checked by the user or through code at run time. To determine all the items that are checked in a <xref:System.Windows.Forms.ListView> control, you can use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property. To take action when an item has been checked, you can create an event handler for the <xref:System.Windows.Forms.ListView.ItemCheck> property of the <xref:System.Windows.Forms.ListView> control. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: + +- <xref:System.Windows.Forms.ListView.View%2A> + +- <xref:System.Windows.Forms.ListView.LabelEdit%2A> + +- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> + +- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> + +- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> + +- <xref:System.Windows.Forms.ListView.GridLines%2A> + +- <xref:System.Windows.Forms.ListView.Sorting%2A> + + You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListView.CheckBoxes" /> @@ -1451,11 +1451,11 @@ <summary>Creates an identical copy of the item.</summary> <returns>An object that represents an item that has the same text, image, and subitems associated with it as the cloned item.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to create a new instance of the <xref:System.Windows.Forms.ListViewItem> class based on an existing item. Even the subitems of the item being cloned are specified for the new version. This feature is useful if you want to reuse a <xref:System.Windows.Forms.ListViewItem> in more than one <xref:System.Windows.Forms.ListView> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to create a new instance of the <xref:System.Windows.Forms.ListViewItem> class based on an existing item. Even the subitems of the item being cloned are specified for the new version. This feature is useful if you want to reuse a <xref:System.Windows.Forms.ListViewItem> in more than one <xref:System.Windows.Forms.ListView> control. + ]]></format> </remarks> </Docs> @@ -1527,13 +1527,13 @@ <Docs> <summary>Ensures that the item is visible within the control, scrolling the contents of the control, if necessary.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to ensure that the item is visible within the <xref:System.Windows.Forms.ListView> control. This method can be used when performing validation on the item. You can call the <xref:System.Windows.Forms.ListViewItem.EnsureVisible%2A> method to ensure that the item is displayed in the <xref:System.Windows.Forms.ListView> control if it failed validation, to allow the user to perform changes on the item. - - This method is similar to the <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method of the <xref:System.Windows.Forms.ListView> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to ensure that the item is visible within the <xref:System.Windows.Forms.ListView> control. This method can be used when performing validation on the item. You can call the <xref:System.Windows.Forms.ListViewItem.EnsureVisible%2A> method to ensure that the item is displayed in the <xref:System.Windows.Forms.ListView> control if it failed validation, to allow the user to perform changes on the item. + + This method is similar to the <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method of the <xref:System.Windows.Forms.ListView> control. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ListView.EnsureVisible(System.Int32)" /> @@ -1570,21 +1570,21 @@ <summary>Finds the next item from the <see cref="T:System.Windows.Forms.ListViewItem" />, searching in the specified direction.</summary> <returns>The <see cref="T:System.Windows.Forms.ListViewItem" /> that is closest to the given coordinates, searching in the specified direction.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A> method returns `null` if no item is found in the given direction. - - Identifying the nearest item can vary depending on the operating system the application is running on and will affect the results of <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A>. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A> method. To run this example, paste the following code into a Windows Form that contains a <xref:System.Windows.Forms.ListView> named `findListView`. Ensure that the <xref:System.Windows.Forms.ListView.View%2A> property is set to an icon view and that the <xref:System.Windows.Forms.ListView> is populated with items. Associate the <xref:System.Windows.Forms.Control.MouseDown> event of `findListView` with the `findListView_MouseDown` method in this example. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A> method returns `null` if no item is found in the given direction. + + Identifying the nearest item can vary depending on the operating system the application is running on and will affect the results of <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A>. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.FindNearestItem%2A> method. To run this example, paste the following code into a Windows Form that contains a <xref:System.Windows.Forms.ListView> named `findListView`. Ensure that the <xref:System.Windows.Forms.ListView.View%2A> property is set to an icon view and that the <xref:System.Windows.Forms.ListView> is populated with items. Associate the <xref:System.Windows.Forms.Control.MouseDown> event of `findListView` with the `findListView_MouseDown` method in this example. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Windows.Forms.ListView.View" /> property of the containing <see cref="T:System.Windows.Forms.ListView" /> is set to a value other than <see cref="F:System.Windows.Forms.View.SmallIcon" /> or <see cref="F:System.Windows.Forms.View.LargeIcon" />.</exception> @@ -1632,13 +1632,13 @@ <value> <see langword="true" /> if the item has focus; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Because a <xref:System.Windows.Forms.ListView> control does not have directly editable areas - only items contained in the <xref:System.Windows.Forms.ListView> can be edited - the text of an item in the <xref:System.Windows.Forms.ListView> will display the focus reticle when the <xref:System.Windows.Forms.ListView> has focus. Typically, the last selected item in the <xref:System.Windows.Forms.ListView> control is the item with focus. Although an item may display the focus reticle, it might not actually be a selected item in the <xref:System.Windows.Forms.ListView>. You can use the <xref:System.Windows.Forms.ListViewItem.Focused%2A> property to determine if the item is currently the focused item in the <xref:System.Windows.Forms.ListView> control that contains it. If the <xref:System.Windows.Forms.ListViewItem> is not associated with a <xref:System.Windows.Forms.ListView> control, this property will return `false`. - - The <xref:System.Windows.Forms.ListView> control provides the <xref:System.Windows.Forms.ListView.FocusedItem%2A> property to allow you to determine which <xref:System.Windows.Forms.ListViewItem> in the <xref:System.Windows.Forms.ListView> has the focus. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Because a <xref:System.Windows.Forms.ListView> control does not have directly editable areas - only items contained in the <xref:System.Windows.Forms.ListView> can be edited - the text of an item in the <xref:System.Windows.Forms.ListView> will display the focus reticle when the <xref:System.Windows.Forms.ListView> has focus. Typically, the last selected item in the <xref:System.Windows.Forms.ListView> control is the item with focus. Although an item may display the focus reticle, it might not actually be a selected item in the <xref:System.Windows.Forms.ListView>. You can use the <xref:System.Windows.Forms.ListViewItem.Focused%2A> property to determine if the item is currently the focused item in the <xref:System.Windows.Forms.ListView> control that contains it. If the <xref:System.Windows.Forms.ListViewItem> is not associated with a <xref:System.Windows.Forms.ListView> control, this property will return `false`. + + The <xref:System.Windows.Forms.ListView> control provides the <xref:System.Windows.Forms.ListView.FocusedItem%2A> property to allow you to determine which <xref:System.Windows.Forms.ListViewItem> in the <xref:System.Windows.Forms.ListView> has the focus. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListView.FocusedItem" /> @@ -1685,26 +1685,26 @@ <summary>Gets or sets the font of the text displayed by the item.</summary> <value>The <see cref="T:System.Drawing.Font" /> to apply to the text displayed by the control. The default is the value of the <see cref="P:System.Windows.Forms.Control.DefaultFont" /> property if the <see cref="T:System.Windows.Forms.ListViewItem" /> is not associated with a <see cref="T:System.Windows.Forms.ListView" /> control; otherwise, the font specified in the <see cref="P:System.Windows.Forms.Control.Font" /> property for the <see cref="T:System.Windows.Forms.ListView" /> control is used.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to change the font styles applied to the text of the item. Because a <xref:System.Drawing.Font> is immutable (you cannot adjust any of its properties), you can only assign the <xref:System.Windows.Forms.Control.Font%2A> property a new <xref:System.Drawing.Font>. However, you can base the new font on the existing font. - - - -## Examples - The following code example shows how to adjust the existing font to make it bold. - -```csharp -listViewItem1.Font = new Font(listViewItem1.Font, - listViewItem1.Font.Style | FontStyle.Bold); -``` - -```vb -ListViewItem1.Font = New Font(ListViewItem1.Font, _ - ListViewItem1.Font.Style Or FontStyle.Bold) -``` - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to change the font styles applied to the text of the item. Because a <xref:System.Drawing.Font> is immutable (you cannot adjust any of its properties), you can only assign the <xref:System.Windows.Forms.Control.Font%2A> property a new <xref:System.Drawing.Font>. However, you can base the new font on the existing font. + + + +## Examples + The following code example shows how to adjust the existing font to make it bold. + +```csharp +listViewItem1.Font = new Font(listViewItem1.Font, + listViewItem1.Font.Style | FontStyle.Bold); +``` + +```vb +ListViewItem1.Font = New Font(ListViewItem1.Font, _ + ListViewItem1.Font.Style Or FontStyle.Bold) +``` + ]]></format> </remarks> </Docs> @@ -1746,13 +1746,13 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ <summary>Gets or sets the foreground color of the item's text.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the foreground color of the item's text.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to change the color of the item text. This property can be used if you want to use different background and foreground color combinations (using the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to set the background color) to differentiate one item from another. For example, you could set the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to <xref:System.Drawing.Color.Red%2A> to identify items that have a negative number associated with them or have failed item validation. - - If you want to use the same foreground color for all subitems of an item, set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to change the color of the item text. This property can be used if you want to use different background and foreground color combinations (using the <xref:System.Windows.Forms.ListViewItem.BackColor%2A> property to set the background color) to differentiate one item from another. For example, you could set the <xref:System.Windows.Forms.ListViewItem.ForeColor%2A> property to <xref:System.Drawing.Color.Red%2A> to identify items that have a negative number associated with them or have failed item validation. + + If you want to use the same foreground color for all subitems of an item, set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Color" /> @@ -1790,11 +1790,11 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ <summary>Retrieves the specified portion of the bounding rectangle for the item.</summary> <returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounding rectangle for the specified portion of the item.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The bounding rectangle returned by the <xref:System.Windows.Forms.ListViewItem.GetBounds%2A> method represents only the section of the item specified in the `portion` parameter. You can also call the <xref:System.Windows.Forms.ListView.GetItemRect%2A> methods of the <xref:System.Windows.Forms.ListView> class to obtain the bounding rectangle of any item in a <xref:System.Windows.Forms.ListView> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The bounding rectangle returned by the <xref:System.Windows.Forms.ListViewItem.GetBounds%2A> method represents only the section of the item specified in the `portion` parameter. You can also call the <xref:System.Windows.Forms.ListView.GetItemRect%2A> methods of the <xref:System.Windows.Forms.ListView> class to obtain the bounding rectangle of any item in a <xref:System.Windows.Forms.ListView> control. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ListView.GetItemRect(System.Int32)" /> @@ -1833,19 +1833,19 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ <summary>Returns the subitem of the <see cref="T:System.Windows.Forms.ListViewItem" /> at the specified coordinates.</summary> <returns>The <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" /> at the specified x- and y-coordinates.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.GetSubItemAt%2A> method will return `null` if the <xref:System.Windows.Forms.ListView> is not in <xref:System.Windows.Forms.View.Details> view, or there is not a <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> located at the specified point. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.GetSubItemAt%2A> method. To run this code, paste it into a Windows Form and call `InitializeListView1` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.GetSubItemAt%2A> method will return `null` if the <xref:System.Windows.Forms.ListView> is not in <xref:System.Windows.Forms.View.Details> view, or there is not a <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> located at the specified point. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.GetSubItemAt%2A> method. To run this code, paste it into a Windows Form and call `InitializeListView1` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> @@ -1895,25 +1895,25 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ <summary>Gets or sets the group to which the item is assigned.</summary> <value>The <see cref="T:System.Windows.Forms.ListViewGroup" /> to which the item is assigned.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to set the group to which an item belongs. You can also set the group in the <xref:System.Windows.Forms.ListViewItem.%23ctor%2A> constructor, or you can use this property to modify the group membership at run time. If you set this property to `null` and there are groups in the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> collection, the item will appear in the default group, which has the header label "DefaultGroupSystem.Windows.Forms". The default group is not contained in the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to set the group to which an item belongs. You can also set the group in the <xref:System.Windows.Forms.ListViewItem.%23ctor%2A> constructor, or you can use this property to modify the group membership at run time. If you set this property to `null` and there are groups in the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> collection, the item will appear in the default group, which has the header label "DefaultGroupSystem.Windows.Forms". The default group is not contained in the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups. + > [!NOTE] -> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. - - - -## Examples - The following code example demonstrates how the <xref:System.Windows.Forms.ListViewItem.Group%2A> property can be used in an application that organizes <xref:System.Windows.Forms.ListView> items by subitem value in the details view. This form of grouping is similar to the grouping used in Windows Explorer. In the example, the groups are created dynamically. For each subitem column, one group is created for each unique subitem value. For the parent item column, one group is created for each unique initial letter. The groups created for each column are stored in a hash table along with the subitem text or initial letter. When a column header is clicked, the hash table corresponding to that column is retrieved. Next, the subitem text values for that column are used as hash table keys to retrieve the correct group for each item. The item is then assigned to the group using the <xref:System.Windows.Forms.ListViewItem.Group%2A> property. - - This code example is part of a larger example provided for the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> property. - +> <xref:System.Windows.Forms.ListView> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the <xref:System.Windows.Forms.ListViewGroup> overview topic. + + + +## Examples + The following code example demonstrates how the <xref:System.Windows.Forms.ListViewItem.Group%2A> property can be used in an application that organizes <xref:System.Windows.Forms.ListView> items by subitem value in the details view. This form of grouping is similar to the grouping used in Windows Explorer. In the example, the groups are created dynamically. For each subitem column, one group is created for each unique subitem value. For the parent item column, one group is created for each unique initial letter. The groups created for each column are stored in a hash table along with the subitem text or initial letter. When a column header is clicked, the hash table corresponding to that column is retrieved. Next, the subitem text values for that column are used as hash table keys to retrieve the correct group for each item. The item is then assigned to the group using the <xref:System.Windows.Forms.ListViewItem.Group%2A> property. + + This code example is part of a larger example provided for the <xref:System.Windows.Forms.ListView.Groups%2A?displayProperty=nameWithType> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/CPP/listviewgroupsexample.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/Groups/listviewgroupsexample.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/VB/listviewgroupsexample.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/VB/listviewgroupsexample.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListViewGroup" /> @@ -1992,17 +1992,17 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ <summary>Gets or sets the index of the image that is displayed for the item.</summary> <value>The zero-based index of the image in the <see cref="T:System.Windows.Forms.ImageList" /> that is displayed for the item. The default is -1.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks The value of this property depends on the value of the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. Depending on the current value of the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control associated with the item, the <xref:System.Windows.Forms.ImageList> used by the item could be one specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property or the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property of the <xref:System.Windows.Forms.ListView> control. If the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon>, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property is used; otherwise, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property is used. The images defined in the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property should have the same index positions as the images in the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property. If the index positions are the same for both <xref:System.Windows.Forms.ImageList> controls, you can set a single index value for the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property and the appropriate image will be displayed regardless of the value of the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control. - + <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> and <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> is automatically set to an empty string (""). - +If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> is automatically set to an empty string (""). + If the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property value is changed to `null`, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property returns its default value, -1. However, the assigned <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> value is retained internally and used when another <xref:System.Windows.Forms.ImageList> object is assigned to the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property. If the new <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.ListViewItem.ImageList%2A> property has an <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A?displayProperty=nameWithType> property value that is less than or equal to the value assigned to the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property minus one (to account for the collection being a zero-based index), the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property value is adjusted to one less than the <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A> property value. -For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> value changes to 1. - +For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> value changes to 1. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -2076,15 +2076,15 @@ For example, consider a button control whose <xref:System.Windows.Forms.ImageLis <summary>Gets or sets the key for the image that is displayed for the item.</summary> <value>The key for the image that is displayed for the <see cref="T:System.Windows.Forms.ListViewItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> and <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> is automatically set to an empty string (""). - +If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property, the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> is automatically set to an empty string (""). + > [!NOTE] -> If you are using multiple image lists, for small and large icon view, with a <xref:System.Windows.Forms.ListView> control, you should place small and large versions of the image at the same index location in their respective image lists. When switching between views, the index location of the image in one list is used to locate the image in the other list, regardless of the key value specified. - +> If you are using multiple image lists, for small and large icon view, with a <xref:System.Windows.Forms.ListView> control, you should place small and large versions of the image at the same index location in their respective image lists. When switching between views, the index location of the image in one list is used to locate the image in the other list, regardless of the key value specified. + ]]></format> </remarks> </Docs> @@ -2127,11 +2127,11 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets the <see cref="T:System.Windows.Forms.ImageList" /> that contains the image displayed with the item.</summary> <value>The <see cref="T:System.Windows.Forms.ImageList" /> used by the <see cref="T:System.Windows.Forms.ListView" /> control that contains the image displayed with the item.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Depending on the current value of the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control associated with the item, the <xref:System.Windows.Forms.ImageList> used by the item could be one specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property or the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property of the <xref:System.Windows.Forms.ListView> control. If the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon>, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property is used; otherwise, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property is used. You can use this property to determine which <xref:System.Windows.Forms.ImageList> control is providing the image for the item. To determine the index position in the <xref:System.Windows.Forms.ImageList> that contains the image to display for the item, use the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Depending on the current value of the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control associated with the item, the <xref:System.Windows.Forms.ImageList> used by the item could be one specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property or the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property of the <xref:System.Windows.Forms.ListView> control. If the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon>, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.LargeImageList%2A> property is used; otherwise, the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property is used. You can use this property to determine which <xref:System.Windows.Forms.ImageList> control is providing the image for the item. To determine the index position in the <xref:System.Windows.Forms.ImageList> that contains the image to display for the item, use the <xref:System.Windows.Forms.ListViewItem.ImageIndex%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListViewItem.ImageIndex" /> @@ -2173,19 +2173,19 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the number of small image widths by which to indent the <see cref="T:System.Windows.Forms.ListViewItem" />.</summary> <value>The number of small image widths by which to indent the <see cref="T:System.Windows.Forms.ListViewItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.IndentCount%2A> property can be used only when the <xref:System.Windows.Forms.ListView.View%2A> property of the containing <xref:System.Windows.Forms.ListView> is set to <xref:System.Windows.Forms.View.Details>, and the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property of the <xref:System.Windows.Forms.ListView> is set. - - - -## Examples - The following code example demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.IndentCount%2A> property. To run this example, paste the following code into a Windows Form and call the `InitializeIndentedListViewItems` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.IndentCount%2A> property can be used only when the <xref:System.Windows.Forms.ListView.View%2A> property of the containing <xref:System.Windows.Forms.ListView> is set to <xref:System.Windows.Forms.View.Details>, and the <xref:System.Windows.Forms.ListView.SmallImageList%2A> property of the <xref:System.Windows.Forms.ListView> is set. + + + +## Examples + The following code example demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.IndentCount%2A> property. To run this example, paste the following code into a Windows Form and call the `InitializeIndentedListViewItems` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">When setting <see cref="P:System.Windows.Forms.ListViewItem.IndentCount" />, the number specified is less than 0.</exception> @@ -2224,11 +2224,11 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets the zero-based index of the item within the <see cref="T:System.Windows.Forms.ListView" /> control.</summary> <value>The zero-based index of the item within the <see cref="T:System.Windows.Forms.ListView.ListViewItemCollection" /> of the <see cref="T:System.Windows.Forms.ListView" /> control, or -1 if the item is not associated with a <see cref="T:System.Windows.Forms.ListView" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to determine if the item is associated with a <xref:System.Windows.Forms.ListView> control as well as to determine its position within the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of the <xref:System.Windows.Forms.ListView>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to determine if the item is associated with a <xref:System.Windows.Forms.ListView> control as well as to determine its position within the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of the <xref:System.Windows.Forms.ListView>. + ]]></format> </remarks> </Docs> @@ -2275,11 +2275,11 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets the <see cref="T:System.Windows.Forms.ListView" /> control that contains the item.</summary> <value>A <see cref="T:System.Windows.Forms.ListView" /> that contains the <see cref="T:System.Windows.Forms.ListViewItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to access the <xref:System.Windows.Forms.ListView> control that owns the <xref:System.Windows.Forms.ListViewItem>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to access the <xref:System.Windows.Forms.ListView> control that owns the <xref:System.Windows.Forms.ListViewItem>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListView" /> @@ -2329,11 +2329,11 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the name associated with this <see cref="T:System.Windows.Forms.ListViewItem" />.</summary> <value>The name of the <see cref="T:System.Windows.Forms.ListViewItem" />. The default is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of the <xref:System.Windows.Forms.ListViewItem.Name%2A> property is also the key for the <xref:System.Windows.Forms.ListViewItem> when the item is accessed in a collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of the <xref:System.Windows.Forms.ListViewItem.Name%2A> property is also the key for the <xref:System.Windows.Forms.ListViewItem> when the item is accessed in a collection. + ]]></format> </remarks> </Docs> @@ -2378,19 +2378,19 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the position of the upper-left corner of the <see cref="T:System.Windows.Forms.ListViewItem" />.</summary> <value>The <see cref="T:System.Drawing.Point" /> at the upper-left corner of the <see cref="T:System.Windows.Forms.ListViewItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.Position%2A> property should be set after the <xref:System.Windows.Forms.ListViewItem> and containing <xref:System.Windows.Forms.ListView> are constructed. Changing the <xref:System.Windows.Forms.ListViewItem.Position%2A> property when the containing <xref:System.Windows.Forms.ListView> is in <xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.List> view will have no effect on the position of the items. Also, the <xref:System.Windows.Forms.ListViewItem.Position%2A> property will automatically change when the <xref:System.Windows.Forms.ListView.View%2A> property of the containing <xref:System.Windows.Forms.ListView> is changed from <xref:System.Windows.Forms.View.SmallIcon>, <xref:System.Windows.Forms.View.LargeIcon>, or <xref:System.Windows.Forms.View.Tile> view to <xref:System.Windows.Forms.View.List> or <xref:System.Windows.Forms.View.Details>. When the <xref:System.Windows.Forms.ListView> is in <xref:System.Windows.Forms.View.SmallIcon>, <xref:System.Windows.Forms.View.LargeIcon>, or <xref:System.Windows.Forms.View.Tile> view, setting the <xref:System.Windows.Forms.ListViewItem.Position%2A> property for an item will cause the other items contained in the <xref:System.Windows.Forms.ListView> to be rearranged. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.Position%2A> property of a <xref:System.Windows.Forms.ListViewItem>. To run this example, paste the following code into a Windows Form and call the `InitializePositionedListViewItems` from the form's <xref:System.Windows.Forms.Form.Load> event-handling method. Click the button to see the items repositioned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.Position%2A> property should be set after the <xref:System.Windows.Forms.ListViewItem> and containing <xref:System.Windows.Forms.ListView> are constructed. Changing the <xref:System.Windows.Forms.ListViewItem.Position%2A> property when the containing <xref:System.Windows.Forms.ListView> is in <xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.List> view will have no effect on the position of the items. Also, the <xref:System.Windows.Forms.ListViewItem.Position%2A> property will automatically change when the <xref:System.Windows.Forms.ListView.View%2A> property of the containing <xref:System.Windows.Forms.ListView> is changed from <xref:System.Windows.Forms.View.SmallIcon>, <xref:System.Windows.Forms.View.LargeIcon>, or <xref:System.Windows.Forms.View.Tile> view to <xref:System.Windows.Forms.View.List> or <xref:System.Windows.Forms.View.Details>. When the <xref:System.Windows.Forms.ListView> is in <xref:System.Windows.Forms.View.SmallIcon>, <xref:System.Windows.Forms.View.LargeIcon>, or <xref:System.Windows.Forms.View.Tile> view, setting the <xref:System.Windows.Forms.ListViewItem.Position%2A> property for an item will cause the other items contained in the <xref:System.Windows.Forms.ListView> to be rearranged. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.ListViewItem.Position%2A> property of a <xref:System.Windows.Forms.ListViewItem>. To run this example, paste the following code into a Windows Form and call the `InitializePositionedListViewItems` from the form's <xref:System.Windows.Forms.Form.Load> event-handling method. Click the button to see the items repositioned. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Windows.Forms.ListViewItem.Position" /> is set when the containing <see cref="T:System.Windows.Forms.ListView" /> is in virtual mode.</exception> @@ -2426,11 +2426,11 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <Docs> <summary>Removes the item from its associated <see cref="T:System.Windows.Forms.ListView" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is similar in function to the <xref:System.Windows.Forms.ListView.ListViewItemCollection.Remove%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> in the <xref:System.Windows.Forms.ListView> control that contains the item. You can use the <xref:System.Windows.Forms.ListViewItem.Remove%2A> method to remove an item from its <xref:System.Windows.Forms.ListView> control. This feature can be useful if you want to move the item to a different <xref:System.Windows.Forms.ListView> control or need to remove the item based on a request from the user to remove the item from within your application. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is similar in function to the <xref:System.Windows.Forms.ListView.ListViewItemCollection.Remove%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> in the <xref:System.Windows.Forms.ListView> control that contains the item. You can use the <xref:System.Windows.Forms.ListViewItem.Remove%2A> method to remove an item from its <xref:System.Windows.Forms.ListView> control. This feature can be useful if you want to move the item to a different <xref:System.Windows.Forms.ListView> control or need to remove the item based on a request from the user to remove the item from within your application. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.Remove(System.Windows.Forms.ListViewItem)" /> @@ -2479,23 +2479,23 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <value> <see langword="true" /> if the item is selected; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property of the <xref:System.Windows.Forms.ListView> control the item is contained in is set to `true`, setting the value of this property adds or removes the item from the set of selected items. If the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property is set to `false`, setting the value of this property to select an item automatically cancels the selection for any other items in the <xref:System.Windows.Forms.ListView> control. You can use this property to determine if an item is selected or to select an item at run time. You can access all items that are selected in a <xref:System.Windows.Forms.ListView> control by using the <xref:System.Windows.Forms.ListView.SelectedItems%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property of the <xref:System.Windows.Forms.ListView> control the item is contained in is set to `true`, setting the value of this property adds or removes the item from the set of selected items. If the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property is set to `false`, setting the value of this property to select an item automatically cancels the selection for any other items in the <xref:System.Windows.Forms.ListView> control. You can use this property to determine if an item is selected or to select an item at run time. You can access all items that are selected in a <xref:System.Windows.Forms.ListView> control by using the <xref:System.Windows.Forms.ListView.SelectedItems%2A?displayProperty=nameWithType> property. + > [!NOTE] -> Items appear selected only when the <xref:System.Windows.Forms.ListView> control has focus. To select items in response to a user action such as a button click, be sure to call the <xref:System.Windows.Forms.Control.Focus%2A> method in addition to setting this property. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.Clear%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ListViewItem.Selected%2A> members. To run the example, place the following code in a form containing a <xref:System.Windows.Forms.ListView> named `ListView1` and a <xref:System.Windows.Forms.Button>, located toward the bottom of the form, named `Button1`. Call the `InitializeListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - +> Items appear selected only when the <xref:System.Windows.Forms.ListView> control has focus. To select items in response to a user action such as a button click, be sure to call the <xref:System.Windows.Forms.Control.Focus%2A> method in addition to setting this property. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.Clear%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ListViewItem.Selected%2A> members. To run the example, place the following code in a form containing a <xref:System.Windows.Forms.ListView> named `ListView1` and a <xref:System.Windows.Forms.Button>, located toward the bottom of the form, named `Button1`. Call the `InitializeListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView4/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/Clear/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView4/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView4/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListView.SelectedItems" /> @@ -2611,20 +2611,20 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the index of the state image (an image such as a selected or cleared check box that indicates the state of the item) that is displayed for the item.</summary> <value>The zero-based index of the state image in the <see cref="T:System.Windows.Forms.ImageList" /> that is displayed for the item.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property allows you to specify the index into the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.ListView.StateImageList%2A> property of the associated <xref:System.Windows.Forms.ListView> control, where the state images to display to the left of the item are stored. Typically, the state image is a selected or cleared check box or an image that is intended to represent selected or cleared states for the item. If no value is specified for the <xref:System.Windows.Forms.ListView.StateImageList%2A> property, the <xref:System.Windows.Forms.ListView> control displays a default selected or cleared check box when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the control is set to `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property allows you to specify the index into the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.ListView.StateImageList%2A> property of the associated <xref:System.Windows.Forms.ListView> control, where the state images to display to the left of the item are stored. Typically, the state image is a selected or cleared check box or an image that is intended to represent selected or cleared states for the item. If no value is specified for the <xref:System.Windows.Forms.ListView.StateImageList%2A> property, the <xref:System.Windows.Forms.ListView> control displays a default selected or cleared check box when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the control is set to `true`. + > [!NOTE] -> Although the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.StateImageList%2A> property can contain any number of images, and the <xref:System.Windows.Forms.ListViewItem.StateImageIndex%2A> property can be set to any value equal to or lower than 14, only the images at index positions 0 and 1 are displayed as state images. - +> Although the <xref:System.Windows.Forms.ImageList> specified in the <xref:System.Windows.Forms.ListView.StateImageList%2A> property can contain any number of images, and the <xref:System.Windows.Forms.ListViewItem.StateImageIndex%2A> property can be set to any value equal to or lower than 14, only the images at index positions 0 and 1 are displayed as state images. + ]]></format> </remarks> - <exception cref="T:System.ArgumentOutOfRangeException">The value specified for this property is less than -1. - - -or- - + <exception cref="T:System.ArgumentOutOfRangeException">The value specified for this property is less than -1. + + -or- + The value specified for this property is greater than 14.</exception> <altmember cref="P:System.Windows.Forms.ListView.StateImageList" /> </Docs> @@ -2674,39 +2674,39 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets a collection containing all subitems of the item.</summary> <value>A <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItemCollection" /> that contains the subitems.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Using the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection>, you can add subitems, remove subitems, and obtain a count of subitems. For more information on the tasks that can be performed with the subitems in the collection, see the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class reference topics. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Using the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection>, you can add subitems, remove subitems, and obtain a count of subitems. For more information on the tasks that can be performed with the subitems in the collection, see the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> class reference topics. + > [!NOTE] -> The first subitem in the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> is always the item that owns the subitems. When performing operations on subitems in the collection, be sure to reference index position 1 instead of 0 to make changes to the first subitem. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: - -- <xref:System.Windows.Forms.ListView.View%2A> - -- <xref:System.Windows.Forms.ListView.LabelEdit%2A> - -- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> - -- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> - -- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> - -- <xref:System.Windows.Forms.ListView.GridLines%2A> - -- <xref:System.Windows.Forms.ListView.Sorting%2A> - - You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - +> The first subitem in the <xref:System.Windows.Forms.ListViewItem.ListViewSubItemCollection> is always the item that owns the subitems. When performing operations on subitems in the collection, be sure to reference index position 1 instead of 0 to make changes to the first subitem. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control: + +- <xref:System.Windows.Forms.ListView.View%2A> + +- <xref:System.Windows.Forms.ListView.LabelEdit%2A> + +- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> + +- <xref:System.Windows.Forms.ListView.CheckBoxes%2A> + +- <xref:System.Windows.Forms.ListView.FullRowSelect%2A> + +- <xref:System.Windows.Forms.ListView.GridLines%2A> + +- <xref:System.Windows.Forms.ListView.Sorting%2A> + + You need to add the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ListViewItem.ListViewSubItemCollection" /> @@ -2813,20 +2813,20 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets an object that contains data to associate with the item.</summary> <value>An object that contains information that is associated with the item.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.Tag%2A> property can be used to store any object that you want to associate with an item. Although you can store any item, the <xref:System.Windows.Forms.ListViewItem.Tag%2A> property is typically used to store string information about the item, such as a unique identifier or the index position of the item's data in a database. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ListViewItem> and set the <xref:System.Windows.Forms.ListViewItem.Tag%2A> and <xref:System.Windows.Forms.ListViewItem.Text%2A> properties. To run this example, place the following code in a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1`, and call `InitializeListViewItems` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.Tag%2A> property can be used to store any object that you want to associate with an item. Although you can store any item, the <xref:System.Windows.Forms.ListViewItem.Tag%2A> property is typically used to store string information about the item, such as a unique identifier or the index position of the item's data in a database. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ListViewItem> and set the <xref:System.Windows.Forms.ListViewItem.Tag%2A> and <xref:System.Windows.Forms.ListViewItem.Text%2A> properties. To run this example, place the following code in a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1`, and call `InitializeListViewItems` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListViewItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2872,22 +2872,22 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the text of the item.</summary> <value>The text to display for the item. This should not exceed 259 characters.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ListViewItem.Text%2A> property allows you to change the text displayed for the item. The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. - - You can use the <xref:System.Windows.Forms.ListViewItem.BackColor%2A>, <xref:System.Windows.Forms.ListViewItem.ForeColor%2A>, and <xref:System.Windows.Forms.ListViewItem.Font%2A> properties to specify how the text is displayed. The <xref:System.Windows.Forms.ListView> class provides the <xref:System.Windows.Forms.ListView.LabelWrap%2A> property that determines whether text wraps to the next line or is displayed on a single line. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ListViewItem> and set the <xref:System.Windows.Forms.ListViewItem.Tag%2A> and <xref:System.Windows.Forms.ListViewItem.Text%2A> properties. To run this example, place the following code in a form containing a <xref:System.Windows.Forms.ListView> named `ListView1`, and call `InitializeListViewItems` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ListViewItem.Text%2A> property allows you to change the text displayed for the item. The text of the <xref:System.Windows.Forms.ListViewItem> should not exceed 259 characters or unexpected behavior could occur. + + You can use the <xref:System.Windows.Forms.ListViewItem.BackColor%2A>, <xref:System.Windows.Forms.ListViewItem.ForeColor%2A>, and <xref:System.Windows.Forms.ListViewItem.Font%2A> properties to specify how the text is displayed. The <xref:System.Windows.Forms.ListView> class provides the <xref:System.Windows.Forms.ListView.LabelWrap%2A> property that determines whether text wraps to the next line or is displayed on a single line. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ListViewItem> and set the <xref:System.Windows.Forms.ListViewItem.Tag%2A> and <xref:System.Windows.Forms.ListViewItem.Text%2A> properties. To run this example, place the following code in a form containing a <xref:System.Windows.Forms.ListView> named `ListView1`, and call `InitializeListViewItems` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListViewItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListViewItem.BackColor" /> @@ -2932,19 +2932,19 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <summary>Gets or sets the text shown when the mouse pointer rests on the <see cref="T:System.Windows.Forms.ListViewItem" />.</summary> <value>The text shown when the mouse pointer rests on the <see cref="T:System.Windows.Forms.ListViewItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If both the <xref:System.Windows.Forms.ListViewItem> and its containing <xref:System.Windows.Forms.ListView> have ToolTips set, only the ToolTip for the <xref:System.Windows.Forms.ListViewItem> will be shown. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.ShowItemToolTips%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ListViewItem.ToolTipText%2A> properties. To run this example, paste the code into a Windows Form and call `InitializeItemsWithToolTips` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If both the <xref:System.Windows.Forms.ListViewItem> and its containing <xref:System.Windows.Forms.ListView> have ToolTips set, only the ToolTip for the <xref:System.Windows.Forms.ListViewItem> will be shown. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.ShowItemToolTips%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ListViewItem.ToolTipText%2A> properties. To run this example, paste the code into a Windows Form and call `InitializeItemsWithToolTips` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> </Docs> @@ -3014,20 +3014,20 @@ If you set the <xref:System.Windows.Forms.ListViewItem.ImageKey%2A> property, th <value> <see langword="true" /> if all subitems use the font, foreground color, and background color settings of the item; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not want to have a uniform background color, foreground color, and font used for all items and subitems in your <xref:System.Windows.Forms.ListView> control, you can set this property to `false`. When this property is set to `true`, any changes made to the subitem's <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.Font%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.ForeColor%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.BackColor%2A?displayProperty=nameWithType> properties are ignored, and the values of the item are used instead. You can use this property if you need to specify a different text color, background color, or font to be used for a subitem to highlight the item when subitems are displayed in the <xref:System.Windows.Forms.ListView> control. - - - -## Examples - The following code example demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `false` to define a custom style for <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects. The example also demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.ForeColor%2A> and <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.Font%2A> properties. To run the example, paste the following code into a form and call the `InitializeListView` method in form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not want to have a uniform background color, foreground color, and font used for all items and subitems in your <xref:System.Windows.Forms.ListView> control, you can set this property to `false`. When this property is set to `true`, any changes made to the subitem's <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.Font%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.ForeColor%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.BackColor%2A?displayProperty=nameWithType> properties are ignored, and the values of the item are used instead. You can use this property if you need to specify a different text color, background color, or font to be used for a subitem to highlight the item when subitems are displayed in the <xref:System.Windows.Forms.ListView> control. + + + +## Examples + The following code example demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.UseItemStyleForSubItems%2A> property to `false` to define a custom style for <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects. The example also demonstrates how to set the <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.ForeColor%2A> and <xref:System.Windows.Forms.ListViewItem.ListViewSubItem.Font%2A> properties. To run the example, paste the following code into a form and call the `InitializeListView` method in form's constructor or <xref:System.Windows.Forms.Form.Load> event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/TopItem/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ListViewItem.ForeColor" /> diff --git a/xml/System.Windows.Forms/MainMenu.xml b/xml/System.Windows.Forms/MainMenu.xml index 9897e11b845..653ff952bed 100644 --- a/xml/System.Windows.Forms/MainMenu.xml +++ b/xml/System.Windows.Forms/MainMenu.xml @@ -36,31 +36,31 @@ </Attributes> <Docs> <summary>Represents the menu structure of a form. - + This class is not available in .NET Core 3.1 and later versions. Use <see cref="T:System.Windows.Forms.MenuStrip" /> instead, which replaces and extends the <see cref="T:System.Windows.Forms.MainMenu" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - + <format type="text/markdown"><![CDATA[ + ## Remarks This class is not available in .NET Core 3.1 and later versions. Use <xref:System.Windows.Forms.MenuStrip> instead. - The <xref:System.Windows.Forms.MainMenu> control represents the container for the menu structure of a form. A menu is composed of <xref:System.Windows.Forms.MenuItem> objects that represent the individual menu commands in the menu structure. Each <xref:System.Windows.Forms.MenuItem> can be a command for your application or a parent menu for other submenu items. To bind the <xref:System.Windows.Forms.MainMenu> to the <xref:System.Windows.Forms.Form> that will display it, assign the <xref:System.Windows.Forms.MainMenu> to the <xref:System.Windows.Forms.Form.Menu%2A> property of the <xref:System.Windows.Forms.Form>. - - For applications that will have support for multiple languages, you can use the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to display the text of the menu from right to left to support languages such as Arabic. - - You can create different <xref:System.Windows.Forms.MainMenu> objects to represent different menu structures for your form. If you want to reuse the menu structure contained in a specific <xref:System.Windows.Forms.MainMenu>, you can use its <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method to create a copy. Once you have a copy of the menu structure, you can make the appropriate modifications for your new menu structure. - + The <xref:System.Windows.Forms.MainMenu> control represents the container for the menu structure of a form. A menu is composed of <xref:System.Windows.Forms.MenuItem> objects that represent the individual menu commands in the menu structure. Each <xref:System.Windows.Forms.MenuItem> can be a command for your application or a parent menu for other submenu items. To bind the <xref:System.Windows.Forms.MainMenu> to the <xref:System.Windows.Forms.Form> that will display it, assign the <xref:System.Windows.Forms.MainMenu> to the <xref:System.Windows.Forms.Form.Menu%2A> property of the <xref:System.Windows.Forms.Form>. + + For applications that will have support for multiple languages, you can use the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to display the text of the menu from right to left to support languages such as Arabic. + + You can create different <xref:System.Windows.Forms.MainMenu> objects to represent different menu structures for your form. If you want to reuse the menu structure contained in a specific <xref:System.Windows.Forms.MainMenu>, you can use its <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method to create a copy. Once you have a copy of the menu structure, you can make the appropriate modifications for your new menu structure. + > [!NOTE] > Cutting and pasting menu items from one form to another in the designer might not work as expected if the form you are pasting into has no menu items defined. - -## Examples - The following code example creates a <xref:System.Windows.Forms.MainMenu>, assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> and binds it to a form. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. - + +## Examples + The following code example creates a <xref:System.Windows.Forms.MainMenu>, assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> and binds it to a form. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Form/Menu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MenuItem" /> @@ -69,7 +69,7 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <altmember cref="P:System.Windows.Forms.Menu.MenuItems" /> <altmember cref="T:System.Windows.Forms.MenuStrip" /> <altmember cref="T:System.Windows.Forms.ContextMenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -99,20 +99,20 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MainMenu" /> class without any specified menu items.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the constructor creates a <xref:System.Windows.Forms.MainMenu> without any specified <xref:System.Windows.Forms.MenuItem> objects. To add menu items to the control use the other version of this constructor that accepts an array of <xref:System.Windows.Forms.MenuItem> objects as its parameter or use the <xref:System.Windows.Forms.Menu.MenuItemCollection.Add%2A> method of the <xref:System.Windows.Forms.Menu.MenuItems%2A> property. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.MainMenu>, assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> and binds it to a form. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the constructor creates a <xref:System.Windows.Forms.MainMenu> without any specified <xref:System.Windows.Forms.MenuItem> objects. To add menu items to the control use the other version of this constructor that accepts an array of <xref:System.Windows.Forms.MenuItem> objects as its parameter or use the <xref:System.Windows.Forms.Menu.MenuItemCollection.Add%2A> method of the <xref:System.Windows.Forms.Menu.MenuItems%2A> property. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.MainMenu>, assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> and binds it to a form. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Form/Menu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MenuItem" /> @@ -166,20 +166,20 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <param name="items">An array of <see cref="T:System.Windows.Forms.MenuItem" /> objects that will be added to the <see cref="T:System.Windows.Forms.MainMenu" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MainMenu" /> with a specified set of <see cref="T:System.Windows.Forms.MenuItem" /> objects.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this constructor to assign an array of <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> at the time of its creation. After the <xref:System.Windows.Forms.MainMenu> has been created you can add additional <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.Menu.MenuItemCollection.Add%2A> method of the <xref:System.Windows.Forms.Menu.MenuItems%2A> property. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.MainMenu>, and assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> using this version of the constructor. The example then binds the <xref:System.Windows.Forms.MainMenu> to a <xref:System.Windows.Forms.Form>. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this constructor to assign an array of <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> at the time of its creation. After the <xref:System.Windows.Forms.MainMenu> has been created you can add additional <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.Menu.MenuItemCollection.Add%2A> method of the <xref:System.Windows.Forms.Menu.MenuItems%2A> property. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.MainMenu>, and assigns two <xref:System.Windows.Forms.MenuItem> objects to the <xref:System.Windows.Forms.MainMenu> using this version of the constructor. The example then binds the <xref:System.Windows.Forms.MainMenu> to a <xref:System.Windows.Forms.Form>. This example requires that you have a <xref:System.Windows.Forms.Form> created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/.ctor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MenuItem" /> @@ -208,20 +208,20 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <summary>Creates a new <see cref="T:System.Windows.Forms.MainMenu" /> that is a duplicate of the current <see cref="T:System.Windows.Forms.MainMenu" />.</summary> <returns>A <see cref="T:System.Windows.Forms.MainMenu" /> that represents the cloned menu.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to create a copy of the menu structure stored in a <xref:System.Windows.Forms.MainMenu>. You can use this method to reuse the menu structure stored in a <xref:System.Windows.Forms.MainMenu> as the foundation for a new <xref:System.Windows.Forms.MainMenu>. For example, if you want to create a menu structure that has the same menu items as an existing <xref:System.Windows.Forms.MainMenu> but will also have additional <xref:System.Windows.Forms.MenuItem> objects added to it, you can use the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method to create a copy of the original <xref:System.Windows.Forms.MainMenu> and then add the new <xref:System.Windows.Forms.MenuItem> objects to the cloned <xref:System.Windows.Forms.MainMenu>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to true on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to create a copy of the menu structure stored in a <xref:System.Windows.Forms.MainMenu>. You can use this method to reuse the menu structure stored in a <xref:System.Windows.Forms.MainMenu> as the foundation for a new <xref:System.Windows.Forms.MainMenu>. For example, if you want to create a menu structure that has the same menu items as an existing <xref:System.Windows.Forms.MainMenu> but will also have additional <xref:System.Windows.Forms.MenuItem> objects added to it, you can use the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method to create a copy of the original <xref:System.Windows.Forms.MainMenu> and then add the new <xref:System.Windows.Forms.MenuItem> objects to the cloned <xref:System.Windows.Forms.MainMenu>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to true on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/CloneMenu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -246,21 +246,21 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <Docs> <summary>Occurs when the main menu collapses.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MainMenu.Collapse> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MainMenu> named `MainMenu1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MainMenu.Collapse> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MainMenu.Collapse> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MainMenu> named `MainMenu1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MainMenu.Collapse> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet483"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet483"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet483"::: + ]]></format> </remarks> </Docs> @@ -315,14 +315,14 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param> <summary>Disposes of the resources, other than memory, used by the <see cref="T:System.Windows.Forms.MainMenu" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Call <xref:System.Windows.Forms.MainMenu.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.MainMenu>. The <xref:System.Windows.Forms.MainMenu.Dispose%2A> method leaves the <xref:System.Windows.Forms.MainMenu> in an unusable state. After calling <xref:System.Windows.Forms.MainMenu.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.MainMenu> so the memory it was occupying can be reclaimed by garbage collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Call <xref:System.Windows.Forms.MainMenu.Dispose%2A> when you are finished using the <xref:System.Windows.Forms.MainMenu>. The <xref:System.Windows.Forms.MainMenu.Dispose%2A> method leaves the <xref:System.Windows.Forms.MainMenu> in an unusable state. After calling <xref:System.Windows.Forms.MainMenu.Dispose%2A>, you must release all references to the <xref:System.Windows.Forms.MainMenu> so the memory it was occupying can be reclaimed by garbage collection. + > [!NOTE] -> Always call <xref:System.Windows.Forms.MainMenu.Dispose%2A> before you release your last reference to the <xref:System.Windows.Forms.MainMenu>. Otherwise, the resources the <xref:System.Windows.Forms.MainMenu> is using will not be freed until garbage collection calls the <xref:System.Windows.Forms.MainMenu> object's destructor. - +> Always call <xref:System.Windows.Forms.MainMenu.Dispose%2A> before you release your last reference to the <xref:System.Windows.Forms.MainMenu>. Otherwise, the resources the <xref:System.Windows.Forms.MainMenu> is using will not be freed until garbage collection calls the <xref:System.Windows.Forms.MainMenu> object's destructor. + ]]></format> </remarks> </Docs> @@ -350,20 +350,20 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <summary>Gets the <see cref="T:System.Windows.Forms.Form" /> that contains this control.</summary> <returns>A <see cref="T:System.Windows.Forms.Form" /> that is the container for this control. Returns <see langword="null" /> if the <see cref="T:System.Windows.Forms.MainMenu" /> is not currently hosted on a form.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property enables you to determine if a specific <xref:System.Windows.Forms.MainMenu> is parented to a form. The property is typically used when multiple <xref:System.Windows.Forms.MainMenu> objects are being used on a form and you need to determine which one is currently being used by a form. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to true on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property enables you to determine if a specific <xref:System.Windows.Forms.MainMenu> is parented to a form. The property is typically used when multiple <xref:System.Windows.Forms.MainMenu> objects are being used on a form and you need to determine which one is currently being used by a form. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to true on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/CloneMenu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Form" /> @@ -393,13 +393,13 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MainMenu.Collapse" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MainMenu.OnCollapse%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MainMenu.OnCollapse%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -439,23 +439,23 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <summary>Gets or sets whether the text displayed by the control is displayed from right to left.</summary> <value>One of the <see cref="T:System.Windows.Forms.RightToLeft" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property enables your menus to support languages that are written from right to left. When this property is set to `RightToLeft.Yes`, the menu item text will be displayed from right to left instead of the default left to right method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property enables your menus to support languages that are written from right to left. When this property is set to `RightToLeft.Yes`, the menu item text will be displayed from right to left instead of the default left to right method. + > [!NOTE] -> For more information about how enabling right-to-left alignment affects Windows Forms controls, see the <xref:System.Windows.Forms.Control.RightToLeft%2A> property. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The example code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to `RightToLeft.Yes` on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. - +> For more information about how enabling right-to-left alignment affects Windows Forms controls, see the <xref:System.Windows.Forms.Control.RightToLeft%2A> property. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.MainMenu.GetForm%2A> method to determine if a <xref:System.Windows.Forms.MainMenu> is currently parented to the form. If the call in the example code to <xref:System.Windows.Forms.MainMenu.GetForm%2A> does not return `null`, the code then clones the menu structure of the <xref:System.Windows.Forms.MainMenu> using the <xref:System.Windows.Forms.MainMenu.CloneMenu%2A> method. The example code then sets the <xref:System.Windows.Forms.MainMenu.RightToLeft%2A> property to `RightToLeft.Yes` on the new copy of the <xref:System.Windows.Forms.MainMenu> to create a <xref:System.Windows.Forms.MainMenu> that can be used for languages that support right to left text. This example requires that you have a <xref:System.Windows.Forms.MainMenu> created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/RightToLeft/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned to the property is not a valid member of the <see cref="T:System.Windows.Forms.RightToLeft" /> enumeration.</exception> @@ -484,11 +484,11 @@ This class is not available in .NET Core 3.1 and later versions. Use <xref:Syste <summary>Returns a string that represents the <see cref="T:System.Windows.Forms.MainMenu" />.</summary> <returns>A string that represents the current <see cref="T:System.Windows.Forms.MainMenu" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The return string includes the type and the string returned by the <xref:System.Windows.Forms.Form.ToString%2A> method if the <xref:System.Windows.Forms.MainMenu> is assigned to a form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The return string includes the type and the string returned by the <xref:System.Windows.Forms.Form.ToString%2A> method if the <xref:System.Windows.Forms.MainMenu> is assigned to a form. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/MaskedTextBox.xml b/xml/System.Windows.Forms/MaskedTextBox.xml index 519c07204ee..b776e8eddce 100644 --- a/xml/System.Windows.Forms/MaskedTextBox.xml +++ b/xml/System.Windows.Forms/MaskedTextBox.xml @@ -57,73 +57,73 @@ <Docs> <summary>Uses a mask to distinguish between proper and improper user input.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox> class is an enhanced <xref:System.Windows.Forms.TextBox> control that supports a declarative syntax for accepting or rejecting user input. Using the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, you can specify the following input without writing any custom validation logic in your application: - -- Required input characters. - -- Optional input characters. - -- The type of input expected at a given position in the mask; for example, a digit, or an alphabetic or alphanumeric character. - -- Mask literals, or characters that should appear directly in the <xref:System.Windows.Forms.MaskedTextBox>; for example, the hyphens (-) in a phone number, or the currency symbol in a price. - -- Special processing for input characters; for example, to convert alphabetic characters to uppercase. - - When a <xref:System.Windows.Forms.MaskedTextBox> control is displayed at run time, it represents the mask as a series of prompt characters and optional literal characters. Each editable mask position, representing a required or optional input, is shown with a single prompt character. For example, the number sign (#) is often used as a placeholder for a numeric character input. You can use the <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> property to specify a custom prompt character. The <xref:System.Windows.Forms.MaskedTextBox.HidePromptOnLeave%2A> property determines if the user sees the prompt characters when the control loses input focus. - - As the user types input into the masked text box, valid input characters replace their respective prompt characters in a sequential fashion. If the user types an invalid input character, no replacement occurs, but instead a beep is issued if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`, and the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised. You can provide your own custom error logic by handing this event. - - When the current insertion point is at a literal character, the user has a number of options: - -- If a character other than the prompt character is typed, the literal will automatically be skipped and the input character will be applied to the next editable position, represented by the next prompt character. - -- If the prompt character is typed and the <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> property is true, the input will overtype the prompt character and insertion point will be moved to the next position in the mask. - -- As is always the case, the arrow keys can be used to navigate to a previous or subsequent position. - - You can use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property to verify whether or not the user has entered all of the required input. The <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property will always retrieve the user's input formatted according to the mask and the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. - - The <xref:System.Windows.Forms.MaskedTextBox> control actually defers all mask processing to the <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> class specified by the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property. This standard provider supports all Unicode characters except for surrogates and vertically combined characters; however, the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property can be used to restrict input to the characters sets a-z, A-Z, and 0-9. - - Masks do not necessarily guarantee that a user's input will represent a valid value for a given type; for example, -9 could be entered for an age in years. You can verify that a user's input represents a valid value by assigning an instance of that value's type to the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. You can detect whether the user removes focus from <xref:System.Windows.Forms.MaskedTextBox> when it contains an invalid value by monitoring for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. If type validation succeeds, the object representing the value will be available through the <xref:System.Windows.Forms.TypeValidationEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.TypeValidationEventArgs> parameter. - - As with the <xref:System.Windows.Forms.TextBox> control, several common keyboard shortcuts do not work with <xref:System.Windows.Forms.MaskedTextBox>. In particular, CTRL-R (right justify text), CTRL-L (left justify text), and CTRL-L (center text) have no effect. - -## Compatibility with Visual Basic 6.0 - <xref:System.Windows.Forms.MaskedTextBox> was designed to retain most of the functionality of the Masked Edit control in Visual Basic 6.0. The following table lists common properties on the Masked Edit control and gives their equivalents on <xref:System.Windows.Forms.MaskedTextBox>. - -|Masked Edit control (Visual Basic 6.0) property|Equivalent MaskedTextBox (.NET Framework) property| -|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| -|`AllowPrompt` property|<xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>| -|`AutoTab` property|None| -|`ClipMode` property|<xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A>| -|`ClipText` property|<xref:System.Windows.Forms.MaskedTextBox.Text%2A> (when <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> is set to <xref:System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals>)| -|`Format` property|None| -|`FormattedText` property|<xref:System.Windows.Forms.MaskedTextBox.Text%2A> (when <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> is set to <xref:System.Windows.Forms.MaskFormat.IncludePromptAndLiterals>)| -|`Mask` property|<xref:System.Windows.Forms.MaskedTextBox.Mask%2A>| -|`PromptChar` property|<xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A>| -|`PromptInclude` property|<xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>| -|`ValidationError` event|<xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected>| - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox> class is an enhanced <xref:System.Windows.Forms.TextBox> control that supports a declarative syntax for accepting or rejecting user input. Using the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, you can specify the following input without writing any custom validation logic in your application: + +- Required input characters. + +- Optional input characters. + +- The type of input expected at a given position in the mask; for example, a digit, or an alphabetic or alphanumeric character. + +- Mask literals, or characters that should appear directly in the <xref:System.Windows.Forms.MaskedTextBox>; for example, the hyphens (-) in a phone number, or the currency symbol in a price. + +- Special processing for input characters; for example, to convert alphabetic characters to uppercase. + + When a <xref:System.Windows.Forms.MaskedTextBox> control is displayed at run time, it represents the mask as a series of prompt characters and optional literal characters. Each editable mask position, representing a required or optional input, is shown with a single prompt character. For example, the number sign (#) is often used as a placeholder for a numeric character input. You can use the <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> property to specify a custom prompt character. The <xref:System.Windows.Forms.MaskedTextBox.HidePromptOnLeave%2A> property determines if the user sees the prompt characters when the control loses input focus. + + As the user types input into the masked text box, valid input characters replace their respective prompt characters in a sequential fashion. If the user types an invalid input character, no replacement occurs, but instead a beep is issued if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`, and the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised. You can provide your own custom error logic by handing this event. + + When the current insertion point is at a literal character, the user has a number of options: + +- If a character other than the prompt character is typed, the literal will automatically be skipped and the input character will be applied to the next editable position, represented by the next prompt character. + +- If the prompt character is typed and the <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> property is true, the input will overtype the prompt character and insertion point will be moved to the next position in the mask. + +- As is always the case, the arrow keys can be used to navigate to a previous or subsequent position. + + You can use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property to verify whether or not the user has entered all of the required input. The <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property will always retrieve the user's input formatted according to the mask and the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. + + The <xref:System.Windows.Forms.MaskedTextBox> control actually defers all mask processing to the <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> class specified by the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property. This standard provider supports all Unicode characters except for surrogates and vertically combined characters; however, the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property can be used to restrict input to the characters sets a-z, A-Z, and 0-9. + + Masks do not necessarily guarantee that a user's input will represent a valid value for a given type; for example, -9 could be entered for an age in years. You can verify that a user's input represents a valid value by assigning an instance of that value's type to the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. You can detect whether the user removes focus from <xref:System.Windows.Forms.MaskedTextBox> when it contains an invalid value by monitoring for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. If type validation succeeds, the object representing the value will be available through the <xref:System.Windows.Forms.TypeValidationEventArgs.ReturnValue%2A> property of the <xref:System.Windows.Forms.TypeValidationEventArgs> parameter. + + As with the <xref:System.Windows.Forms.TextBox> control, several common keyboard shortcuts do not work with <xref:System.Windows.Forms.MaskedTextBox>. In particular, CTRL-R (right justify text), CTRL-L (left justify text), and CTRL-L (center text) have no effect. + +## Compatibility with Visual Basic 6.0 + <xref:System.Windows.Forms.MaskedTextBox> was designed to retain most of the functionality of the Masked Edit control in Visual Basic 6.0. The following table lists common properties on the Masked Edit control and gives their equivalents on <xref:System.Windows.Forms.MaskedTextBox>. + +|Masked Edit control (Visual Basic 6.0) property|Equivalent MaskedTextBox (.NET Framework) property| +|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| +|`AllowPrompt` property|<xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>| +|`AutoTab` property|None| +|`ClipMode` property|<xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A>| +|`ClipText` property|<xref:System.Windows.Forms.MaskedTextBox.Text%2A> (when <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> is set to <xref:System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals>)| +|`Format` property|None| +|`FormattedText` property|<xref:System.Windows.Forms.MaskedTextBox.Text%2A> (when <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> is set to <xref:System.Windows.Forms.MaskFormat.IncludePromptAndLiterals>)| +|`Mask` property|<xref:System.Windows.Forms.MaskedTextBox.Mask%2A>| +|`PromptChar` property|<xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A>| +|`PromptInclude` property|<xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>| +|`ValidationError` event|<xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected>| + > [!CAUTION] -> The <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration or undo functionality. However, while the members associated with these features have been retained for compatibility with the <xref:System.Windows.Forms.TextBoxBase> base class, their implementations perform no actions. - - - -## Examples - The following code example initializes the <xref:System.Windows.Forms.MaskedTextBox> to accept a date, and uses both the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> and <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> events to alert the user to invalid input. - +> The <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration or undo functionality. However, while the members associated with these features have been retained for compatibility with the <xref:System.Windows.Forms.TextBoxBase> base class, their implementations perform no actions. + + + +## Examples + The following code example initializes the <xref:System.Windows.Forms.MaskedTextBox> to accept a date, and uses both the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> and <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> events to alert the user to invalid input. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> <altmember cref="T:System.ComponentModel.MaskedTextProvider" /> - <related type="Article" href="/dotnet/framework/winforms/controls/maskedtextbox-control-windows-forms">MaskedTextBox Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/maskedtextbox-control-windows-forms">MaskedTextBox Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -157,11 +157,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MaskedTextBox" /> class using defaults.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The default <xref:System.Windows.Forms.MaskedTextBox.%23ctor> constructor sets the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property to a null mask, represented by the string "<>". A null mask will accept any combination of characters as input. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The default <xref:System.Windows.Forms.MaskedTextBox.%23ctor> constructor sets the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property to a null mask, represented by the string "<>". A null mask will accept any combination of characters as input. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> @@ -194,13 +194,13 @@ <param name="maskedTextProvider">A custom mask language provider, derived from the <see cref="T:System.ComponentModel.MaskedTextProvider" /> class.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MaskedTextBox" /> class using the specified custom mask language provider.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `maskedTextProvider` parameter defines the masking language used by <xref:System.Windows.Forms.MaskedTextBox>. It is responsible for parsing the mask and determining whether user input conforms to the current mask position. You can derive a new class from <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> to define your own custom masking language, and use the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.ComponentModel.MaskedTextProvider%29> constructor to replace the standard <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType>. - - If you want to use the default masking language and supply your own input mask, you do not need to use this constructor. Instead, you can either use the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.String%29> constructor, or use the parameterless constructor then set the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `maskedTextProvider` parameter defines the masking language used by <xref:System.Windows.Forms.MaskedTextBox>. It is responsible for parsing the mask and determining whether user input conforms to the current mask position. You can derive a new class from <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> to define your own custom masking language, and use the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.ComponentModel.MaskedTextProvider%29> constructor to replace the standard <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType>. + + If you want to use the default masking language and supply your own input mask, you do not need to use this constructor. Instead, you can either use the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.String%29> constructor, or use the parameterless constructor then set the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -236,13 +236,13 @@ <param name="mask">A <see cref="T:System.String" /> representing the input mask. The initial value of the <see cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> property.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MaskedTextBox" /> class using the specified input mask.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.String%29> constructor uses the standard <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> with the input `mask` to parse user input into the <xref:System.Windows.Forms.MaskedTextBox>. - - If you assign a new mask to the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, it will override the value set by this constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.String%29> constructor uses the standard <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> with the input `mask` to parse user input into the <xref:System.Windows.Forms.MaskedTextBox>. + + If you assign a new mask to the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, it will override the value set by this constructor. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -296,11 +296,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTab%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTab%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not supported. + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.MaskedTextBox.AcceptsTabChanged" /> @@ -356,11 +356,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.MaskedTextBox.AcceptsTab" /> property has changed. This event is not raised by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTabChanged> event is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this event is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTabChanged> event is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this event is not supported. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.AcceptsTab" /> @@ -401,13 +401,13 @@ <value> <see langword="true" /> if the user can enter the prompt character into the control; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Even when <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. For example, if <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> is "*", and the current location in the mask demands the user enter a digit, entering an asterisk (\*) will fail and cause the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event to occur. - - The <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> property takes precedence over <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Even when <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. For example, if <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> is "*", and the current location in the mask demands the user enter a digit, entering an asterisk (\*) will fail and cause the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event to occur. + + The <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> property takes precedence over <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.PromptChar" /> @@ -456,11 +456,11 @@ <value> <see langword="true" /> if only ASCII is accepted; <see langword="false" /> if the <see cref="T:System.Windows.Forms.MaskedTextBox" /> control can accept any arbitrary Unicode character. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If `true`, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> restricts user input to the characters a-z and A-Z. ASCII control characters are not allowed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If `true`, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> restricts user input to the characters a-z and A-Z. ASCII control characters are not allowed. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput" /> @@ -500,11 +500,11 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.MaskedTextBox" /> control should beep on invalid input; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event will still occur if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event will still occur if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`. + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.MaskedTextBox.MaskInputRejected" /> @@ -556,11 +556,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.CanUndo%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality, this property always has a value of `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.CanUndo%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality, this property always has a value of `false`. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.MaskedTextBox.ClearUndo" /> @@ -599,11 +599,11 @@ <Docs> <summary>Clears information about the most recent operation from the undo buffer of the text box. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.ClearUndo%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.ClearUndo%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.CanUndo" /> @@ -778,14 +778,14 @@ <summary>Gets or sets a value that determines whether literals and prompt characters are copied to the clipboard.</summary> <value>One of the <see cref="T:System.Windows.Forms.MaskFormat" /> values. The default is <see cref="F:System.Windows.Forms.MaskFormat.IncludeLiterals" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> property determines how text, selected within the <xref:System.Windows.Forms.MaskedTextBox> control, is interpreted when it is copied to the clipboard or retrieved through the <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A> property. Specifically, it determines whether literal characters, prompt characters, or both are included when selected text is accessed. When prompt characters are excluded, they are transformed into spaces in the copied string. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> property determines how text, selected within the <xref:System.Windows.Forms.MaskedTextBox> control, is interpreted when it is copied to the clipboard or retrieved through the <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A> property. Specifically, it determines whether literal characters, prompt characters, or both are included when selected text is accessed. When prompt characters are excluded, they are transformed into spaces in the copied string. + > [!NOTE] -> The <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property serves a similar purpose with respect to how the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is interpreted. - +> The <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property serves a similar purpose with respect to how the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is interpreted. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">Property set with a <see cref="T:System.Windows.Forms.MaskFormat" /> value that is not valid.</exception> @@ -849,11 +849,11 @@ <summary>Gets or sets the <see cref="T:System.IFormatProvider" /> to use when performing type validation.</summary> <value>An object that implements the <see cref="T:System.IFormatProvider" /> interface.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> determines which symbols are used for the currency, date, and other culture-specific mask placeholders when type validation occurs and the control has a non-null <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> determines which symbols are used for the currency, date, and other culture-specific mask placeholders when type validation occurs and the control has a non-null <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. + ]]></format> </remarks> <altmember cref="T:System.IFormatProvider" /> @@ -962,11 +962,11 @@ <summary>Retrieves the index of the first character of a given line. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <returns>This method will always return 0.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.GetFirstCharIndexFromLine%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.GetFirstCharIndexFromLine%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -1007,11 +1007,11 @@ <summary>Retrieves the index of the first character of the current line. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <returns>This method will always return 0.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.GetFirstCharIndexOfCurrentLine%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.GetFirstCharIndexOfCurrentLine%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -1055,11 +1055,11 @@ <summary>Retrieves the line number from the specified character position within the text of the control. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <returns>This method will always return 0.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.GetLineFromCharIndex%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.GetLineFromCharIndex%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is not supported. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -1183,15 +1183,15 @@ <summary>Gets or sets the text insertion mode of the masked text box control.</summary> <value>An <see cref="T:System.Windows.Forms.InsertKeyMode" /> value that indicates the current insertion mode. The default is <see cref="F:System.Windows.Forms.InsertKeyMode.Default" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property controls the character insertion behavior of the <xref:System.Windows.Forms.MaskedTextBox> control. The state of this property is defined by the <xref:System.Windows.Forms.InsertKeyMode> enumeration, which can be always on, always off or set to respect the setting of the user's keyboard. This property supersedes the insertion mode of the keyboard. For example, if the keyboard is set to overwrite, but <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to `Insert`, the <xref:System.Windows.Forms.MaskedTextBox> will operate in insert mode. The <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property will access the true insertion mode of the <xref:System.Windows.Forms.MaskedTextBox>. - - If changing <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> changes the value of <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A>, <xref:System.Windows.Forms.MaskedTextBox> will raise the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. - - This property has no effect if no mask has been set. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property controls the character insertion behavior of the <xref:System.Windows.Forms.MaskedTextBox> control. The state of this property is defined by the <xref:System.Windows.Forms.InsertKeyMode> enumeration, which can be always on, always off or set to respect the setting of the user's keyboard. This property supersedes the insertion mode of the keyboard. For example, if the keyboard is set to overwrite, but <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to `Insert`, the <xref:System.Windows.Forms.MaskedTextBox> will operate in insert mode. The <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property will access the true insertion mode of the <xref:System.Windows.Forms.MaskedTextBox>. + + If changing <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> changes the value of <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A>, <xref:System.Windows.Forms.MaskedTextBox> will raise the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. + + This property has no effect if no mask has been set. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">An invalid <see cref="T:System.Windows.Forms.InsertKeyMode" /> value was supplied when setting this property.</exception> @@ -1265,13 +1265,13 @@ <value> <see langword="true" /> if <see cref="T:System.Windows.Forms.MaskedTextBox" /> will overwrite existing characters as the user enters new ones; <see langword="false" /> if <see cref="T:System.Windows.Forms.MaskedTextBox" /> will shift existing characters forward. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> takes into account both the value of the <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property and the state of the user's keyboard. If <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to either <xref:System.Windows.Forms.InsertKeyMode.Insert> or <xref:System.Windows.Forms.InsertKeyMode.Overwrite>, <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> will return `false` or `true`, respectively. If <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to <xref:System.Windows.Forms.InsertKeyMode.Default>, it will return the state of the INSERT key. - - When <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> is `false`, <xref:System.Windows.Forms.MaskedTextBox> will reject as invalid any character entry that would result in a violation anywhere in the mask. In explanation, if inserting a character would cause a character to be shifted over into a mask position where it would not be valid, the character insertion will be rejected. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> takes into account both the value of the <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property and the state of the user's keyboard. If <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to either <xref:System.Windows.Forms.InsertKeyMode.Insert> or <xref:System.Windows.Forms.InsertKeyMode.Overwrite>, <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> will return `false` or `true`, respectively. If <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> is set to <xref:System.Windows.Forms.InsertKeyMode.Default>, it will return the state of the INSERT key. + + When <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> is `false`, <xref:System.Windows.Forms.MaskedTextBox> will reject as invalid any character entry that would result in a violation anywhere in the mask. In explanation, if inserting a character would cause a character to be shifted over into a mask position where it would not be valid, the character insertion will be rejected. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.InsertKeyMode" /> @@ -1310,23 +1310,23 @@ <Docs> <summary>Occurs after the insert mode has changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event is raised after value of the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is changed. - - This event is required to properly bind data to a <xref:System.Windows.Forms.MaskedTextBox> control. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event is raised after value of the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is changed. + + This event is required to properly bind data to a <xref:System.Windows.Forms.MaskedTextBox> control. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet484"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet484"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet484"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.IsOverwriteMode" /> @@ -1377,11 +1377,11 @@ <summary>Gets or sets the lines of text in multiline configurations. This property is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <value>An array of type <see cref="T:System.String" /> that contains a single line.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.Lines%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not supported. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.Lines%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not supported. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.AcceptsTab" /> @@ -1445,53 +1445,53 @@ <summary>Gets or sets the input mask to use at run time.</summary> <value>A <see cref="T:System.String" /> representing the current mask. The default value is the empty string which allows any input.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> is the default property for the <xref:System.Windows.Forms.MaskedTextBox> class. - - <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> must be a string composed of one or more of the masking elements, as shown in the following table. The masking language used by <xref:System.Windows.Forms.MaskedTextBox> is defined by its associated <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A>. The standard provider specifies a masking language based upon the one used by the Masked Edit control in Visual Basic 6.0, and should be very familiar to users migrating from that platform. - -|Masking element|Description| -|---------------------|-----------------| -|0|Digit, required. This element will accept any single digit between 0 and 9.| -|9|Digit or space, optional.| -|#|Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. Plus (+) and minus (-) signs are allowed.| -|L|Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.| -|?|Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.| -|&|Character, required. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to true, this element behaves like the "L" element.| -|C|Character, optional. Any non-control character. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, this element behaves like the "?" element.| -|A|Alphanumeric, required. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element.| -|a|Alphanumeric, optional. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element.| -|.|Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| -|,|Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| -|:|Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| -|/|Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| -|$|Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| -|\<|Shift down. Converts all characters that follow to lowercase.| -|>|Shift up. Converts all characters that follow to uppercase.| -|||Disable a previous shift up or shift down.| -|\|Escape. Escapes a mask character, turning it into a literal. "\\\\" is the escape sequence for a backslash.| -|All other characters|Literals. All non-mask elements will appear as themselves within <xref:System.Windows.Forms.MaskedTextBox>. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.| - - If you change a mask when <xref:System.Windows.Forms.MaskedTextBox> already contains user input filtered by a previous mask, <xref:System.Windows.Forms.MaskedTextBox> will attempt to migrate that input into the new mask definition. If it fails, it will clear the existing input. Assigning a zero-length string as the mask will preserve any existing data in the control. When used with a zero-length mask, <xref:System.Windows.Forms.MaskedTextBox> behaves like a single-line <xref:System.Windows.Forms.TextBox> control. - - The decimal (.), thousandths (,), time (:), date (/), and currency ($) symbols default to displaying those symbols as defined by the application's culture. You can force them to display symbols for another culture by using the <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property. - - Character insertion into the mask at run time is controlled by the <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property. Users can navigate through the mask by using the left and right arrow keys or the mouse cursor, and can skip optional positions in the mask by entering a space. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> is the default property for the <xref:System.Windows.Forms.MaskedTextBox> class. + + <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> must be a string composed of one or more of the masking elements, as shown in the following table. The masking language used by <xref:System.Windows.Forms.MaskedTextBox> is defined by its associated <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A>. The standard provider specifies a masking language based upon the one used by the Masked Edit control in Visual Basic 6.0, and should be very familiar to users migrating from that platform. + +|Masking element|Description| +|---------------------|-----------------| +|0|Digit, required. This element will accept any single digit between 0 and 9.| +|9|Digit or space, optional.| +|#|Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. Plus (+) and minus (-) signs are allowed.| +|L|Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.| +|?|Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.| +|&|Character, required. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to true, this element behaves like the "L" element.| +|C|Character, optional. Any non-control character. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, this element behaves like the "?" element.| +|A|Alphanumeric, required. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element.| +|a|Alphanumeric, optional. If the <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A> property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element.| +|.|Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| +|,|Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| +|:|Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| +|/|Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| +|$|Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property.| +|\<|Shift down. Converts all characters that follow to lowercase.| +|>|Shift up. Converts all characters that follow to uppercase.| +|||Disable a previous shift up or shift down.| +|\|Escape. Escapes a mask character, turning it into a literal. "\\\\" is the escape sequence for a backslash.| +|All other characters|Literals. All non-mask elements will appear as themselves within <xref:System.Windows.Forms.MaskedTextBox>. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.| + + If you change a mask when <xref:System.Windows.Forms.MaskedTextBox> already contains user input filtered by a previous mask, <xref:System.Windows.Forms.MaskedTextBox> will attempt to migrate that input into the new mask definition. If it fails, it will clear the existing input. Assigning a zero-length string as the mask will preserve any existing data in the control. When used with a zero-length mask, <xref:System.Windows.Forms.MaskedTextBox> behaves like a single-line <xref:System.Windows.Forms.TextBox> control. + + The decimal (.), thousandths (,), time (:), date (/), and currency ($) symbols default to displaying those symbols as defined by the application's culture. You can force them to display symbols for another culture by using the <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A> property. + + Character insertion into the mask at run time is controlled by the <xref:System.Windows.Forms.MaskedTextBox.InsertKeyMode%2A> property. Users can navigate through the mask by using the left and right arrow keys or the mouse cursor, and can skip optional positions in the mask by entering a space. + > [!IMPORTANT] -> <xref:System.Windows.Forms.MaskedTextBox> supports all Unicode characters except for surrogates and vertically combined characters. - - The following table shows example masks. - -|Mask|Behavior| -|----------|--------------| -|`00/00/0000`|A date (day, numeric month, year) in international date format. The "/" character is a logical date separator, and will appear to the user as the date separator appropriate to the application's current culture.| -|`00->L<LL-0000`|A date (day, month abbreviation, and year) in United States format in which the three-letter month abbreviation is displayed with an initial uppercase letter followed by two lowercase letters.| -|`(999)-000-0000`|United States phone number, area code optional. If users do not want to enter the optional characters, they can either enter spaces or place the mouse pointer directly at the position in the mask represented by the first 0.| -|`$999,999.00`|A currency value in the range of 0 to 999999. The currency, thousandth, and decimal characters will be replaced at run time with their culture-specific equivalents.| - +> <xref:System.Windows.Forms.MaskedTextBox> supports all Unicode characters except for surrogates and vertically combined characters. + + The following table shows example masks. + +|Mask|Behavior| +|----------|--------------| +|`00/00/0000`|A date (day, numeric month, year) in international date format. The "/" character is a logical date separator, and will appear to the user as the date separator appropriate to the application's current culture.| +|`00->L<LL-0000`|A date (day, month abbreviation, and year) in United States format in which the three-letter month abbreviation is displayed with an initial uppercase letter followed by two lowercase letters.| +|`(999)-000-0000`|United States phone number, area code optional. If users do not want to enter the optional characters, they can either enter spaces or place the mouse pointer directly at the position in the mask represented by the first 0.| +|`$999,999.00`|A currency value in the range of 0 to 999999. The currency, thousandth, and decimal characters will be replaced at run time with their culture-specific equivalents.| + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The string supplied to the <see cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> property is not a valid mask. Invalid masks include masks containing non-printable characters.</exception> @@ -1534,21 +1534,21 @@ <Docs> <summary>Occurs after the input mask is changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event is raised after the value of the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property is changed. This event is also raised if the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> is indirectly altered by a member such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A>, and <xref:System.Windows.Forms.MaskedTextBox.Culture%2A>. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event is raised after the value of the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property is changed. This event is also raised if the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> is indirectly altered by a member such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A>, and <xref:System.Windows.Forms.MaskedTextBox.Culture%2A>. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.MaskChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet485"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet485"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet485"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> @@ -1589,11 +1589,11 @@ <value> <see langword="true" /> if all required input has been entered into the mask; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> checks only required input elements. To determine whether all required and optional input elements have been filled in, use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property instead. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> checks only required input elements. To determine whether all required and optional input elements have been filled in, use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property instead. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.MaskFull" /> @@ -1647,13 +1647,13 @@ <summary>Gets a clone of the mask provider associated with this instance of the masked text box control.</summary> <value>A masking language provider of type <see cref="P:System.Windows.Forms.MaskedTextBox.MaskedTextProvider" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property defines the mask-parsing engine and the masking language used by the <xref:System.Windows.Forms.MaskedTextBox> control. The default provider is the <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> class; however, a custom provider can be specified using the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.ComponentModel.MaskedTextProvider%29> constructor. - - <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> cannot be set directly. However, setting some of the properties of <xref:System.Windows.Forms.MaskedTextBox> - such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A>, and <xref:System.Windows.Forms.MaskedTextBox.Culture%2A> - may internally cause the creation of a new <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property defines the mask-parsing engine and the masking language used by the <xref:System.Windows.Forms.MaskedTextBox> control. The default provider is the <xref:System.ComponentModel.MaskedTextProvider?displayProperty=nameWithType> class; however, a custom provider can be specified using the <xref:System.Windows.Forms.MaskedTextBox.%23ctor%28System.ComponentModel.MaskedTextProvider%29> constructor. + + <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> cannot be set directly. However, setting some of the properties of <xref:System.Windows.Forms.MaskedTextBox> - such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A>, <xref:System.Windows.Forms.MaskedTextBox.AsciiOnly%2A>, and <xref:System.Windows.Forms.MaskedTextBox.Culture%2A> - may internally cause the creation of a new <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A>. + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.MaskedTextProvider" /> @@ -1693,19 +1693,19 @@ <value> <see langword="true" /> if all required and optional inputs have been entered; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property within the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event handler to determine if the user's input was rejected because there are no remaining inputs in the mask. To determine whether only required input elements have been entered, use the <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> property. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event, and uses a <xref:System.Windows.Forms.ToolTip> to alert the user if an attempt is made to enter data after all positions in the mask have been used. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.MaskedTextBox.MaskFull%2A> property within the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event handler to determine if the user's input was rejected because there are no remaining inputs in the mask. To determine whether only required input elements have been entered, use the <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> property. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event, and uses a <xref:System.Windows.Forms.ToolTip> to alert the user if an attempt is made to enter data after all positions in the mask have been used. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.MaskCompleted" /> @@ -1747,37 +1747,37 @@ <Docs> <summary>Occurs when the user's input or assigned character does not match the corresponding format element of the input mask.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> is the default event for the <xref:System.Windows.Forms.MaskedTextBox> class. - - The <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event occurs when a character is rejected by the input mask. The input mask, represented by the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, is interpreted by the masked text provider associated with the control through the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property. <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> is raised in the following situations: - -- An input character does not match the corresponding format element. For example, the user enters an alphabetic character when a digit is required. This is probably the most common reason why this event is raised. - -- The user is trying to input extraneous characters beyond the end of the mask either because the mask has already been filled or the current caret position has been moved to the very end of the displayed input mask string. - -- A paste operation either inserts a character that does not match its associated format element, or if the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is `false`, it shifts existing characters into new positions where they do not match their format elements. - -- A cut operation shifts existing characters to the left, and one or more characters do not match their newly associated format elements. - -- An assignment was made to the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property and the assigned string caused one or more mask violations. - - If a string was assigned to the control that causes <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> to occur, no part of the string will appear in <xref:System.Windows.Forms.MaskedTextBox>. - - The default handling for <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> will play a beep sound if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`. This event is often handled to implement custom error handling, for example, to move to the next user input control if the mask is full, or to display a custom error dialog box or ToolTip if the input character is invalid. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> is the default event for the <xref:System.Windows.Forms.MaskedTextBox> class. + + The <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event occurs when a character is rejected by the input mask. The input mask, represented by the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property, is interpreted by the masked text provider associated with the control through the <xref:System.Windows.Forms.MaskedTextBox.MaskedTextProvider%2A> property. <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> is raised in the following situations: + +- An input character does not match the corresponding format element. For example, the user enters an alphabetic character when a digit is required. This is probably the most common reason why this event is raised. + +- The user is trying to input extraneous characters beyond the end of the mask either because the mask has already been filled or the current caret position has been moved to the very end of the displayed input mask string. + +- A paste operation either inserts a character that does not match its associated format element, or if the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is `false`, it shifts existing characters into new positions where they do not match their format elements. + +- A cut operation shifts existing characters to the left, and one or more characters do not match their newly associated format elements. + +- An assignment was made to the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property and the assigned string caused one or more mask violations. + + If a string was assigned to the control that causes <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> to occur, no part of the string will appear in <xref:System.Windows.Forms.MaskedTextBox>. + + The default handling for <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> will play a beep sound if the <xref:System.Windows.Forms.MaskedTextBox.BeepOnError%2A> property is set to `true`. This event is often handled to implement custom error handling, for example, to move to the next user input control if the mask is full, or to display a custom error dialog box or ToolTip if the input character is invalid. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet486"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet486"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet486"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Text" /> @@ -1832,11 +1832,11 @@ <summary>Gets or sets the maximum number of characters the user can type or paste into the text box control. This property is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <value>This property always returns 0.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - See the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property and the <xref:System.Windows.Forms.MaskInputRejectedEventArgs.Position%2A> property in the <xref:System.Windows.Forms.MaskInputRejectedEventArgs> class for information about how to determine the maximum length of a string in a <xref:System.Windows.Forms.MaskedTextBox>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + See the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property and the <xref:System.Windows.Forms.MaskInputRejectedEventArgs.Position%2A> property in the <xref:System.Windows.Forms.MaskInputRejectedEventArgs> class for information about how to determine the maximum length of a string in a <xref:System.Windows.Forms.MaskedTextBox>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> @@ -1887,11 +1887,11 @@ <summary>Gets or sets a value indicating whether this is a multiline text box control. This property is not fully supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <value>This property always returns <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTab%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not fully supported; it cannot be set and it always resolves to `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.AcceptsTab%2A> property is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this property is not fully supported; it cannot be set and it always resolves to `false`. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.AcceptsTab" /> @@ -1947,11 +1947,11 @@ <Docs> <summary>Typically occurs when the value of the <see cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> property has changed; however, this event is not raised by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.MultilineChanged> event is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this event is not implemented in <xref:System.Windows.Forms.MaskedTextBox>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.MultilineChanged> event is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this event is not implemented in <xref:System.Windows.Forms.MaskedTextBox>. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -2081,13 +2081,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MaskedTextBox.IsOverwriteModeChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MaskedTextBox.OnIsOverwriteModeChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MaskedTextBox.OnIsOverwriteModeChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2228,13 +2228,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MaskedTextBox.MaskChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MaskedTextBox.OnMaskChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MaskedTextBox.OnMaskChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2305,11 +2305,11 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains event data.</param> <summary>Typically raises the <see cref="E:System.Windows.Forms.MaskedTextBox.MultilineChanged" /> event, but disabled for <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.OnMultilineChanged%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is overridden to perform no actions. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.OnMultilineChanged%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is overridden to perform no actions. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -2345,13 +2345,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MaskedTextBox.TextAlignChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MaskedTextBox.OnTextAlignChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MaskedTextBox.OnTextAlignChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2390,13 +2390,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.TextChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MaskedTextBox.OnTextChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MaskedTextBox.OnTextChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2441,18 +2441,18 @@ <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs" /> that contains event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Validating" /> event.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.OnValidating%2A> method causes the input string to be validated against the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property, if a <xref:System.Type> has been specified for this property. It will then also raise the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.OnValidating%2A> method causes the input string to be validated against the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property, if a <xref:System.Type> has been specified for this property. It will then also raise the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. + > [!NOTE] -> To ensure consistency with text-based controls, validation will occur even if the <xref:System.Windows.Forms.MaskedTextBox> is read-only (its <xref:System.Windows.Forms.MaskedTextBox.ReadOnly%2A> property is set to `true`). - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - The <xref:System.Windows.Forms.MaskedTextBox.OnValidating%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - +> To ensure consistency with text-based controls, validation will occur even if the <xref:System.Windows.Forms.MaskedTextBox> is read-only (its <xref:System.Windows.Forms.MaskedTextBox.ReadOnly%2A> property is set to `true`). + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + The <xref:System.Windows.Forms.MaskedTextBox.OnValidating%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.Exception">A critical exception occurred during the parsing of the input string.</exception> @@ -2504,16 +2504,16 @@ <summary>Gets or sets the character to be displayed in substitute for user input.</summary> <value>The <see cref="T:System.Char" /> value used as the password character.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - For sensitive user input, it is common practice to conceal the actual information entered by the user. If the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property is set to a non-null character, <xref:System.Windows.Forms.MaskedTextBox> will display this character for all input into the control. Setting this property to `null` will disable this functionality. - - If you want to use the operating system supplied password character, which is defined in COMCTL32.dll, use the <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> property instead. If both the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> and <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> properties are activated, the latter takes precedence. - + <format type="text/markdown"><![CDATA[ + +## Remarks + For sensitive user input, it is common practice to conceal the actual information entered by the user. If the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property is set to a non-null character, <xref:System.Windows.Forms.MaskedTextBox> will display this character for all input into the control. Setting this property to `null` will disable this functionality. + + If you want to use the operating system supplied password character, which is defined in COMCTL32.dll, use the <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> property instead. If both the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> and <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> properties are activated, the latter takes precedence. + > [!IMPORTANT] -> As a security consideration, the <xref:System.Windows.Forms.MaskedTextBox> control disables cut and copy operations on password-protected strings. - +> As a security consideration, the <xref:System.Windows.Forms.MaskedTextBox> control disables cut and copy operations on password-protected strings. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The character specified when setting this property is not a valid password character, as determined by the <see cref="M:System.ComponentModel.MaskedTextProvider.IsValidPasswordChar(System.Char)" /> method of the <see cref="T:System.ComponentModel.MaskedTextProvider" /> class.</exception> @@ -2590,11 +2590,11 @@ <returns> <see langword="true" /> if the message was processed by the control; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox> overrides its base control's implementation of <xref:System.Windows.Forms.MaskedTextBox.ProcessKeyMessage%2A> to properly handle character events when the user is entering characters using an Input Method Editor (IME), such as is used for entering Japanese, Chinese, and other complex non-Latin scripts. <xref:System.Windows.Forms.MaskedTextBox.ProcessKeyMessage%2A> detects any WM_CHAR messages that occur after it receives a WM_IME_CHAR message and suppresses them in order to prevent these characters from showing up in the control. If you derive from this control and override this message, you should duplicate this behavior if you wish your new control to work with IMEs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox> overrides its base control's implementation of <xref:System.Windows.Forms.MaskedTextBox.ProcessKeyMessage%2A> to properly handle character events when the user is entering characters using an Input Method Editor (IME), such as is used for entering Japanese, Chinese, and other complex non-Latin scripts. <xref:System.Windows.Forms.MaskedTextBox.ProcessKeyMessage%2A> detects any WM_CHAR messages that occur after it receives a WM_IME_CHAR message and suppresses them in order to prevent these characters from showing up in the control. If you derive from this control and override this message, you should duplicate this behavior if you wish your new control to work with IMEs. + ]]></format> </remarks> </Docs> @@ -2643,13 +2643,13 @@ <summary>Gets or sets the character used to represent the absence of user input in <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <value>The character used to prompt the user for input. The default is an underscore (_).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> will be displayed in <xref:System.Windows.Forms.MaskedTextBox> for any mask position that the user has not yet filled in. - - Use the <xref:System.Windows.Forms.MaskedTextBox.HidePromptOnLeave%2A> property to specify whether the prompt is displayed when <xref:System.Windows.Forms.MaskedTextBox> does not have focus. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> will be displayed in <xref:System.Windows.Forms.MaskedTextBox> for any mask position that the user has not yet filled in. + + Use the <xref:System.Windows.Forms.MaskedTextBox.HidePromptOnLeave%2A> property to specify whether the prompt is displayed when <xref:System.Windows.Forms.MaskedTextBox> does not have focus. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The character specified when setting this property is not a valid prompt character, as determined by the <see cref="M:System.ComponentModel.MaskedTextProvider.IsValidPasswordChar(System.Char)" /> method of the <see cref="T:System.ComponentModel.MaskedTextProvider" /> class.</exception> @@ -2723,21 +2723,21 @@ <value> <see langword="true" /> if processing of the input string should be terminated at the first parsing error; otherwise, <see langword="false" /> if processing should ignore all errors. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Sometimes the user will enter several characters into a <xref:System.Windows.Forms.MaskedTextBox> in a single input operation, typically by copying and pasting a string. If the entire string only contains valid characters, according to their paste position in the input mask, then the entire operation will succeed. However, when a parsing error occurs, the behavior of <xref:System.Windows.Forms.MaskedTextBox> depends on the value of <xref:System.Windows.Forms.MaskedTextBox.RejectInputOnFirstFailure%2A>, as follows: - -- If this property is `true`, then processing of the input string stops at the invalid character. All subsequent characters are ignored. A single <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised. - -- If this property is `false`, then the invalid character is rejected, but parsing continues with the next character in the input string. A <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised for every invalid character in the input string. - - The <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>, <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A> and <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> properties can also influence the interpretation of the user input. - - If the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is `false`, then any characters already in the input mask to the right of the insertion point will be displaced by the accepted number of characters. This shifting may cause additional parsing errors. - - A pasting operation can be mimicked programmatically by setting the <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Sometimes the user will enter several characters into a <xref:System.Windows.Forms.MaskedTextBox> in a single input operation, typically by copying and pasting a string. If the entire string only contains valid characters, according to their paste position in the input mask, then the entire operation will succeed. However, when a parsing error occurs, the behavior of <xref:System.Windows.Forms.MaskedTextBox> depends on the value of <xref:System.Windows.Forms.MaskedTextBox.RejectInputOnFirstFailure%2A>, as follows: + +- If this property is `true`, then processing of the input string stops at the invalid character. All subsequent characters are ignored. A single <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised. + +- If this property is `false`, then the invalid character is rejected, but parsing continues with the next character in the input string. A <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised for every invalid character in the input string. + + The <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>, <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A> and <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> properties can also influence the interpretation of the user input. + + If the <xref:System.Windows.Forms.MaskedTextBox.IsOverwriteMode%2A> property is `false`, then any characters already in the input mask to the right of the insertion point will be displaced by the accepted number of characters. This shifting may cause additional parsing errors. + + A pasting operation can be mimicked programmatically by setting the <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> @@ -2781,20 +2781,20 @@ <value> <see langword="true" /> if the prompt character entered as input causes the current editable position in the mask to be reset; otherwise, <see langword="false" /> to indicate that the prompt character is to be processed as a normal input character. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox> can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Assuming that the <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> property is set to non-`null`, then setting the <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> property to `true` will result in special processing for the prompt character. When the user enters the prompt character into the mask, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character. - - <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> takes precedence over the <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> property, as shown in the following table. - -|ResetOnPrompt value|AllowPromptAsInput value|Resulting behavior| -|-------------------------|------------------------------|------------------------| -|`true`|`true`|The prompt character can be entered and it causes the current mask position to be reset. This is the default.| -|`true`|`false`|The prompt character can be entered and it causes the current mask position to be reset.| -|`false`|`true`|The prompt character is processed as a standard input character.| -|`false`|`false`|The prompt character is not valid and raises a <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event.| - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox> can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Assuming that the <xref:System.Windows.Forms.MaskedTextBox.PromptChar%2A> property is set to non-`null`, then setting the <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> property to `true` will result in special processing for the prompt character. When the user enters the prompt character into the mask, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character. + + <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A> takes precedence over the <xref:System.Windows.Forms.MaskedTextBox.AllowPromptAsInput%2A> property, as shown in the following table. + +|ResetOnPrompt value|AllowPromptAsInput value|Resulting behavior| +|-------------------------|------------------------------|------------------------| +|`true`|`true`|The prompt character can be entered and it causes the current mask position to be reset. This is the default.| +|`true`|`false`|The prompt character can be entered and it causes the current mask position to be reset.| +|`false`|`true`|The prompt character is processed as a standard input character.| +|`false`|`false`|The prompt character is not valid and raises a <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event.| + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.PromptChar" /> @@ -2836,13 +2836,13 @@ <value> <see langword="true" /> if the space input character causes the current editable position in the mask to be reset; otherwise, <see langword="false" /> to indicate that it is to be processed as a normal input character. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox> can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Setting the <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A> property to `true` will result in the current mask character position to be cleared and the current position to be advanced to the next editable character. - - The type of character input will determine whether the masking engine moves forward to the next character in the mask, or stays at the current position and waits for a matching character. If the input character is a space, and does not match the current non-editable character in the mask, the masking engine will skip ahead to the next character in the mask. If the input character is not a space, and does not match the current non-editable character in the mask, the masking engine will remain at the current mask position, and attempt to match the next input character against it. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox> can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Setting the <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A> property to `true` will result in the current mask character position to be cleared and the current position to be advanced to the next editable character. + + The type of character input will determine whether the masking engine moves forward to the next character in the mask, or stays at the current position and waits for a matching character. If the input character is a space, and does not match the current non-editable character in the mask, the masking engine will skip ahead to the next character in the mask. If the input character is not a space, and does not match the current non-editable character in the mask, the masking engine will remain at the current mask position, and attempt to match the next input character against it. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.ResetOnPrompt" /> @@ -2880,11 +2880,11 @@ <Docs> <summary>Scrolls the contents of the control to the current caret position. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.ScrollToCaret%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is overridden to perform no actions. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.ScrollToCaret%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, because the <xref:System.Windows.Forms.MaskedTextBox> control does not support multiline configuration, this method is overridden to perform no actions. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> @@ -2916,11 +2916,11 @@ <summary>Gets or sets the current selection in the <see cref="T:System.Windows.Forms.MaskedTextBox" /> control.</summary> <value>The currently selected text as a <see cref="T:System.String" />. If no text is currently selected, this property resolves to an empty string.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Selections retrieved using this property are formatted according to the control's formatting properties, such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A>, <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> and <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A>. Selections set using this property behave like a Paste operation: each character is matched against the mask, and the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised for invalid characters. If <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> is `true`, literals and prompt characters are allowed when setting <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A>, and will be removed silently unless they violate the mask. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Selections retrieved using this property are formatted according to the control's formatting properties, such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A>, <xref:System.Windows.Forms.MaskedTextBox.FormatProvider%2A>, <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> and <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A>. Selections set using this property behave like a Paste operation: each character is matched against the mask, and the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event is raised for invalid characters. If <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> is `true`, literals and prompt characters are allowed when setting <xref:System.Windows.Forms.MaskedTextBox.SelectedText%2A>, and will be removed silently unless they violate the mask. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Text" /> @@ -2963,23 +2963,23 @@ <value> <see langword="true" /> to allow literals to be reentered; otherwise, <see langword="false" /> to prevent the user from overwriting literal characters. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Input masks commonly contain literals. When the user enters characters into the <xref:System.Windows.Forms.MaskedTextBox> at runtime, the current character position will sometimes fall on a literal. The <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> property describes how user input for the next character is to be handled, as follows: - -- If this property is `true`, the user can either redundantly enter the same character as the literal at the current position, or can enter the next editable character, thereby jumping the current position to that position. - -- If this property is `false`, the user can only enter the next editable character. If the next position in the mask will not accept the literal character (for example, the user types "/" and the next position only accepts digits), the control will raise the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. - - As an example, in the "90/90/0000" date entry mask, the forward slash characters are literals. Assume that the user has entered two initial digits, "11", so the current position in the mask is at the first forward slash (/) literal. If <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> is `true`, then the user has the following valid choices: - -- The user can enter a "/" character. This results in the position being moved to the next character, which in this example is the fourth position, a 9 masking element. - -- The user can enter the next editable character, which in this example is a digit. The digit would be validated and the current position would automatically be moved to the fifth position, which is a 0 masking element. - - If <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> is `false`, then only a valid data input is allowed, which in this example would be a digit. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Input masks commonly contain literals. When the user enters characters into the <xref:System.Windows.Forms.MaskedTextBox> at runtime, the current character position will sometimes fall on a literal. The <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> property describes how user input for the next character is to be handled, as follows: + +- If this property is `true`, the user can either redundantly enter the same character as the literal at the current position, or can enter the next editable character, thereby jumping the current position to that position. + +- If this property is `false`, the user can only enter the next editable character. If the next position in the mask will not accept the literal character (for example, the user types "/" and the next position only accepts digits), the control will raise the <xref:System.Windows.Forms.MaskedTextBox.MaskInputRejected> event. + + As an example, in the "90/90/0000" date entry mask, the forward slash characters are literals. Assume that the user has entered two initial digits, "11", so the current position in the mask is at the first forward slash (/) literal. If <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> is `true`, then the user has the following valid choices: + +- The user can enter a "/" character. This results in the position being moved to the next character, which in this example is the fourth position, a 9 masking element. + +- The user can enter the next editable character, which in this example is a digit. The digit would be validated and the current position would automatically be moved to the fifth position, which is a 0 masking element. + + If <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A> is `false`, then only a valid data input is allowed, which in this example would be a digit. + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.MaskedTextBox.MaskInputRejected" /> @@ -3041,26 +3041,26 @@ <summary>Gets or sets the text as it is currently displayed to the user.</summary> <value>A <see cref="T:System.String" /> containing the text currently displayed by the control. The default is an empty string.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MaskedTextBox.Text%2A> is the default binding property for the <xref:System.Windows.Forms.MaskedTextBox> class. - - Strings retrieved using this property are formatted according to the control's formatting properties, such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> and <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A>. - - You can assign a string with or without literal characters to <xref:System.Windows.Forms.MaskedTextBox.Text%2A> depending on the values of <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>, <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A>, and <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A>. - - <xref:System.Windows.Forms.MaskedTextBox.Text%2A> is the default binding property for <xref:System.Windows.Forms.MaskedTextBox>. - - <xref:System.Windows.Forms.MaskedTextBox> will raise the <xref:System.Windows.Forms.Control.TextChanged> event whenever the formatted text value changes. Different properties may or may not cause this value to change. For example, changing the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property will not raise the <xref:System.Windows.Forms.Control.TextChanged> event, but changing the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property will. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TestMaskedTextBox/VB/form1.vb" id="Snippet3"::: - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MaskedTextBox.Text%2A> is the default binding property for the <xref:System.Windows.Forms.MaskedTextBox> class. + + Strings retrieved using this property are formatted according to the control's formatting properties, such as <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> and <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A>. + + You can assign a string with or without literal characters to <xref:System.Windows.Forms.MaskedTextBox.Text%2A> depending on the values of <xref:System.Windows.Forms.MaskedTextBox.ResetOnPrompt%2A>, <xref:System.Windows.Forms.MaskedTextBox.ResetOnSpace%2A>, and <xref:System.Windows.Forms.MaskedTextBox.SkipLiterals%2A>. + + <xref:System.Windows.Forms.MaskedTextBox.Text%2A> is the default binding property for <xref:System.Windows.Forms.MaskedTextBox>. + + <xref:System.Windows.Forms.MaskedTextBox> will raise the <xref:System.Windows.Forms.Control.TextChanged> event whenever the formatted text value changes. Different properties may or may not cause this value to change. For example, changing the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property will not raise the <xref:System.Windows.Forms.Control.TextChanged> event, but changing the <xref:System.Windows.Forms.MaskedTextBox.Mask%2A> property will. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TestMaskedTextBox/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.DefaultBindingPropertyAttribute" /> @@ -3112,11 +3112,11 @@ <summary>Gets or sets how text is aligned in a masked text box control.</summary> <value>One of the <see cref="T:System.Windows.Forms.HorizontalAlignment" /> enumeration values that specifies how text is aligned relative to the control. The default is <see cref="F:System.Windows.Forms.HorizontalAlignment.Left" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property to align the displayed text within a <xref:System.Windows.Forms.MaskedTextBox> to match the layout of visual elements on your form. For example, if your controls are all located on the right side of the form, you can set the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property to <xref:System.Windows.Forms.HorizontalAlignment.Right>, and the text will be aligned with the right side of the control instead of the default left alignment. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property to align the displayed text within a <xref:System.Windows.Forms.MaskedTextBox> to match the layout of visual elements on your form. For example, if your controls are all located on the right side of the form, you can set the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property to <xref:System.Windows.Forms.HorizontalAlignment.Right>, and the text will be aligned with the right side of the control instead of the default left alignment. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned to this property is not of type <see cref="T:System.Windows.Forms.HorizontalAlignment" />.</exception> @@ -3158,21 +3158,21 @@ <Docs> <summary>Occurs when the text alignment is changed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event is raised after the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property is changed. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event is raised after the <xref:System.Windows.Forms.MaskedTextBox.TextAlign%2A> property is changed. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MaskedTextBox> named `MaskedTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MaskedTextBox.TextAlignChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet487"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet487"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet487"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.TextAlign" /> @@ -3253,14 +3253,14 @@ <summary>Gets or sets a value that determines whether literals and prompt characters are included in the formatted string.</summary> <value>One of the <see cref="T:System.Windows.Forms.MaskFormat" /> values. The default is <see cref="F:System.Windows.Forms.MaskFormat.IncludeLiterals" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property determines how the literal and prompt characters in the mask are processed when the generating the formatted string. More specifically, it determines whether literal characters, prompt characters, or both are included in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. When prompt characters are excluded, they are transformed into spaces in the formatted string. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property determines how the literal and prompt characters in the mask are processed when the generating the formatted string. More specifically, it determines whether literal characters, prompt characters, or both are included in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property. When prompt characters are excluded, they are transformed into spaces in the formatted string. + > [!NOTE] -> The <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> property serves a similar purpose with respect to how the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is interpreted. - +> The <xref:System.Windows.Forms.MaskedTextBox.CutCopyMaskFormat%2A> property serves a similar purpose with respect to how the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is interpreted. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">Property set with a <see cref="T:System.Windows.Forms.MaskFormat" /> value that is not valid.</exception> @@ -3298,15 +3298,15 @@ <summary>Returns a string that represents the current masked text box. This method overrides <see cref="M:System.Windows.Forms.TextBoxBase.ToString" />.</summary> <returns>A <see cref="T:System.String" /> that contains information about the current <see cref="T:System.Windows.Forms.MaskedTextBox" />. The string includes the type, a simplified view of the input string, and the formatted input string.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the <xref:System.Windows.Forms.MaskedTextBox.ToString%2A> method calls the base class implementation of this method, <xref:System.Windows.Forms.TextBoxBase.ToString%2A?displayProperty=nameWithType>, then appends the input string after processing by the mask. This method honors properties that alter the appearance of the formatted string, with the following exceptions: - -- The returned string always includes prompt and literal characters, regardless of the values of the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. - -- Password characters are ignored, so that the actual user-typed characters are returned. In other words, the values of the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> and <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> properties are ignored. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the <xref:System.Windows.Forms.MaskedTextBox.ToString%2A> method calls the base class implementation of this method, <xref:System.Windows.Forms.TextBoxBase.ToString%2A?displayProperty=nameWithType>, then appends the input string after processing by the mask. This method honors properties that alter the appearance of the formatted string, with the following exceptions: + +- The returned string always includes prompt and literal characters, regardless of the values of the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. + +- Password characters are ignored, so that the actual user-typed characters are returned. In other words, the values of the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> and <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> properties are ignored. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Text" /> @@ -3347,37 +3347,37 @@ <Docs> <summary>Occurs when <see cref="T:System.Windows.Forms.MaskedTextBox" /> has finished parsing the current value using the <see cref="P:System.Windows.Forms.MaskedTextBox.ValidatingType" /> property.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox> control will optionally validate user input against the type defined by its <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A?displayProperty=nameWithType> property. When this property is not `null`, the following series of events occurs: - -1. The validation sequence begins when one of the following occurs: - - - <xref:System.Windows.Forms.MaskedTextBox> control looses focus. - - - The <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is retrieved. - - - The <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> method is called. - -2. Any of these events result in a call to the `Parse` method of the type specified with the <xref:System.Windows.Forms.TypeValidationEventArgs.ValidatingType%2A> property. `Parse` is responsible for the conversion of the formatted input string to the target type. A successful conversion equates to a successful validation. - -3. After `Parse` returns, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event is raised. The event handler for this event is most commonly implemented to perform type or mask validation processing. It receives a <xref:System.Windows.Forms.TypeValidationEventArgs> parameter containing information about the conversion; for example, the <xref:System.Windows.Forms.TypeValidationEventArgs.IsValidInput%2A> member indicates whether the conversion was successful. - -4. After the event handler for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event returns, the standard validation event, <xref:System.Windows.Forms.Control.Validating>, is raised. A handler can be implemented to perform standard validation, perhaps including canceling the event. - -5. If the event is not canceled in step 3, the standard control validation event <xref:System.Windows.Forms.Control.Validated> is raised. - - If the <xref:System.Windows.Forms.TypeValidationEventArgs.Cancel%2A> property is set to `true` in the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler, the event will be canceled and the <xref:System.Windows.Forms.MaskedTextBox> control retains focus, unless the subsequent <xref:System.Windows.Forms.Control.Validating> event sets its version of the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A?displayProperty=nameWithType> property back to `false`. - - - -## Examples - The following code example attempts to parse the user's input as a valid <xref:System.DateTime> object. If it fails, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler displays an error message to the user. If the value is a valid <xref:System.DateTime>, the code verifies that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a <xref:System.Windows.Forms.MaskedTextBox> control named `MaskedTextBox1` and a <xref:System.Windows.Forms.ToolTip> control named `ToolTip1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox> control will optionally validate user input against the type defined by its <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A?displayProperty=nameWithType> property. When this property is not `null`, the following series of events occurs: + +1. The validation sequence begins when one of the following occurs: + + - <xref:System.Windows.Forms.MaskedTextBox> control looses focus. + + - The <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property is retrieved. + + - The <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> method is called. + +2. Any of these events result in a call to the `Parse` method of the type specified with the <xref:System.Windows.Forms.TypeValidationEventArgs.ValidatingType%2A> property. `Parse` is responsible for the conversion of the formatted input string to the target type. A successful conversion equates to a successful validation. + +3. After `Parse` returns, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event is raised. The event handler for this event is most commonly implemented to perform type or mask validation processing. It receives a <xref:System.Windows.Forms.TypeValidationEventArgs> parameter containing information about the conversion; for example, the <xref:System.Windows.Forms.TypeValidationEventArgs.IsValidInput%2A> member indicates whether the conversion was successful. + +4. After the event handler for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event returns, the standard validation event, <xref:System.Windows.Forms.Control.Validating>, is raised. A handler can be implemented to perform standard validation, perhaps including canceling the event. + +5. If the event is not canceled in step 3, the standard control validation event <xref:System.Windows.Forms.Control.Validated> is raised. + + If the <xref:System.Windows.Forms.TypeValidationEventArgs.Cancel%2A> property is set to `true` in the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler, the event will be canceled and the <xref:System.Windows.Forms.MaskedTextBox> control retains focus, unless the subsequent <xref:System.Windows.Forms.Control.Validating> event sets its version of the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A?displayProperty=nameWithType> property back to `false`. + + + +## Examples + The following code example attempts to parse the user's input as a valid <xref:System.DateTime> object. If it fails, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler displays an error message to the user. If the value is a valid <xref:System.DateTime>, the code verifies that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a <xref:System.Windows.Forms.MaskedTextBox> control named `MaskedTextBox1` and a <xref:System.Windows.Forms.ToolTip> control named `ToolTip1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/TypeValidationCompleted/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Text" /> @@ -3418,11 +3418,11 @@ <Docs> <summary>Undoes the last edit operation in the text box. This method is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.Undo%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.Undo%2A> method is inherited from the base <xref:System.Windows.Forms.TextBoxBase> class. However, <xref:System.Windows.Forms.MaskedTextBox> does not support undo functionality. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.CanUndo" /> @@ -3470,14 +3470,14 @@ <value> <see langword="true" /> if the system password should be used as the prompt character; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> property determines whether user-supplied input should be displayed in the <xref:System.Windows.Forms.MaskedTextBox> as multiple occurrences of a password character defined by the operating system. <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> functions similarly to the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property, but instead of using a programmer-supplied character for the prompt, <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> uses a prompt defined by the operating system. This property has precedence over <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> property determines whether user-supplied input should be displayed in the <xref:System.Windows.Forms.MaskedTextBox> as multiple occurrences of a password character defined by the operating system. <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> functions similarly to the <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A> property, but instead of using a programmer-supplied character for the prompt, <xref:System.Windows.Forms.MaskedTextBox.UseSystemPasswordChar%2A> uses a prompt defined by the operating system. This property has precedence over <xref:System.Windows.Forms.MaskedTextBox.PasswordChar%2A>. + > [!IMPORTANT] -> As a security consideration, the <xref:System.Windows.Forms.MaskedTextBox> control disables cut and copy operations on password-protected strings. - +> As a security consideration, the <xref:System.Windows.Forms.MaskedTextBox> control disables cut and copy operations on password-protected strings. + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The password character specified is the same as the current prompt character, <see cref="P:System.Windows.Forms.MaskedTextBox.PromptChar" />. The two are required to be different.</exception> @@ -3520,13 +3520,13 @@ <summary>Converts the user input string to an instance of the validating type.</summary> <returns>If successful, an <see cref="T:System.Object" /> of the type specified by the <see cref="P:System.Windows.Forms.MaskedTextBox.ValidatingType" /> property; otherwise, <see langword="null" /> to indicate conversion failure.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> method attempts to convert the formatted string contained in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property to an instance of the type that is specified by the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. Prompt characters are ignored in the formatted string, but literals are handled in accordance with the current value of the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. - - <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> raises the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event after the conversion is attempted, regardless of its success. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> method attempts to convert the formatted string contained in the <xref:System.Windows.Forms.MaskedTextBox.Text%2A> property to an instance of the type that is specified by the <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> property. Prompt characters are ignored in the formatted string, but literals are handled in accordance with the current value of the <xref:System.Windows.Forms.MaskedTextBox.TextMaskFormat%2A> property. + + <xref:System.Windows.Forms.MaskedTextBox.ValidateText%2A> raises the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event after the conversion is attempted, regardless of its success. + ]]></format> </remarks> <exception cref="T:System.Exception">A critical exception occurred during the parsing of the input string.</exception> @@ -3581,37 +3581,37 @@ <summary>Gets or sets the data type used to verify the data input by the user.</summary> <value>A <see cref="T:System.Type" /> representing the data type used in validation. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Masks do not in themselves guarantee that a user's input will represent a valid value for a given type. The following C# code shows a mask: - -``` -maskedTextBox1.Mask = "99/99/9999"; -``` - - The following Visual Basic code shows a mask: - - `MaskedTextBox1.Mask = "99/99/9999"` - - This mask can demand that the user enter eight digits, but cannot verify that the user enters month, date, and year values in the correct range; "12/20/2003" and "70/90/0000" are equally valid as far as the mask is concerned. - - You can use <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> to verify whether the data entered by the user falls within the correct range - in the previously mentioned case, by assigning it an instance of the <xref:System.DateTime> type. The current text in the control will be validated either when the user leaves the control. You can determine whether or not the data fails validation by monitoring for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. <xref:System.Windows.Forms.MaskedTextBox> will only perform the check against <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> if <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> is `true`. - - If you want to use your own custom data types with <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A>, you must implement a static `Parse` method that takes a string as a parameter. This method must be implemented with one or both of the following signatures: - - `public static Object Parse(string)` - - `public static Object Parse(string, IFormatProvider)` - - - -## Examples - The following code example attempts to parse the user's input as a valid <xref:System.DateTime>. If it fails, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler displays an error message to the user. If the value is a valid <xref:System.DateTime>, the code performs an additional check to ensure that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a <xref:System.Windows.Forms.MaskedTextBox> control named `MaskedTextBox1` and a <xref:System.Windows.Forms.ToolTip> control named `ToolTip1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Masks do not in themselves guarantee that a user's input will represent a valid value for a given type. The following C# code shows a mask: + +``` +maskedTextBox1.Mask = "99/99/9999"; +``` + + The following Visual Basic code shows a mask: + + `MaskedTextBox1.Mask = "99/99/9999"` + + This mask can demand that the user enter eight digits, but cannot verify that the user enters month, date, and year values in the correct range; "12/20/2003" and "70/90/0000" are equally valid as far as the mask is concerned. + + You can use <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> to verify whether the data entered by the user falls within the correct range - in the previously mentioned case, by assigning it an instance of the <xref:System.DateTime> type. The current text in the control will be validated either when the user leaves the control. You can determine whether or not the data fails validation by monitoring for the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event. <xref:System.Windows.Forms.MaskedTextBox> will only perform the check against <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A> if <xref:System.Windows.Forms.MaskedTextBox.MaskCompleted%2A> is `true`. + + If you want to use your own custom data types with <xref:System.Windows.Forms.MaskedTextBox.ValidatingType%2A>, you must implement a static `Parse` method that takes a string as a parameter. This method must be implemented with one or both of the following signatures: + + `public static Object Parse(string)` + + `public static Object Parse(string, IFormatProvider)` + + + +## Examples + The following code example attempts to parse the user's input as a valid <xref:System.DateTime>. If it fails, the <xref:System.Windows.Forms.MaskedTextBox.TypeValidationCompleted> event handler displays an error message to the user. If the value is a valid <xref:System.DateTime>, the code performs an additional check to ensure that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a <xref:System.Windows.Forms.MaskedTextBox> control named `MaskedTextBox1` and a <xref:System.Windows.Forms.ToolTip> control named `ToolTip1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/TypeValidationCompleted/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Mask" /> @@ -3695,11 +3695,11 @@ maskedTextBox1.Mask = "99/99/9999"; <summary>Gets or sets a value indicating whether a multiline text box control automatically wraps words to the beginning of the next line when necessary. This property is not supported by <see cref="T:System.Windows.Forms.MaskedTextBox" />.</summary> <value>The <see cref="P:System.Windows.Forms.MaskedTextBox.WordWrap" /> property always returns <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Because <xref:System.Windows.Forms.MaskedTextBox> does not support multiple lines of input, the <xref:System.Windows.Forms.MaskedTextBox.WordWrap%2A> property is ignored. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Because <xref:System.Windows.Forms.MaskedTextBox> does not support multiple lines of input, the <xref:System.Windows.Forms.MaskedTextBox.WordWrap%2A> property is ignored. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MaskedTextBox.Multiline" /> diff --git a/xml/System.Windows.Forms/MdiClient.xml b/xml/System.Windows.Forms/MdiClient.xml index 092bd71a6fb..31daf29d9c5 100644 --- a/xml/System.Windows.Forms/MdiClient.xml +++ b/xml/System.Windows.Forms/MdiClient.xml @@ -46,15 +46,15 @@ <Docs> <summary>Represents the container for multiple-document interface (MDI) child forms. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Don't create an <xref:System.Windows.Forms.MdiClient> control. A form creates and uses the <xref:System.Windows.Forms.MdiClient> when you set the <xref:System.Windows.Forms.Form.IsMdiContainer%2A> property to `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Don't create an <xref:System.Windows.Forms.MdiClient> control. A form creates and uses the <xref:System.Windows.Forms.MdiClient> when you set the <xref:System.Windows.Forms.Form.IsMdiContainer%2A> property to `true`. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-an-mdi-window-list-with-menustrip-windows-forms">How To: Create an MDI Window List with MenuStrip (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-an-mdi-form-with-menu-merging-and-toolstrip-controls">How to: Create an MDI Form with Menu Merging and ToolStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-an-mdi-window-list-with-menustrip-windows-forms">How To: Create an MDI Window List with MenuStrip (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-an-mdi-form-with-menu-merging-and-toolstrip-controls">How to: Create an MDI Form with Menu Merging and ToolStrip Controls</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -120,11 +120,11 @@ <summary>Gets or sets the background image displayed in the <see cref="T:System.Windows.Forms.MdiClient" /> control.</summary> <value>The image to display in the background of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.MdiClient.BackgroundImage%2A> property to get and set the background image of a form's MDI client area. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.MdiClient.BackgroundImage%2A> property to get and set the background image of a form's MDI client area. + ]]></format> </remarks> </Docs> @@ -256,11 +256,11 @@ <param name="value">One of the enumeration values that defines the layout of MDI child forms.</param> <summary>Arranges the multiple-document interface (MDI) child forms within the MDI parent form.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Form.LayoutMdi%2A> method to arrange MDI child forms on a parent form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Form.LayoutMdi%2A> method to arrange MDI child forms on a parent form. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MdiLayout" /> @@ -293,11 +293,11 @@ <summary>Gets the child multiple-document interface (MDI) forms of the <see cref="T:System.Windows.Forms.MdiClient" /> control.</summary> <value>A <see cref="T:System.Windows.Forms.Form" /> array that contains the child MDI forms of the <see cref="T:System.Windows.Forms.MdiClient" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.Form.MdiChildren%2A> property to get the child MDI forms of the <xref:System.Windows.Forms.MdiClient>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.Form.MdiChildren%2A> property to get the child MDI forms of the <xref:System.Windows.Forms.MdiClient>. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/MenuStrip.xml b/xml/System.Windows.Forms/MenuStrip.xml index 29defbab9e0..ba90af89193 100644 --- a/xml/System.Windows.Forms/MenuStrip.xml +++ b/xml/System.Windows.Forms/MenuStrip.xml @@ -37,36 +37,36 @@ <Docs> <summary>Provides a menu system for a form.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.MenuStrip> is the top-level container that supersedes <xref:System.Windows.Forms.MainMenu>. It also provides key handling and multiple document interface (MDI) features. Functionally, <xref:System.Windows.Forms.ToolStripDropDownItem> and <xref:System.Windows.Forms.ToolStripMenuItem> work along with <xref:System.Windows.Forms.MenuStrip>, although they are derived from <xref:System.Windows.Forms.ToolStripItem>. - - The following items are specifically designed to work seamlessly with both <xref:System.Windows.Forms.ToolStripSystemRenderer> and <xref:System.Windows.Forms.ToolStripProfessionalRenderer> in all orientations. They are available by default at design time for the <xref:System.Windows.Forms.MenuStrip> control: - -- <xref:System.Windows.Forms.ToolStripMenuItem> - -- <xref:System.Windows.Forms.ToolStripTextBox> - -- <xref:System.Windows.Forms.ToolStripComboBox> - - The <xref:System.Windows.Forms.MenuStrip> control represents the container for the menu structure of a form. You can add <xref:System.Windows.Forms.ToolStripMenuItem> objects to the <xref:System.Windows.Forms.MenuStrip> that represent the individual menu commands in the menu structure. Each <xref:System.Windows.Forms.ToolStripMenuItem> can be a command for your application or a parent menu for other submenu items. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.MenuStrip> is the top-level container that supersedes <xref:System.Windows.Forms.MainMenu>. It also provides key handling and multiple document interface (MDI) features. Functionally, <xref:System.Windows.Forms.ToolStripDropDownItem> and <xref:System.Windows.Forms.ToolStripMenuItem> work along with <xref:System.Windows.Forms.MenuStrip>, although they are derived from <xref:System.Windows.Forms.ToolStripItem>. + + The following items are specifically designed to work seamlessly with both <xref:System.Windows.Forms.ToolStripSystemRenderer> and <xref:System.Windows.Forms.ToolStripProfessionalRenderer> in all orientations. They are available by default at design time for the <xref:System.Windows.Forms.MenuStrip> control: + +- <xref:System.Windows.Forms.ToolStripMenuItem> + +- <xref:System.Windows.Forms.ToolStripTextBox> + +- <xref:System.Windows.Forms.ToolStripComboBox> + + The <xref:System.Windows.Forms.MenuStrip> control represents the container for the menu structure of a form. You can add <xref:System.Windows.Forms.ToolStripMenuItem> objects to the <xref:System.Windows.Forms.MenuStrip> that represent the individual menu commands in the menu structure. Each <xref:System.Windows.Forms.ToolStripMenuItem> can be a command for your application or a parent menu for other submenu items. + The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System.Windows.Forms.MainMenu> control, which was removed in .NET Core 3.1. -## Examples - The following code example demonstrates a <xref:System.Windows.Forms.MenuStrip> in a multiple-document interface (MDI) scenario. - +## Examples + The following code example demonstrates a <xref:System.Windows.Forms.MenuStrip> in a multiple-document interface (MDI) scenario. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripMenuItem" /> <altmember cref="T:System.Windows.Forms.ContextMenu" /> - <related type="Article" href="/dotnet/framework/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-configure-menustrip-check-margins-and-image-margins">How to: Configure MenuStrip Check Margins and Image Margins</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-provide-standard-menu-items-to-a-form">How to: Provide Standard Menu Items to a Form</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-configure-menustrip-check-margins-and-image-margins">How to: Configure MenuStrip Check Margins and Image Margins</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-provide-standard-menu-items-to-a-form">How to: Provide Standard Menu Items to a Form</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -91,17 +91,17 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.MenuStrip" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks Use this constructor to create a <xref:System.Windows.Forms.MenuStrip> to which you can add <xref:System.Windows.Forms.ToolStripMenuItem> objects. -## Examples - The following code example demonstrates the <xref:System.Windows.Forms.MenuStrip.%23ctor%2A> constructor. This example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripPanel> class. - +## Examples + The following code example demonstrates the <xref:System.Windows.Forms.MenuStrip.%23ctor%2A> constructor. This example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripPanel> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: + ]]></format> </remarks> </Docs> @@ -143,11 +143,11 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.MenuStrip" /> supports overflow functionality; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The overflow feature moves menu items to a drop-down menu when there is not enough room to display them in a <xref:System.Windows.Forms.MenuStrip>. When you set the <xref:System.Windows.Forms.MenuStrip.CanOverflow%2A> property to `true`, you must also enable overflow for specific menu items by setting the <xref:System.Windows.Forms.ToolStripMenuItem.Overflow%2A?displayProperty=nameWithType> property. By default, menu items are not displayed if they cannot fit within the available space. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The overflow feature moves menu items to a drop-down menu when there is not enough room to display them in a <xref:System.Windows.Forms.MenuStrip>. When you set the <xref:System.Windows.Forms.MenuStrip.CanOverflow%2A> property to `true`, you must also enable overflow for specific menu items by setting the <xref:System.Windows.Forms.ToolStripMenuItem.Overflow%2A?displayProperty=nameWithType> property. By default, menu items are not displayed if they cannot fit within the available space. + ]]></format> </remarks> </Docs> @@ -179,16 +179,16 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <summary>Creates a new accessibility object for the control.</summary> <returns>A new <see cref="T:System.Windows.Forms.AccessibleObject" /> for the control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call the <xref:System.Windows.Forms.MenuStrip.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A?displayProperty=nameWithType> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call the <xref:System.Windows.Forms.MenuStrip.CreateAccessibilityInstance%2A> method, it will be called when the <xref:System.Windows.Forms.Control.AccessibilityObject%2A?displayProperty=nameWithType> property is referenced. + > [!NOTE] -> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A?displayProperty=nameWithType> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - - For a code example of using <xref:System.Windows.Forms.MenuStrip.CreateAccessibilityInstance%2A>, see <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A?displayProperty=nameWithType>. - +> To get or set the <xref:System.Windows.Forms.Control.AccessibilityObject%2A?displayProperty=nameWithType> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + + For a code example of using <xref:System.Windows.Forms.MenuStrip.CreateAccessibilityInstance%2A>, see <xref:System.Windows.Forms.Control.CreateAccessibilityInstance%2A?displayProperty=nameWithType>. + ]]></format> </remarks> </Docs> @@ -228,11 +228,11 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <summary>Creates a <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> with the specified text, image, and event handler on a new <see cref="T:System.Windows.Forms.MenuStrip" />.</summary> <returns>A <see cref="M:System.Windows.Forms.ToolStripMenuItem.#ctor(System.String,System.Drawing.Image,System.EventHandler)" />, or a <see cref="T:System.Windows.Forms.ToolStripSeparator" /> if the <paramref name="text" /> parameter is a hyphen (-).</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.MenuStrip.CreateDefaultItem%2A> method to add a <xref:System.Windows.Forms.ToolStripMenuItem> with commonly used characteristics to a <xref:System.Windows.Forms.MenuStrip>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.MenuStrip.CreateDefaultItem%2A> method to add a <xref:System.Windows.Forms.ToolStripMenuItem> with commonly used characteristics to a <xref:System.Windows.Forms.MenuStrip>. + ]]></format> </remarks> </Docs> @@ -292,11 +292,11 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <summary>Gets the spacing, in pixels, between the left, right, top, and bottom edges of the <see cref="T:System.Windows.Forms.MenuStrip" /> from the edges of the form.</summary> <value>A <see cref="T:System.Windows.Forms.Padding" /> that represents the spacing. The default is <c>{Left=6, Top=2, Right=0, Bottom=2}</c>.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.MenuStrip.DefaultPadding%2A> property to set the interior space between controls. When a control is a container of items, padding represents the space from the edge of the container. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.MenuStrip.DefaultPadding%2A> property to set the interior space between controls. When a control is a container of items, padding represents the space from the edge of the container. + ]]></format> </remarks> </Docs> @@ -328,11 +328,11 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MenuStrip.DefaultShowItemToolTips%2A?displayProperty=nameWithType> property always returns `false` because typically, ToolTips are not used for menus or menu items. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MenuStrip.DefaultShowItemToolTips%2A?displayProperty=nameWithType> property always returns `false` because typically, ToolTips are not used for menus or menu items. + ]]></format> </remarks> </Docs> @@ -448,19 +448,19 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <summary>Gets or sets the <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> that is used to display a list of Multiple-document interface (MDI) child forms.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> that represents the menu item displaying a list of MDI child forms that are open in the application.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.MenuStrip.MdiWindowListItem%2A> property to designate or discover which <xref:System.Windows.Forms.ToolStripMenuItem> displays MDI children. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.MenuStrip.MdiWindowListItem%2A> property to designate or discover which <xref:System.Windows.Forms.ToolStripMenuItem> displays MDI children. + Use the <xref:System.Windows.Forms.MenuStrip.MenuActivate> and <xref:System.Windows.Forms.MenuStrip.MenuDeactivate> events on child menus to reflect changes to the value of <xref:System.Windows.Forms.MenuStrip.MdiWindowListItem%2A>. -## Examples - The following code example demonstrates the <xref:System.Windows.Forms.MenuStrip.MdiWindowListItem%2A> property. This example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripPanel> class. - +## Examples + The following code example demonstrates the <xref:System.Windows.Forms.MenuStrip.MdiWindowListItem%2A> property. This example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripPanel> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: + ]]></format> </remarks> </Docs> @@ -491,21 +491,21 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <Docs> <summary>Occurs when the user accesses the menu with the keyboard or mouse.</summary> <remarks> - <format type="text/markdown"><. -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MenuStrip.MenuActivate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MenuStrip> named `MenuStrip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MenuStrip.MenuActivate> event. - +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MenuStrip.MenuActivate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MenuStrip> named `MenuStrip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MenuStrip.MenuActivate> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet489"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet489"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet489"::: + ]]></format> </remarks> </Docs> @@ -536,21 +536,21 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.MenuStrip" /> is deactivated.</summary> <remarks> - <format type="text/markdown"><. -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MenuStrip.MenuDeactivate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MenuStrip> named `MenuStrip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MenuStrip.MenuDeactivate> event. - +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.MenuStrip.MenuDeactivate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.MenuStrip> named `MenuStrip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.MenuStrip.MenuDeactivate> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet490"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet490"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet490"::: + ]]></format> </remarks> </Docs> @@ -584,13 +584,13 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MenuStrip.MenuActivate" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MenuStrip.OnMenuActivate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MenuStrip.OnMenuActivate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -627,13 +627,13 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.MenuStrip.MenuDeactivate" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.MenuStrip.OnMenuDeactivate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.MenuStrip.OnMenuDeactivate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -709,11 +709,11 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <value> <see langword="true" /> if ToolTips are shown for the <see cref="T:System.Windows.Forms.MenuStrip" />; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.MenuStrip.ShowItemToolTips%2A?displayProperty=nameWithType> property returns `false` by default because typically, ToolTips are not used for menus or menu items. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.MenuStrip.ShowItemToolTips%2A?displayProperty=nameWithType> property returns `false` by default because typically, ToolTips are not used for menus or menu items. + ]]></format> </remarks> </Docs> @@ -782,22 +782,22 @@ The <xref:System.Windows.Forms.MenuStrip> replaces and extends the <xref:System. <param name="m">The Windows <see cref="T:System.Windows.Forms.Message" /> to process.</param> <summary>Processes Windows messages.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates overriding the <xref:System.Windows.Forms.Control.WndProc%2A> method to handle operating system messages identified in the <xref:System.Windows.Forms.Message> structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at <https://learn.microsoft.com> to understand the available <xref:System.Windows.Forms.Message.Msg%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.Message.LParam%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.Message.WParam%2A?displayProperty=nameWithType> values. Actual constant values can be found in the windows.h header file included in the Platform SDK (Core SDK section) download, which is also available on Docs. - + + + +## Examples + The following code example demonstrates overriding the <xref:System.Windows.Forms.Control.WndProc%2A> method to handle operating system messages identified in the <xref:System.Windows.Forms.Message> structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at <https://learn.microsoft.com> to understand the available <xref:System.Windows.Forms.Message.Msg%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.Message.LParam%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.Message.WParam%2A?displayProperty=nameWithType> values. Actual constant values can be found in the windows.h header file included in the Platform SDK (Core SDK section) download, which is also available on Docs. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox/WndProc/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <block subset="none" type="overrides"> diff --git a/xml/System.Windows.Forms/MessageBoxOptions.xml b/xml/System.Windows.Forms/MessageBoxOptions.xml index 62ffbf39eb0..8ef70707127 100644 --- a/xml/System.Windows.Forms/MessageBoxOptions.xml +++ b/xml/System.Windows.Forms/MessageBoxOptions.xml @@ -29,22 +29,22 @@ <Docs> <summary>Specifies options on a <see cref="T:System.Windows.Forms.MessageBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ -This enumeration is used by the <xref:System.Windows.Forms.MessageBox> class. +## Remarks -If you do not want to specify an argument when calling methods on <xref:System.Windows.Forms.MessageBox>, you can pass in 0 instead. +This enumeration is used by the <xref:System.Windows.Forms.MessageBox> class. + +If you do not want to specify an argument when calling methods on <xref:System.Windows.Forms.MessageBox>, you can pass in 0 instead. ## Examples -The following example demonstrates how to display a <xref:System.Windows.Forms.MessageBox> with the options supported by the overloads of <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> that include an `options` parameter. After verifying that a string variable, `ServerName`, is empty, the example displays a <xref:System.Windows.Forms.MessageBox> with a question box icon, offering the user the option to cancel the operation. The example uses the `MessageBoxOptions.RightAlign` enumeration member to align the text to the right edge of the dialog box. If the <xref:System.Windows.Forms.MessageBox.Show%2A> method's return value evaluates to <xref:System.Windows.Forms.DialogResult.Yes?displayProperty=nameWithType>, the form that displayed the <xref:System.Windows.Forms.MessageBox> is closed. - +The following example demonstrates how to display a <xref:System.Windows.Forms.MessageBox> with the options supported by the overloads of <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> that include an `options` parameter. After verifying that a string variable, `ServerName`, is empty, the example displays a <xref:System.Windows.Forms.MessageBox> with a question box icon, offering the user the option to cancel the operation. The example uses the `MessageBoxOptions.RightAlign` enumeration member to align the text to the right edge of the dialog box. If the <xref:System.Windows.Forms.MessageBox.Show%2A> method's return value evaluates to <xref:System.Windows.Forms.DialogResult.Yes?displayProperty=nameWithType>, the form that displayed the <xref:System.Windows.Forms.MessageBox> is closed. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MessageBox.Show Variations/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DialogResult/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MessageBox.Show Variations/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MessageBox.Show Variations/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -74,7 +74,7 @@ The following example demonstrates how to display a <xref:System.Windows.Forms.M </ReturnValue> <MemberValue>131072</MemberValue> <Docs> - <summary>The message box is displayed on the active desktop. This constant is similar to `ServiceNotification`, except that the system displays the message box only on the default desktop of the interactive window station. The application that displayed the message box loses focus, and the message box is displayed without using visual styles. For more information, see <see href="https://learn.microsoft.com/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles">Rendering Controls with Visual Styles</see>.</summary> + <summary>The message box is displayed on the active desktop. This constant is similar to `ServiceNotification`, except that the system displays the message box only on the default desktop of the interactive window station. The application that displayed the message box loses focus, and the message box is displayed without using visual styles. For more information, see <see href="https://learn.microsoft.com/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles">Rendering Controls with Visual Styles</see>.</summary> </Docs> </Member> <Member MemberName="RightAlign"> diff --git a/xml/System.Windows.Forms/MonthCalendar.xml b/xml/System.Windows.Forms/MonthCalendar.xml index 9aa9995c2ad..c21f139f61e 100644 --- a/xml/System.Windows.Forms/MonthCalendar.xml +++ b/xml/System.Windows.Forms/MonthCalendar.xml @@ -90,10 +90,10 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DateTimePicker" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-change-monthcalendar-control-appearance">How to: Change the Windows Forms MonthCalendar Control's Appearance</related> - <related type="Article" href="/dotnet/framework/winforms/controls/display-more-than-one-month-wf-monthcalendar-control">How to: Display More than One Month in the Windows Forms MonthCalendar Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/display-specific-days-in-bold-with-wf-monthcalendar-control">How to: Display Specific Days in Bold with the Windows Forms MonthCalendar Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-select-a-range-of-dates-in-the-windows-forms-monthcalendar-control">How to: Select a Range of Dates in the Windows Forms MonthCalendar Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-change-monthcalendar-control-appearance">How to: Change the Windows Forms MonthCalendar Control's Appearance</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/display-more-than-one-month-wf-monthcalendar-control">How to: Display More than One Month in the Windows Forms MonthCalendar Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/display-specific-days-in-bold-with-wf-monthcalendar-control">How to: Display Specific Days in Bold with the Windows Forms MonthCalendar Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-select-a-range-of-dates-in-the-windows-forms-monthcalendar-control">How to: Select a Range of Dates in the Windows Forms MonthCalendar Control</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/MouseEventArgs.xml b/xml/System.Windows.Forms/MouseEventArgs.xml index c08a73b330a..259e271bd07 100644 --- a/xml/System.Windows.Forms/MouseEventArgs.xml +++ b/xml/System.Windows.Forms/MouseEventArgs.xml @@ -30,35 +30,35 @@ <Docs> <summary>Provides data for the <see cref="E:System.Windows.Forms.Control.MouseUp" />, <see cref="E:System.Windows.Forms.Control.MouseDown" />, and <see cref="E:System.Windows.Forms.Control.MouseMove" /> events.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example handles the <xref:System.Windows.Forms.Control.MouseDown> event on a <xref:System.Windows.Forms.TextBox> control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a <xref:System.Windows.Forms.TextBox> control that is named `textBox1`. - + <format type="text/markdown"><. + + + +## Examples + The following code example handles the <xref:System.Windows.Forms.Control.MouseDown> event on a <xref:System.Windows.Forms.TextBox> control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a <xref:System.Windows.Forms.TextBox> control that is named `textBox1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: - - The following code example uses the `Location` property to track clicks of the left mouse button and to draw a series of straight line segments in response to user input. The example does not redraw the lines if you hide the form and then redisplay it; this code has been omitted for simplicity. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: + + The following code example uses the `Location` property to track clicks of the left mouse button and to draw a series of straight line segments in response to user input. The example does not redraw the lines if you hide the form and then redisplay it; this code has been omitted for simplicity. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: - - The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: + + The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs)" /> @@ -150,14 +150,14 @@ <summary>Gets which mouse button was pressed.</summary> <value>One of the <see cref="T:System.Windows.Forms.MouseButtons" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example handles the <xref:System.Windows.Forms.Control.MouseDown> event on a <xref:System.Windows.Forms.TextBox> control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a <xref:System.Windows.Forms.TextBox> control named `textBox1`. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example handles the <xref:System.Windows.Forms.Control.MouseDown> event on a <xref:System.Windows.Forms.TextBox> control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a <xref:System.Windows.Forms.TextBox> control named `textBox1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MouseButtons" /> @@ -199,21 +199,21 @@ <summary>Gets the number of times the mouse button was pressed and released.</summary> <value>An <see cref="T:System.Int32" /> that contains the number of times the mouse button was pressed and released.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Although the Windows interface defines standard mouse events as either single-clicks or double-clicks, individual applications can interpret a larger number of clicks as a single event. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.Control>, such as a <xref:System.Windows.Forms.Button> or <xref:System.Windows.Forms.ComboBox>. Then name the instance `Control1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Although the Windows interface defines standard mouse events as either single-clicks or double-clicks, individual applications can interpret a larger number of clicks as a single event. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.Control>, such as a <xref:System.Windows.Forms.Button> or <xref:System.Windows.Forms.ComboBox>. Then name the instance `Control1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet54"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Button" /> @@ -253,23 +253,23 @@ <summary>Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel.</summary> <value>A signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The mouse wheel combines the features of a wheel and a mouse button. The wheel has discrete, evenly spaced notches. When you rotate the wheel, a wheel message is sent as each notch is encountered. One wheel notch, a detent, is defined by the windows constant WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward (away from the user); a negative value indicates that the wheel was rotated backward (toward the user). - - Currently, a value of 120 is the standard for one detent. If higher resolution mice are introduced, the definition of WHEEL_DELTA might become smaller. Most applications should check for a positive or negative value rather than an aggregate total. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.Control>, such as a <xref:System.Windows.Forms.Button> or <xref:System.Windows.Forms.ComboBox>. Then name the instance `Control1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The mouse wheel combines the features of a wheel and a mouse button. The wheel has discrete, evenly spaced notches. When you rotate the wheel, a wheel message is sent as each notch is encountered. One wheel notch, a detent, is defined by the windows constant WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward (away from the user); a negative value indicates that the wheel was rotated backward (toward the user). + + Currently, a value of 120 is the standard for one detent. If higher resolution mice are introduced, the definition of WHEEL_DELTA might become smaller. Most applications should check for a positive or negative value rather than an aggregate total. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.Control>, such as a <xref:System.Windows.Forms.Button> or <xref:System.Windows.Forms.ComboBox>. Then name the instance `Control1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.Control.MouseClick?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet54"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Button" /> @@ -302,21 +302,21 @@ <summary>Gets the location of the mouse during the generating mouse event.</summary> <value>A <see cref="T:System.Drawing.Point" /> that contains the x- and y- mouse coordinates, in pixels, relative to the upper-left corner of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.Location%2A> property to track left mouse clicks and draw a series of straight line segments in response to user input. The example does not persist the drawn lines if you hide the form and then redisplay it; this code was omitted for simplicity. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.Location%2A> property to track left mouse clicks and draw a series of straight line segments in response to user input. The example does not persist the drawn lines if you hide the form and then redisplay it; this code was omitted for simplicity. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Button" /> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Y" /> <altmember cref="P:System.Windows.Forms.MouseEventArgs.X" /> - <related type="Article" href="/dotnet/framework/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> - <related type="Article" href="/dotnet/framework/winforms/mouse-events-in-windows-forms">Mouse Events in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> + <related type="Article" href="/dotnet/desktop/winforms/mouse-events-in-windows-forms">Mouse Events in Windows Forms</related> </Docs> </Member> <Member MemberName="X"> @@ -352,19 +352,19 @@ <summary>Gets the x-coordinate of the mouse during the generating mouse event.</summary> <value>The x-coordinate of the mouse, in pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The mouse coordinates vary based on the event being raised. For example, when the <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse-coordinate values that are relative to the form origin or the screen origin. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The mouse coordinates vary based on the event being raised. For example, when the <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse-coordinate values that are relative to the form origin or the screen origin. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Button" /> @@ -405,19 +405,19 @@ <summary>Gets the y-coordinate of the mouse during the generating mouse event.</summary> <value>The y-coordinate of the mouse, in pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The mouse coordinates vary based on the event being raised. For example, when the <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse coordinate values that are relative to the form origin or the screen origin. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. To use this code, call `TrackCoordinates` from the form constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The mouse coordinates vary based on the event being raised. For example, when the <xref:System.Windows.Forms.Control.MouseMove?displayProperty=nameWithType> event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse coordinate values that are relative to the form origin or the screen origin. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.MouseEventArgs.X%2A> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A> properties to display the current position of the mouse pointer in a <xref:System.Windows.Forms.ToolTip> window. To use this code, call `TrackCoordinates` from the form constructor. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.MouseEventArgs.Button" /> diff --git a/xml/System.Windows.Forms/Padding.xml b/xml/System.Windows.Forms/Padding.xml index 1d76fb35859..131d6050421 100644 --- a/xml/System.Windows.Forms/Padding.xml +++ b/xml/System.Windows.Forms/Padding.xml @@ -56,37 +56,37 @@ <Docs> <summary>Represents padding or margin information associated with a user interface (UI) element.</summary> <remarks> - <format type="text/markdown"><. - - Padding has a different effect on controls that are containers than on controls that are not. For example, in a <xref:System.Windows.Forms.Panel> control, the <xref:System.Windows.Forms.Padding> property defines the spacing between the border of the <xref:System.Windows.Forms.Panel> and its child controls. For a <xref:System.Windows.Forms.Button> control, the <xref:System.Windows.Forms.Padding> property defines the spacing between the border of the <xref:System.Windows.Forms.Button> control and its contained text. - - In addition to typical methods and properties, <xref:System.Windows.Forms.Padding> also defines the following type-level members: - -- The <xref:System.Windows.Forms.Padding.Empty> field, which represents a predefined <xref:System.Windows.Forms.Padding> with no padding. - -- A set of operators for performing common arithmetic operations for the class, such as adding two <xref:System.Windows.Forms.Padding> objects together. For languages that do not support operator overloading, you can invoke these members by using alternative method syntax. - -- The <xref:System.Windows.Forms.Padding.Horizontal%2A>, <xref:System.Windows.Forms.Padding.Vertical%2A>, and <xref:System.Windows.Forms.Padding.Size%2A> properties, which provide combined values that are convenient for use in custom layout calculations. - - - -## Examples - The following code example demonstrates how to use the Padding property to create an outline around a <xref:System.Windows.Forms.RichTextBox> control. - - For a full code listing, see [How to: Create a Border Around a Windows Forms Control Using Padding](/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding). - + <format type="text/markdown"><. + + Padding has a different effect on controls that are containers than on controls that are not. For example, in a <xref:System.Windows.Forms.Panel> control, the <xref:System.Windows.Forms.Padding> property defines the spacing between the border of the <xref:System.Windows.Forms.Panel> and its child controls. For a <xref:System.Windows.Forms.Button> control, the <xref:System.Windows.Forms.Padding> property defines the spacing between the border of the <xref:System.Windows.Forms.Button> control and its contained text. + + In addition to typical methods and properties, <xref:System.Windows.Forms.Padding> also defines the following type-level members: + +- The <xref:System.Windows.Forms.Padding.Empty> field, which represents a predefined <xref:System.Windows.Forms.Padding> with no padding. + +- A set of operators for performing common arithmetic operations for the class, such as adding two <xref:System.Windows.Forms.Padding> objects together. For languages that do not support operator overloading, you can invoke these members by using alternative method syntax. + +- The <xref:System.Windows.Forms.Padding.Horizontal%2A>, <xref:System.Windows.Forms.Padding.Vertical%2A>, and <xref:System.Windows.Forms.Padding.Size%2A> properties, which provide combined values that are convenient for use in custom layout calculations. + + + +## Examples + The following code example demonstrates how to use the Padding property to create an outline around a <xref:System.Windows.Forms.RichTextBox> control. + + For a full code listing, see [How to: Create a Border Around a Windows Forms Control Using Padding](/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Padding/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Padding/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Padding/VB/Form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.Padding" /> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -127,16 +127,16 @@ <param name="all">The number of pixels to be used for padding for all edges.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Padding" /> class using the supplied padding size for all edges.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A>, <xref:System.Windows.Forms.Padding.Top%2A> and <xref:System.Windows.Forms.Padding.All%2A> properties to the value of the `all` parameter. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A>, <xref:System.Windows.Forms.Padding.Top%2A> and <xref:System.Windows.Forms.Padding.All%2A> properties to the value of the `all` parameter. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.All" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName=".ctor"> @@ -174,19 +174,19 @@ <param name="bottom">The padding size, in pixels, for the bottom edge.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.Padding" /> class using a separate padding size for each edge.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If all of the parameter values are equal, then the <xref:System.Windows.Forms.Padding.All%2A> property will reflect this common value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If all of the parameter values are equal, then the <xref:System.Windows.Forms.Padding.All%2A> property will reflect this common value. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Left" /> <altmember cref="P:System.Windows.Forms.Padding.Top" /> <altmember cref="P:System.Windows.Forms.Padding.Right" /> <altmember cref="P:System.Windows.Forms.Padding.Bottom" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Add"> @@ -230,8 +230,8 @@ <summary>Computes the sum of the two specified <see cref="T:System.Windows.Forms.Padding" /> values.</summary> <returns>A <see cref="T:System.Windows.Forms.Padding" /> that contains the sum of the two specified <see cref="T:System.Windows.Forms.Padding" /> values.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="All"> @@ -277,21 +277,21 @@ <summary>Gets or sets the padding value for all the edges.</summary> <value>The padding, in pixels, for all edges if the same; otherwise, -1.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When retrieving this property, if all the edges use the same padding value, then this common value is returned. Otherwise, -1 is returned to indicate that all the padding values are not equal. - - Setting this value changes the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A>, and <xref:System.Windows.Forms.Padding.Top%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When retrieving this property, if all the edges use the same padding value, then this common value is returned. Otherwise, -1 is returned to indicate that all the padding values are not equal. + + Setting this value changes the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A>, and <xref:System.Windows.Forms.Padding.Top%2A> properties. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Left" /> <altmember cref="P:System.Windows.Forms.Padding.Top" /> <altmember cref="P:System.Windows.Forms.Padding.Right" /> <altmember cref="P:System.Windows.Forms.Padding.Bottom" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Bottom"> @@ -337,19 +337,19 @@ <summary>Gets or sets the padding value for the bottom edge.</summary> <value>The padding, in pixels, for the bottom edge.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Left" /> <altmember cref="P:System.Windows.Forms.Padding.Top" /> <altmember cref="P:System.Windows.Forms.Padding.Right" /> <altmember cref="P:System.Windows.Forms.Padding.All" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Empty"> @@ -380,18 +380,18 @@ <Docs> <summary>Provides a <see cref="T:System.Windows.Forms.Padding" /> object with no padding.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An empty padding object is defined as having the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A> and <xref:System.Windows.Forms.Padding.Top%2A> padding properties set to 0. - - This immutable field is useful for comparison operations and initializations. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An empty padding object is defined as having the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A> and <xref:System.Windows.Forms.Padding.Top%2A> padding properties set to 0. + + This immutable field is useful for comparison operations and initializations. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.#ctor(System.Int32)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Equals"> @@ -436,17 +436,17 @@ <returns> <see langword="true" /> if the <see cref="T:System.Windows.Forms.Padding" /> objects are equivalent; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Only other objects of type <xref:System.Windows.Forms.Padding> (or a derived type) can be equal to the current <xref:System.Windows.Forms.Padding>. In addition, the corresponding <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A> and <xref:System.Windows.Forms.Padding.Top%2A> properties for both <xref:System.Windows.Forms.Padding> objects must be the same. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Only other objects of type <xref:System.Windows.Forms.Padding> (or a derived type) can be equal to the current <xref:System.Windows.Forms.Padding>. In addition, the corresponding <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Bottom%2A> and <xref:System.Windows.Forms.Padding.Top%2A> properties for both <xref:System.Windows.Forms.Padding> objects must be the same. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.op_Equality(System.Windows.Forms.Padding,System.Windows.Forms.Padding)" /> <altmember cref="M:System.Windows.Forms.Padding.GetHashCode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Equals"> @@ -528,21 +528,21 @@ <summary>Generates a hash code for the current <see cref="T:System.Windows.Forms.Padding" />.</summary> <returns>A 32-bit signed integer hash code.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.Padding.GetHashCode%2A> method uses the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Top%2A>, and <xref:System.Windows.Forms.Padding.Bottom%2A> values to generate a 32-bit hash code that represents the current <xref:System.Windows.Forms.Padding>. - - A hash code is a number that corresponds to the value of an object (so two objects that have the same value should generate the same hash code). Hash codes are used to sort and store collections of objects. For example, a <xref:System.Collections.Hashtable?displayProperty=nameWithType> represents a collection of key-and-value pairs that are organized based on the hash code of the key. - - For more information on hash codes and hash functions, see the <xref:System.Object.GetHashCode%2A?displayProperty=nameWithType> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.Padding.GetHashCode%2A> method uses the <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Top%2A>, and <xref:System.Windows.Forms.Padding.Bottom%2A> values to generate a 32-bit hash code that represents the current <xref:System.Windows.Forms.Padding>. + + A hash code is a number that corresponds to the value of an object (so two objects that have the same value should generate the same hash code). Hash codes are used to sort and store collections of objects. For example, a <xref:System.Collections.Hashtable?displayProperty=nameWithType> represents a collection of key-and-value pairs that are organized based on the hash code of the key. + + For more information on hash codes and hash functions, see the <xref:System.Object.GetHashCode%2A?displayProperty=nameWithType> method. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.Equals(System.Object)" /> <altmember cref="M:System.Windows.Forms.Padding.ToString" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Horizontal"> @@ -584,17 +584,17 @@ <summary>Gets the combined padding for the right and left edges.</summary> <value>Gets the sum, in pixels, of the <see cref="P:System.Windows.Forms.Padding.Left" /> and <see cref="P:System.Windows.Forms.Padding.Right" /> padding values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is convenient for use in many layout calculations. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is convenient for use in many layout calculations. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Vertical" /> <altmember cref="P:System.Windows.Forms.Padding.Size" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Left"> @@ -640,19 +640,19 @@ <summary>Gets or sets the padding value for the left edge.</summary> <value>The padding, in pixels, for the left edge.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Top" /> <altmember cref="P:System.Windows.Forms.Padding.Right" /> <altmember cref="P:System.Windows.Forms.Padding.Bottom" /> <altmember cref="P:System.Windows.Forms.Padding.All" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="op_Addition"> @@ -690,18 +690,18 @@ <summary>Performs vector addition on the two specified <see cref="T:System.Windows.Forms.Padding" /> objects, resulting in a new <see cref="T:System.Windows.Forms.Padding" />.</summary> <returns>A new <see cref="T:System.Windows.Forms.Padding" /> that results from adding <paramref name="p1" /> and <paramref name="p2" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A vector addition operation is the result of adding the padding values for each edge. For example, the <xref:System.Windows.Forms.Padding.Left%2A> property of the result is the sum of the <xref:System.Windows.Forms.Padding.Left%2A> properties of the two operands. - - This operation is transitive. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A vector addition operation is the result of adding the padding values for each edge. For example, the <xref:System.Windows.Forms.Padding.Left%2A> property of the result is the sum of the <xref:System.Windows.Forms.Padding.Left%2A> properties of the two operands. + + This operation is transitive. + The equivalent method for this operator is <xref:System.Windows.Forms.Padding.Add%28System.Windows.Forms.Padding%2CSystem.Windows.Forms.Padding%29?displayProperty=nameWithType>]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.op_Subtraction(System.Windows.Forms.Padding,System.Windows.Forms.Padding)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="op_Equality"> @@ -740,17 +740,17 @@ <returns> <see langword="true" /> if the two <see cref="T:System.Windows.Forms.Padding" /> objects are equal; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Two <xref:System.Windows.Forms.Padding> objects are equal if the padding values for each of the four edges - <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Top%2A>, and <xref:System.Windows.Forms.Padding.Bottom%2A> - are the same for both objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Two <xref:System.Windows.Forms.Padding> objects are equal if the padding values for each of the four edges - <xref:System.Windows.Forms.Padding.Left%2A>, <xref:System.Windows.Forms.Padding.Right%2A>, <xref:System.Windows.Forms.Padding.Top%2A>, and <xref:System.Windows.Forms.Padding.Bottom%2A> - are the same for both objects. + The equivalent method for this operator is <xref:System.Windows.Forms.Padding.Equals%2A?displayProperty=nameWithType>]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.Equals(System.Object)" /> <altmember cref="M:System.Windows.Forms.Padding.op_Inequality(System.Windows.Forms.Padding,System.Windows.Forms.Padding)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="op_Inequality"> @@ -789,16 +789,16 @@ <returns> <see langword="true" /> if the two <see cref="T:System.Windows.Forms.Padding" /> objects are different; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This operation is the inverse of <xref:System.Windows.Forms.Padding.op_Equality%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This operation is the inverse of <xref:System.Windows.Forms.Padding.op_Equality%2A>. + The equivalent method for this operator is the negation of <xref:System.Windows.Forms.Padding.Equals%2A?displayProperty=nameWithType>]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.op_Equality(System.Windows.Forms.Padding,System.Windows.Forms.Padding)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="op_Subtraction"> @@ -836,16 +836,16 @@ <summary>Performs vector subtraction on the two specified <see cref="T:System.Windows.Forms.Padding" /> objects, resulting in a new <see cref="T:System.Windows.Forms.Padding" />.</summary> <returns>The <see cref="T:System.Windows.Forms.Padding" /> result of subtracting <paramref name="p2" /> from <paramref name="p1" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A vector subtraction operation is the result of subtracting the padding values for each edge. For example, the <xref:System.Windows.Forms.Padding.Left%2A> property of the result is the difference between the <xref:System.Windows.Forms.Padding.Left%2A> properties of two operands. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A vector subtraction operation is the result of subtracting the padding values for each edge. For example, the <xref:System.Windows.Forms.Padding.Left%2A> property of the result is the difference between the <xref:System.Windows.Forms.Padding.Left%2A> properties of two operands. + The equivalent method for this operator is <xref:System.Windows.Forms.Padding.Subtract%28System.Windows.Forms.Padding%2CSystem.Windows.Forms.Padding%29?displayProperty=nameWithType>]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.op_Addition(System.Windows.Forms.Padding,System.Windows.Forms.Padding)" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Right"> @@ -891,19 +891,19 @@ <summary>Gets or sets the padding value for the right edge.</summary> <value>The padding, in pixels, for the right edge.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Left" /> <altmember cref="P:System.Windows.Forms.Padding.Top" /> <altmember cref="P:System.Windows.Forms.Padding.Bottom" /> <altmember cref="P:System.Windows.Forms.Padding.All" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Size"> @@ -949,21 +949,21 @@ <summary>Gets the padding information in the form of a <see cref="T:System.Drawing.Size" />.</summary> <value>A <see cref="T:System.Drawing.Size" /> containing the padding information.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.Padding.Size%2A> property performs a type conversion from <xref:System.Windows.Forms.Padding> to <xref:System.Drawing.Size?displayProperty=nameWithType>. The <xref:System.Windows.Forms.Padding.Horizontal%2A> property corresponds to the <xref:System.Drawing.Size.Width%2A?displayProperty=nameWithType> property, and the <xref:System.Windows.Forms.Padding.Vertical%2A> property corresponds to the <xref:System.Drawing.Size.Height%2A?displayProperty=nameWithType> property. - - <xref:System.Windows.Forms.Padding.Size%2A> is convenient for use in many layout calculations. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.Padding.Size%2A> property performs a type conversion from <xref:System.Windows.Forms.Padding> to <xref:System.Drawing.Size?displayProperty=nameWithType>. The <xref:System.Windows.Forms.Padding.Horizontal%2A> property corresponds to the <xref:System.Drawing.Size.Width%2A?displayProperty=nameWithType> property, and the <xref:System.Windows.Forms.Padding.Vertical%2A> property corresponds to the <xref:System.Drawing.Size.Height%2A?displayProperty=nameWithType> property. + + <xref:System.Windows.Forms.Padding.Size%2A> is convenient for use in many layout calculations. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Horizontal" /> <altmember cref="P:System.Windows.Forms.Padding.Vertical" /> <altmember cref="P:System.Drawing.Size.Width" /> <altmember cref="P:System.Drawing.Size.Height" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Subtract"> @@ -1007,8 +1007,8 @@ <summary>Subtracts one specified <see cref="T:System.Windows.Forms.Padding" /> value from another.</summary> <returns>A <see cref="T:System.Windows.Forms.Padding" /> that contains the result of the subtraction of one specified <see cref="T:System.Windows.Forms.Padding" /> value from another.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Top"> @@ -1058,19 +1058,19 @@ <summary>Gets or sets the padding value for the top edge.</summary> <value>The padding, in pixels, for the top edge.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this value can also alter the <xref:System.Windows.Forms.Padding.All%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Left" /> <altmember cref="P:System.Windows.Forms.Padding.Right" /> <altmember cref="P:System.Windows.Forms.Padding.Bottom" /> <altmember cref="P:System.Windows.Forms.Padding.All" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="ToString"> @@ -1110,18 +1110,18 @@ <summary>Returns a string that represents the current <see cref="T:System.Windows.Forms.Padding" />.</summary> <returns>A <see cref="T:System.String" /> that represents the current <see cref="T:System.Windows.Forms.Padding" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method returns a string containing the labeled values of the padding for all four edges. - - This method overrides <xref:System.Object.ToString%2A?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method returns a string containing the labeled values of the padding for all four edges. + + This method overrides <xref:System.Object.ToString%2A?displayProperty=nameWithType>. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Padding.GetHashCode" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> <Member MemberName="Vertical"> @@ -1163,17 +1163,17 @@ <summary>Gets the combined padding for the top and bottom edges.</summary> <value>Gets the sum, in pixels, of the <see cref="P:System.Windows.Forms.Padding.Top" /> and <see cref="P:System.Windows.Forms.Padding.Bottom" /> padding values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is convenient for use in many layout calculations. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is convenient for use in many layout calculations. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Padding.Horizontal" /> <altmember cref="P:System.Windows.Forms.Padding.Size" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> - <related type="Article" href="/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding">How to: Outline a Windows Forms Control Using Padding</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls">Margin and Padding in Windows Forms Controls</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/PictureBox.xml b/xml/System.Windows.Forms/PictureBox.xml index 0c0dc26e618..4d3920201c2 100644 --- a/xml/System.Windows.Forms/PictureBox.xml +++ b/xml/System.Windows.Forms/PictureBox.xml @@ -94,7 +94,7 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/images-bitmaps-and-metafiles">Images, Bitmaps, and Metafiles</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/images-bitmaps-and-metafiles">Images, Bitmaps, and Metafiles</related> <related type="Article" href="/dotnet/desktop/winforms/advanced/images-bitmaps-and-metafiles">Working with Images, Bitmaps, Icons, and Metafiles</related> </Docs> <Members> diff --git a/xml/System.Windows.Forms/PrintDialog.xml b/xml/System.Windows.Forms/PrintDialog.xml index c9b7910caf9..b1c801aed8c 100644 --- a/xml/System.Windows.Forms/PrintDialog.xml +++ b/xml/System.Windows.Forms/PrintDialog.xml @@ -42,27 +42,27 @@ <Docs> <summary>Lets users select a printer and choose which sections of the document to print from a Windows Forms application.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you create an instance of <xref:System.Windows.Forms.PrintDialog>, the read/write properties are set to initial values. For a list of these values, see the <xref:System.Windows.Forms.PrintDialog.%23ctor%2A> constructor. To get printer settings that are modified by the user with the <xref:System.Windows.Forms.PrintDialog>, use the <xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A> property. - - For more information about printing with Windows Forms, see the <xref:System.Drawing.Printing> namespace overview. If you want to print from a Windows Presentation Foundation application, see the <xref:System.Printing> namespace. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you create an instance of <xref:System.Windows.Forms.PrintDialog>, the read/write properties are set to initial values. For a list of these values, see the <xref:System.Windows.Forms.PrintDialog.%23ctor%2A> constructor. To get printer settings that are modified by the user with the <xref:System.Windows.Forms.PrintDialog>, use the <xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A> property. + + For more information about printing with Windows Forms, see the <xref:System.Drawing.Printing> namespace overview. If you want to print from a Windows Presentation Foundation application, see the <xref:System.Printing> namespace. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.PageSetupDialog" /> <altmember cref="T:System.Windows.Forms.PrintPreviewDialog" /> - <related type="Article" href="/dotnet/framework/winforms/controls/printdialog-component-windows-forms">PrintDialog Component (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/printdialog-component-windows-forms">PrintDialog Component (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -88,24 +88,24 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.PrintDialog" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you create an instance of <xref:System.Windows.Forms.PrintDialog>, the following read/write properties are set to initial values. - -|Property|Initial Value| -|--------------|-------------------| -|<xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>|`false`| -|<xref:System.Windows.Forms.PrintDialog.AllowPrintToFile%2A>|`true`| -|<xref:System.Windows.Forms.PrintDialog.AllowSelection%2A>|`false`| -|<xref:System.Windows.Forms.PrintDialog.Document%2A>|`null`| -|<xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A>|`null`| -|<xref:System.Windows.Forms.PrintDialog.PrintToFile%2A>|`false`| -|<xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>|`false`| -|<xref:System.Windows.Forms.PrintDialog.ShowNetwork%2A>|`true`| - - You can change the value for any one of these properties through a separate call to the property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you create an instance of <xref:System.Windows.Forms.PrintDialog>, the following read/write properties are set to initial values. + +|Property|Initial Value| +|--------------|-------------------| +|<xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>|`false`| +|<xref:System.Windows.Forms.PrintDialog.AllowPrintToFile%2A>|`true`| +|<xref:System.Windows.Forms.PrintDialog.AllowSelection%2A>|`false`| +|<xref:System.Windows.Forms.PrintDialog.Document%2A>|`null`| +|<xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A>|`null`| +|<xref:System.Windows.Forms.PrintDialog.PrintToFile%2A>|`false`| +|<xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>|`false`| +|<xref:System.Windows.Forms.PrintDialog.ShowNetwork%2A>|`true`| + + You can change the value for any one of these properties through a separate call to the property. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Printing.PrintDocument" /> @@ -154,11 +154,11 @@ <value> <see langword="true" /> if the **Current Page** option button is displayed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is valid for Windows 2000 and later versions of Windows operating systems. On operating systems earlier than Windows 2000, the <xref:System.Windows.Forms.PrintDialog.AllowCurrentPage%2A> property has no effect. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is valid for Windows 2000 and later versions of Windows operating systems. On operating systems earlier than Windows 2000, the <xref:System.Windows.Forms.PrintDialog.AllowCurrentPage%2A> property has no effect. + ]]></format> </remarks> </Docs> @@ -298,15 +298,15 @@ <value> <see langword="true" /> if the **Pages** option button is enabled; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.PrintDialog.AllowPrintToFile" /> @@ -355,15 +355,15 @@ <summary>Gets or sets a value indicating the <see cref="T:System.Drawing.Printing.PrintDocument" /> used to obtain <see cref="T:System.Drawing.Printing.PrinterSettings" />.</summary> <value>The <see cref="T:System.Drawing.Printing.PrintDocument" /> used to obtain <see cref="T:System.Drawing.Printing.PrinterSettings" />. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.PrintDialog> control to set the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Drawing.Printing.PrintDocument" /> @@ -414,11 +414,11 @@ <summary>Gets or sets the printer settings the dialog box modifies.</summary> <value>The <see cref="T:System.Drawing.Printing.PrinterSettings" /> the dialog box modifies.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A> property must be set before you call <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> or an exception will occur. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.PrintDialog.PrinterSettings%2A> property must be set before you call <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> or an exception will occur. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Printing.PrinterSettings" /> @@ -572,20 +572,20 @@ <value> <see langword="true" /> if the **Help** button is displayed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property was marked obsolete in Windows 2000 and does not affect this and later versions of Windows. - - - -## Examples - The following code example demonstrates the use of the <xref:System.Windows.Forms.PrintDialog> control setting the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example paste the following code in a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event handling methods defined in this example. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property was marked obsolete in Windows 2000 and does not affect this and later versions of Windows. + + + +## Examples + The following code example demonstrates the use of the <xref:System.Windows.Forms.PrintDialog> control setting the <xref:System.Windows.Forms.PrintDialog.AllowSomePages%2A>, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A>, and <xref:System.Windows.Forms.PrintDialog.Document%2A> properties. To run this example paste the following code in a form that contains a <xref:System.Windows.Forms.PrintDialog> control named `PrintDialog1` and a button named `Button1`. This example requires that the button's <xref:System.Windows.Forms.Control.Click> event and the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event of `docToPrint` have been connected to the event handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.PrintDialog.ShowNetwork" /> @@ -633,11 +633,11 @@ <value> <see langword="true" /> if the **Network** button is displayed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property was marked obsolete in Windows 2000 and does not affect this and later versions of Windows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property was marked obsolete in Windows 2000 and does not affect this and later versions of Windows. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.PrintDialog.ShowHelp" /> @@ -684,11 +684,11 @@ <value> <see langword="true" /> to indicate the dialog should be shown with the Windows XP style, otherwise <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When this property is set to `true`, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A> and <xref:System.Windows.Forms.PrintDialog.ShowNetwork%2A> will be ignored as these properties were made obsolete for Windows 2000 and later versions of Windows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When this property is set to `true`, <xref:System.Windows.Forms.PrintDialog.ShowHelp%2A> and <xref:System.Windows.Forms.PrintDialog.ShowNetwork%2A> will be ignored as these properties were made obsolete for Windows 2000 and later versions of Windows. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ProfessionalColorTable.xml b/xml/System.Windows.Forms/ProfessionalColorTable.xml index b177c78c161..56429063ecf 100644 --- a/xml/System.Windows.Forms/ProfessionalColorTable.xml +++ b/xml/System.Windows.Forms/ProfessionalColorTable.xml @@ -29,15 +29,15 @@ <Docs> <summary>Provides colors used for Microsoft Office display elements.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An instance of this class is called by <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An instance of this class is called by <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ProfessionalColors" /> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -832,11 +832,11 @@ <summary>Gets the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -867,11 +867,11 @@ <summary>Gets the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -908,11 +908,11 @@ <summary>Gets the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -949,11 +949,11 @@ <summary>Gets the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -990,11 +990,11 @@ <summary>Gets the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -1031,11 +1031,11 @@ <summary>Gets the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -2050,11 +2050,11 @@ <value> <see langword="true" /> to use <see cref="T:System.Drawing.SystemColors" />; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles or themes are turned off, the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> uses the colors in <xref:System.Drawing.SystemColors>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles or themes are turned off, the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> uses the colors in <xref:System.Drawing.SystemColors>. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ProfessionalColors.xml b/xml/System.Windows.Forms/ProfessionalColors.xml index fcd4e2f93f0..c8811dc6545 100644 --- a/xml/System.Windows.Forms/ProfessionalColors.xml +++ b/xml/System.Windows.Forms/ProfessionalColors.xml @@ -34,7 +34,7 @@ <summary>Provides <see cref="T:System.Drawing.Color" /> structures that are colors of a Windows display element. This class cannot be inherited.</summary> <remarks>To be added.</remarks> <altmember cref="T:System.Windows.Forms.ProfessionalColorTable" /> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> </Docs> <Members> <Member MemberName="ButtonCheckedGradientBegin"> @@ -679,11 +679,11 @@ <summary>Gets the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -714,11 +714,11 @@ <summary>Gets the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -749,11 +749,11 @@ <summary>Gets the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -784,11 +784,11 @@ <summary>Gets the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the starting color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -819,11 +819,11 @@ <summary>Gets the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the end color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> @@ -854,11 +854,11 @@ <summary>Gets the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</summary> <value>A <see cref="T:System.Drawing.Color" /> that is the middle color of the gradient used in the image margin of a <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> when an item is revealed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> must be set to `true` for this color to be displayed. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ProgressBarRenderer.xml b/xml/System.Windows.Forms/ProgressBarRenderer.xml index 05d9f58416f..4347b2c3c61 100644 --- a/xml/System.Windows.Forms/ProgressBarRenderer.xml +++ b/xml/System.Windows.Forms/ProgressBarRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a progress bar control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> methods to draw a vertical progress bar. The control uses a <xref:System.Windows.Forms.Timer> to redraw the progress bar with an added piece each second. The `SetupProgressBar` method uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> properties to calculate the height of each progressively larger rectangle that is drawn. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> methods to draw a vertical progress bar. The control uses a <xref:System.Windows.Forms.Timer> to redraw the progress bar with an added piece each second. The `SetupProgressBar` method uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> properties to calculate the height of each progressively larger rectangle that is drawn. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -83,32 +83,32 @@ <summary>Gets the width, in pixels, of the space between each inner piece of the progress bar.</summary> <value>The width, in pixels, of the space between each inner piece of the progress bar.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This value is determined by the current visual style of the operating system. - - Before accessing this property, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> property to determine the size of each rectangle that represents an increment of the progress bar drawn by the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This value is determined by the current visual style of the operating system. + + Before accessing this property, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> property to determine the size of each rectangle that represents an increment of the progress bar drawn by the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -138,32 +138,32 @@ <summary>Gets the width, in pixels, of a single inner piece of the progress bar.</summary> <value>The width, in pixels, of a single inner piece of the progress bar.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This value is determined by the current visual style of the operating system. - - Before accessing this property, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> property to determine the size of each rectangle that represents an increment of the progress bar drawn by the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This value is determined by the current visual style of the operating system. + + Before accessing this property, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> property to determine the size of each rectangle that represents an increment of the progress bar drawn by the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -198,21 +198,21 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds of the progress bar.</param> <summary>Draws an empty progress bar control that fills in horizontally.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -247,23 +247,23 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds to be filled by progress bar pieces.</param> <summary>Draws a set of progress bar pieces that fill a horizontal progress bar.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each progress bar piece drawn by this method spans the height of the `bounds` parameter. The number of progress bar pieces drawn is determined by the width of `bounds` and the values returned by the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> properties. - - Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each progress bar piece drawn by this method spans the height of the `bounds` parameter. The number of progress bar pieces drawn is determined by the width of `bounds` and the values returned by the <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A> properties. + + Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -298,30 +298,30 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds of the progress bar.</param> <summary>Draws an empty progress bar control that fills in vertically.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an empty progress bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an empty progress bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -356,32 +356,32 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds to be filled by progress bar pieces.</param> <summary>Draws a set of progress bar pieces that fill a vertical progress bar.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each progress bar piece drawn by this method spans the width of the `bounds` parameter. The number of progress bar pieces drawn is determined by the height of `bounds` and the values returned by <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A>. - - Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method in a <xref:System.Windows.Forms.Timer.Tick?displayProperty=nameWithType> event handler to draw each increment of a progress bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each progress bar piece drawn by this method spans the width of the `bounds` parameter. The number of progress bar pieces drawn is determined by the height of `bounds` and the values returned by <xref:System.Windows.Forms.ProgressBarRenderer.ChunkSpaceThickness%2A> and <xref:System.Windows.Forms.ProgressBarRenderer.ChunkThickness%2A>. + + Before using this method, you should verify that the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalChunks%2A> method in a <xref:System.Windows.Forms.Timer.Tick?displayProperty=nameWithType> event handler to draw each increment of a progress bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -412,20 +412,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the methods and properties of this class will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property to determine whether to call the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the methods and properties of this class will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ProgressBarRenderer.IsSupported%2A> property to determine whether to call the <xref:System.Windows.Forms.ProgressBarRenderer.DrawVerticalBar%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ProgressBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/RadioButtonRenderer.xml b/xml/System.Windows.Forms/RadioButtonRenderer.xml index c32b3617e79..fc72f97cc11 100644 --- a/xml/System.Windows.Forms/RadioButtonRenderer.xml +++ b/xml/System.Windows.Forms/RadioButtonRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render an option button control (also known as a radio button) with or without visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to write a custom control that uses the <xref:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton%2A> method to draw an option button that responds to mouse clicks. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to write a custom control that uses the <xref:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton%2A> method to draw an option button that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" /> @@ -92,11 +92,11 @@ <param name="childControl">The control whose parent's background will be drawn.</param> <summary>Draws the background of a control's parent in the specified area.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button (also known as a radio button) with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button (also known as a radio button) with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.ButtonRenderer.DrawParentBackground(System.Drawing.Graphics,System.Drawing.Rectangle,System.Windows.Forms.Control)" /> @@ -144,11 +144,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.RadioButtonState" /> values that specifies the visual state of the option button.</param> <summary>Draws an option button control (also known as a radio button) in the specified state and location.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.RadioButtonState)" /> @@ -210,20 +210,20 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.RadioButtonState" /> values that specifies the visual state of the option button.</param> <summary>Draws an option button control (also known as a radio button) in the specified state and location, with the specified text, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton%28System.Drawing.Graphics%2CSystem.Drawing.Point%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.RadioButtonState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an option button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton%28System.Drawing.Graphics%2CSystem.Drawing.Point%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.RadioButtonState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an option button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.RadioButtonState)" /> @@ -281,11 +281,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.RadioButtonState" /> values that specifies the visual state of the option button.</param> <summary>Draws an option button control (also known as a radio button) in the specified state and location, with the specified text and text formatting, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.RadioButtonState)" /> @@ -358,11 +358,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.RadioButtonState" /> values that specifies the visual state of the option button.</param> <summary>Draws an option button control (also known as a radio button) in the specified state and location, with the specified text and image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + ]]></format> </remarks> <inheritdoc cref="M:System.Windows.Forms.RadioButtonRenderer.DrawRadioButton(System.Drawing.Graphics,System.Drawing.Point,System.Drawing.Rectangle,System.String,System.Drawing.Font,System.Windows.Forms.TextFormatFlags,System.Drawing.Image,System.Drawing.Rectangle,System.Boolean,System.Windows.Forms.VisualStyles.RadioButtonState)" /> @@ -431,11 +431,11 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.RadioButtonState" /> values that specifies the visual state of the option button.</param> <summary>Draws an option button control (also known as a radio button) in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If visual styles are enabled in the operating system and visual styles are applied to the current application, this method will draw the option button with the current visual style. Otherwise, this method will draw the option button with the classic Windows style. + ]]></format> </remarks> </Docs> @@ -472,20 +472,20 @@ <summary>Returns the size, in pixels, of the option button (also known as a radio button) glyph.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that represents the size, in pixels, of the option button glyph.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This value is determined by the current visual style of the operating system. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.GetGlyphSize%2A> method to determine the bounds of the option button text. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This value is determined by the current visual style of the operating system. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.GetGlyphSize%2A> method to determine the bounds of the option button text. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -561,19 +561,19 @@ <value> <see langword="true" /> if the application state is used to determine rendering style; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.RadioButtonRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> property to show the render style is changed depending on the application state. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> property is `true`, the <xref:System.Windows.Forms.RadioButtonRenderer> uses the setting from the <xref:System.Windows.Forms.Application.RenderWithVisualStyles%2A?displayProperty=nameWithType> property to determine the rendering style. If <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> is `false`, the renderer will always render using visual styles. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.RadioButtonRenderer.RenderMatchingApplicationState%2A> property to show the render style is changed depending on the application state. This code example is part of a larger example provided for the <xref:System.Windows.Forms.RadioButtonRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <inheritdoc cref="P:System.Windows.Forms.ButtonRenderer.RenderMatchingApplicationState" /> diff --git a/xml/System.Windows.Forms/ScrollBarRenderer.xml b/xml/System.Windows.Forms/ScrollBarRenderer.xml index e0325bc9115..018f95f8a89 100644 --- a/xml/System.Windows.Forms/ScrollBarRenderer.xml +++ b/xml/System.Windows.Forms/ScrollBarRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a scroll bar control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ScrollBarRenderer> methods to draw a scroll bar that responds to mouse clicks. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.ScrollBarRenderer> methods to draw a scroll bar that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -90,30 +90,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarArrowButtonState" /> values that specifies the visual state of the scroll arrow.</param> <summary>Draws a scroll arrow with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawArrowButton%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawArrowButton%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -150,30 +150,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll box.</param> <summary>Draws a horizontal scroll box (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawHorizontalThumb%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawHorizontalThumb%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -210,30 +210,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll box grip.</param> <summary>Draws a grip on a horizontal scroll box (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawHorizontalThumbGrip%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll box grip in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawHorizontalThumbGrip%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a scroll box grip in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -270,30 +270,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll bar track.</param> <summary>Draws a horizontal scroll bar track with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawLeftHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw the left side of a scroll bar track in the pressed state. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawLeftHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw the left side of a scroll bar track in the pressed state. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -330,21 +330,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll bar track.</param> <summary>Draws a vertical scroll bar track with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -381,30 +381,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll bar track.</param> <summary>Draws a horizontal scroll bar track with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawRightHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw the scroll bar track. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.DrawRightHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw the scroll bar track. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -441,21 +441,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarSizeBoxState" /> values that specifies the visual state of the sizing handle.</param> <summary>Draws a scroll bar sizing handle with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -492,21 +492,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll bar track.</param> <summary>Draws a vertical scroll bar track with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -543,21 +543,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll box.</param> <summary>Draws a vertical scroll box (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -594,21 +594,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.ScrollBarState" /> values that specifies the visual state of the scroll box grip.</param> <summary>Draws a grip on a vertical scroll box (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -644,23 +644,23 @@ <summary>Returns the size of the sizing handle.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size of the sizing handle.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the sizing handle is determined by the current visual style of the operating system. - - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the sizing handle is determined by the current visual style of the operating system. + + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -696,23 +696,23 @@ <summary>Returns the size of the scroll box grip.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size of the scroll box grip.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the scroll box grip is determined by the current visual style of the operating system. - - Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the scroll box grip is determined by the current visual style of the operating system. + + Before using this method, you should verify that the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -743,20 +743,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client areas of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the methods of this class will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.ScrollBarRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the methods of this class will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.ScrollBarRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.ScrollBarRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ScrollBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/SplitContainer.xml b/xml/System.Windows.Forms/SplitContainer.xml index 36b795d2b6b..321a181ba32 100644 --- a/xml/System.Windows.Forms/SplitContainer.xml +++ b/xml/System.Windows.Forms/SplitContainer.xml @@ -62,38 +62,38 @@ <Docs> <summary>Represents a control consisting of a movable bar that divides a container's display area into two resizable panels.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can add controls to the two resizable panels, and you can add other <xref:System.Windows.Forms.SplitContainer> controls to existing <xref:System.Windows.Forms.SplitContainer> panels to create many resizable display areas. - - Use the <xref:System.Windows.Forms.SplitContainer> control to divide the display area of a container (such as a <xref:System.Windows.Forms.Form>) and allow the user to resize controls that are added to the <xref:System.Windows.Forms.SplitContainer> panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the <xref:System.Windows.Forms.SplitContainer> control can be resized. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can add controls to the two resizable panels, and you can add other <xref:System.Windows.Forms.SplitContainer> controls to existing <xref:System.Windows.Forms.SplitContainer> panels to create many resizable display areas. + + Use the <xref:System.Windows.Forms.SplitContainer> control to divide the display area of a container (such as a <xref:System.Windows.Forms.Form>) and allow the user to resize controls that are added to the <xref:System.Windows.Forms.SplitContainer> panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the <xref:System.Windows.Forms.SplitContainer> control can be resized. + > [!NOTE] -> Previous versions of the .NET Framework only support the <xref:System.Windows.Forms.Splitter> control. - - <xref:System.Windows.Forms.SplitContainer> also eases control placement at design time. For example, to create a window similar to Windows Explorer, add a <xref:System.Windows.Forms.SplitContainer> control to a <xref:System.Windows.Forms.Form> and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill`. Add a <xref:System.Windows.Forms.TreeView> control to the <xref:System.Windows.Forms.Form> and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill`. To complete the layout, add a <xref:System.Windows.Forms.ListView> control and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill` to have the <xref:System.Windows.Forms.ListView> occupy the remaining space on the <xref:System.Windows.Forms.Form>. At run time, the user can then resize the width of both controls using the splitter. Use the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to specify that a control should not be resized along with the <xref:System.Windows.Forms.Form> or other container. - - Use <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> to specify where the splitter starts on your form. Use <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> to specify how many pixels the splitter moves at a time. The default for <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> is one pixel. - - Use <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> and <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> to specify how close the splitter bar can be moved to the outside edge of a <xref:System.Windows.Forms.SplitContainer> panel. The default minimum size of a panel is 25 pixels. - - Use the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property to specify horizontal orientation. The default orientation of the <xref:System.Windows.Forms.SplitContainer> is vertical. - - Use the <xref:System.Windows.Forms.SplitContainer.BorderStyle%2A> property to specify the border style of the <xref:System.Windows.Forms.SplitContainer> and coordinate its border style with the border style of controls that you add to the <xref:System.Windows.Forms.SplitContainer>. - - - -## Examples - The following code example shows both a vertical and horizontal <xref:System.Windows.Forms.SplitContainer>. The vertical splitter moves in 10-pixel increments. The left panel of the vertical <xref:System.Windows.Forms.SplitContainer> contains a <xref:System.Windows.Forms.TreeView> control, and its right panel contains a horizontal <xref:System.Windows.Forms.SplitContainer>. Both panels of the horizontal <xref:System.Windows.Forms.SplitContainer> are filled with <xref:System.Windows.Forms.ListView> controls, and the top panel is defined as a <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> so that it does not resize when you resize the container. Moving the vertical splitter raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - +> Previous versions of the .NET Framework only support the <xref:System.Windows.Forms.Splitter> control. + + <xref:System.Windows.Forms.SplitContainer> also eases control placement at design time. For example, to create a window similar to Windows Explorer, add a <xref:System.Windows.Forms.SplitContainer> control to a <xref:System.Windows.Forms.Form> and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill`. Add a <xref:System.Windows.Forms.TreeView> control to the <xref:System.Windows.Forms.Form> and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill`. To complete the layout, add a <xref:System.Windows.Forms.ListView> control and set its <xref:System.Windows.Forms.Control.Dock%2A> property to `DockStyle.Fill` to have the <xref:System.Windows.Forms.ListView> occupy the remaining space on the <xref:System.Windows.Forms.Form>. At run time, the user can then resize the width of both controls using the splitter. Use the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to specify that a control should not be resized along with the <xref:System.Windows.Forms.Form> or other container. + + Use <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> to specify where the splitter starts on your form. Use <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> to specify how many pixels the splitter moves at a time. The default for <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> is one pixel. + + Use <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> and <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> to specify how close the splitter bar can be moved to the outside edge of a <xref:System.Windows.Forms.SplitContainer> panel. The default minimum size of a panel is 25 pixels. + + Use the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property to specify horizontal orientation. The default orientation of the <xref:System.Windows.Forms.SplitContainer> is vertical. + + Use the <xref:System.Windows.Forms.SplitContainer.BorderStyle%2A> property to specify the border style of the <xref:System.Windows.Forms.SplitContainer> and coordinate its border style with the border style of controls that you add to the <xref:System.Windows.Forms.SplitContainer>. + + + +## Examples + The following code example shows both a vertical and horizontal <xref:System.Windows.Forms.SplitContainer>. The vertical splitter moves in 10-pixel increments. The left panel of the vertical <xref:System.Windows.Forms.SplitContainer> contains a <xref:System.Windows.Forms.TreeView> control, and its right panel contains a horizontal <xref:System.Windows.Forms.SplitContainer>. Both panels of the horizontal <xref:System.Windows.Forms.SplitContainer> are filled with <xref:System.Windows.Forms.ListView> controls, and the top panel is defined as a <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> so that it does not resize when you resize the container. Moving the vertical splitter raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet1"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/splitcontainer-control-windows-forms">SplitContainer Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/splitcontainer-control-windows-forms">SplitContainer Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -165,11 +165,11 @@ <value> <see langword="true" /> if scroll bars to automatically appear when controls are placed outside the <see cref="T:System.Windows.Forms.SplitContainer" /> client area; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -218,15 +218,15 @@ <summary>Gets or sets the size of the auto-scroll margin. This property is not relevant to this class. This property is not relevant to this class.</summary> <value>A <see cref="T:System.Drawing.Size" /> value that represents the height and width, in pixels, of the auto-scroll margin.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The auto-scroll margin is the distance between any child controls and the edges of the scrollable parent control. The <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> size is added to the size of any child controls contained in the scrollable control to determine if scroll bars are needed. The <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> property is evaluated when the parent scrollable control is resized or the individual child controls are brought into view, and is used to determine if scroll bars must be displayed. Docked controls are excluded from the calculations that determine if scroll bars must be displayed. - - If the distance from the edge of a child control to the parent scrollable control is less than the value assigned to the <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> property and the <xref:System.Windows.Forms.SplitContainer.AutoScroll%2A> property is set to `true`, the appropriate scroll bar is displayed. - - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The auto-scroll margin is the distance between any child controls and the edges of the scrollable parent control. The <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> size is added to the size of any child controls contained in the scrollable control to determine if scroll bars are needed. The <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> property is evaluated when the parent scrollable control is resized or the individual child controls are brought into view, and is used to determine if scroll bars must be displayed. Docked controls are excluded from the calculations that determine if scroll bars must be displayed. + + If the distance from the edge of a child control to the parent scrollable control is less than the value assigned to the <xref:System.Windows.Forms.SplitContainer.AutoScrollMargin%2A> property and the <xref:System.Windows.Forms.SplitContainer.AutoScroll%2A> property is set to `true`, the appropriate scroll bar is displayed. + + This property is not relevant to this class. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.AutoScroll" /> @@ -276,13 +276,13 @@ <summary>Gets or sets the minimum size of the scroll bar. This property is not relevant to this class.</summary> <value>A <see cref="T:System.Drawing.Size" /> that represents the minimum height and width of the scroll bar, in pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.AutoScrollMinSize%2A> property to manage the screen size allocated to the automatic scroll bar. - - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.AutoScrollMinSize%2A> property to manage the screen size allocated to the automatic scroll bar. + + This property is not relevant to this class. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.AutoScroll" /> @@ -328,11 +328,11 @@ <summary>This property is not relevant to this class.</summary> <value>A <see cref="T:System.Drawing.Point" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -381,11 +381,11 @@ <summary>This property is not relevant to this class.</summary> <value>A <see cref="T:System.Drawing.Point" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -435,11 +435,11 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.SplitContainer" /> is automatically resized; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The contents of a control may change for many reasons; including display data changes; addition of child controls; layout and padding changes; or system font, language, or resolution changes. If the <xref:System.Windows.Forms.SplitContainer.AutoSize%2A> property is set to `true`, the <xref:System.Windows.Forms.SplitContainer> will resize automatically to encompass its contents, although it will never be resized to be smaller than its original <xref:System.Drawing.Size>. This operation will maintain the control's <xref:System.Windows.Forms.SplitContainer.Padding%2A>. This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The contents of a control may change for many reasons; including display data changes; addition of child controls; layout and padding changes; or system font, language, or resolution changes. If the <xref:System.Windows.Forms.SplitContainer.AutoSize%2A> property is set to `true`, the <xref:System.Windows.Forms.SplitContainer> will resize automatically to encompass its contents, although it will never be resized to be smaller than its original <xref:System.Drawing.Size>. This operation will maintain the control's <xref:System.Windows.Forms.SplitContainer.Padding%2A>. This property is not relevant to this class. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.Padding" /> @@ -481,13 +481,13 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.SplitContainer.AutoSize" /> property changes. This property is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><. - - This event is not relevant to this class. - + <format type="text/markdown"><. + + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -529,17 +529,17 @@ <summary>Gets or sets the background image displayed in the control.</summary> <value>An <see cref="T:System.Drawing.Image" /> that represents the image to display in the background of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - -- Use the <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> property to place a graphic image onto a control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + +- Use the <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> property to place a graphic image onto a control. + > [!NOTE] -> Images with translucent or transparent colors are not supported by Windows Forms controls as background images. -> -> This property is not supported on child controls whose <xref:System.Windows.Forms.Form.RightToLeftLayout%2A> property is `true`. - +> Images with translucent or transparent colors are not supported by Windows Forms controls as background images. +> +> This property is not supported on child controls whose <xref:System.Windows.Forms.Form.RightToLeftLayout%2A> property is `true`. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Image" /> @@ -582,23 +582,23 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.SplitContainer.BackgroundImage" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.SplitContainer.BackgroundImageChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.SplitContainer> named `SplitContainer1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.SplitContainer.BackgroundImageChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.SplitContainer.BackgroundImageChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.SplitContainer> named `SplitContainer1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.SplitContainer.BackgroundImageChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet546"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet546"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet546"::: + ]]></format> </remarks> <altmember cref="T:System.Drawing.Image" /> @@ -641,11 +641,11 @@ <summary>This property is not relevant to this class.</summary> <value>An <see cref="T:System.Windows.Forms.ImageLayout" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -686,11 +686,11 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.SplitContainer.BackgroundImageLayout" /> property changes. This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -802,11 +802,11 @@ <summary>Gets or sets the style of border for the <see cref="T:System.Windows.Forms.SplitContainer" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.BorderStyle%2A> property to coordinate the border of the splitter and the outer edges of the <xref:System.Windows.Forms.SplitContainer> panels with the border of the control or controls that the <xref:System.Windows.Forms.SplitContainer> contains. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.BorderStyle%2A> property to coordinate the border of the splitter and the outer edges of the <xref:System.Windows.Forms.SplitContainer> panels with the border of the control or controls that the <xref:System.Windows.Forms.SplitContainer> contains. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value of the property is not one of the <see cref="T:System.Windows.Forms.BorderStyle" /> values.</exception> @@ -849,11 +849,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -894,11 +894,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -947,11 +947,11 @@ <summary>Gets a collection of child controls. This property is not relevant to this class.</summary> <value>An object of type <see cref="T:System.Windows.Forms.Control.ControlCollection" /> that contains the child controls.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1044,11 +1044,11 @@ <summary>Gets the default size of the <see cref="T:System.Windows.Forms.SplitContainer" />.</summary> <value>A <see cref="T:System.Drawing.Size" /> that represents the size of the <see cref="T:System.Windows.Forms.SplitContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Override the <xref:System.Windows.Forms.SplitContainer.DefaultSize%2A> property in a derived class to specify a default size for <xref:System.Windows.Forms.SplitContainer>. This is more efficient than setting the size in the <xref:System.Windows.Forms.SplitContainer> constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Override the <xref:System.Windows.Forms.SplitContainer.DefaultSize%2A> property in a derived class to specify a default size for <xref:System.Windows.Forms.SplitContainer>. This is more efficient than setting the size in the <xref:System.Windows.Forms.SplitContainer> constructor. + ]]></format> </remarks> <altmember cref="T:System.Drawing.Size" /> @@ -1080,29 +1080,29 @@ <summary>Gets or sets which <see cref="T:System.Windows.Forms.SplitContainer" /> borders are attached to the edges of the container.</summary> <value>One of the <see cref="T:System.Windows.Forms.DockStyle" /> values. The default value is <see langword="None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can dock a <xref:System.Windows.Forms.SplitContainer> to any edge of its container, or you can dock a <xref:System.Windows.Forms.SplitContainer> to all edges of the container so that the <xref:System.Windows.Forms.SplitContainer> entirely fills the container. For example, set this property to <xref:System.Windows.Forms.DockStyle.Left?displayProperty=nameWithType> to attach the left edge of the <xref:System.Windows.Forms.SplitContainer> to the left edge of its container. Controls are docked in z-order. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can dock a <xref:System.Windows.Forms.SplitContainer> to any edge of its container, or you can dock a <xref:System.Windows.Forms.SplitContainer> to all edges of the container so that the <xref:System.Windows.Forms.SplitContainer> entirely fills the container. For example, set this property to <xref:System.Windows.Forms.DockStyle.Left?displayProperty=nameWithType> to attach the left edge of the <xref:System.Windows.Forms.SplitContainer> to the left edge of its container. Controls are docked in z-order. + > [!NOTE] -> The z-order corresponds to the depth dimension of the screen, and the x-order and y-order corresponds to the horizontal and vertical dimensions, respectively. Z-order defines which object appears in front of which, in cases where controls or windows can overlap or occupy the same space on the screen. A control or window at the top of the z-order appears on top of all other controls or windows and is referenced by an index of 0 in the <xref:System.Windows.Forms.SplitContainer.Controls%2A> property. A control or window at the bottom of the z-order appears underneath all other controls or windows and is referenced by an index of `(Controls.Count-1)` in the <xref:System.Windows.Forms.SplitContainer.Controls%2A> property. - - For more information about anchoring and docking controls, see [How to: Create a Multipane User Interface with Windows Forms](/dotnet/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms). - - - -## Examples - The following code example shows a vertical splitter whose <xref:System.Windows.Forms.SplitContainer.Dock%2A> property is set to `Fill`. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - +> The z-order corresponds to the depth dimension of the screen, and the x-order and y-order corresponds to the horizontal and vertical dimensions, respectively. Z-order defines which object appears in front of which, in cases where controls or windows can overlap or occupy the same space on the screen. A control or window at the top of the z-order appears on top of all other controls or windows and is referenced by an index of 0 in the <xref:System.Windows.Forms.SplitContainer.Controls%2A> property. A control or window at the bottom of the z-order appears underneath all other controls or windows and is referenced by an index of `(Controls.Count-1)` in the <xref:System.Windows.Forms.SplitContainer.Controls%2A> property. + + For more information about anchoring and docking controls, see [How to: Create a Multipane User Interface with Windows Forms](/dotnet/desktop/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms). + + + +## Examples + The following code example shows a vertical splitter whose <xref:System.Windows.Forms.SplitContainer.Dock%2A> property is set to `Fill`. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DockStyle" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms">How to: Create a Multipane User Interface with Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms">How to: Create a Multipane User Interface with Windows Forms</related> </Docs> </Member> <Member MemberName="EndInit"> @@ -1171,20 +1171,20 @@ <summary>Gets or sets which <see cref="T:System.Windows.Forms.SplitContainer" /> panel remains the same size when the container is resized.</summary> <value>One of the values of <see cref="T:System.Windows.Forms.FixedPanel" />. The default value is <see langword="None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to specify which <xref:System.Windows.Forms.SplitContainer> panel stays the same size when a user resizes the container. - - - -## Examples - The following code example shows a horizontal splitter whose top panel is defined as a <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> so that it does not resize along with the container. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to specify which <xref:System.Windows.Forms.SplitContainer> panel stays the same size when a user resizes the container. + + + +## Examples + The following code example shows a horizontal splitter whose top panel is defined as a <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> so that it does not resize along with the container. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The assigned value is not one of the <see cref="T:System.Windows.Forms.FixedPanel" /> values.</exception> @@ -1237,11 +1237,11 @@ <value> <see langword="true" /> if the splitter is fixed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> property to enable or disable splitter movement. For example, you might programmatically set <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> to `true` when refreshing the display, when some other control has the focus, or when an event is occurring for which the display areas divided by the <xref:System.Windows.Forms.SplitContainer> must remain constant, and set <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> to `false` when those circumstances do not apply. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> property to enable or disable splitter movement. For example, you might programmatically set <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> to `true` when refreshing the display, when some other control has the focus, or when an event is occurring for which the display areas divided by the <xref:System.Windows.Forms.SplitContainer> must remain constant, and set <xref:System.Windows.Forms.SplitContainer.IsSplitterFixed%2A> to `false` when those circumstances do not apply. + ]]></format> </remarks> </Docs> @@ -1275,13 +1275,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.GotFocus" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnGotFocus%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnGotFocus%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1320,15 +1320,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnKeyDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnKeyDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1367,15 +1367,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyUp" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnKeyUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnKeyUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1414,13 +1414,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.LayoutEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Layout" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnLayout%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnLayout%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1458,13 +1458,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.LostFocus" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnLostFocus%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnLostFocus%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1534,15 +1534,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1582,13 +1582,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseLeave" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1632,15 +1632,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseMove" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnMouseMove%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnMouseMove%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1680,15 +1680,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseUp" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnMouseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnMouseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1728,13 +1728,13 @@ <param name="e">The data for the event.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Move" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnMove%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnMove%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1771,13 +1771,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.SplitContainer.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.SplitContainer.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1852,22 +1852,22 @@ <param name="e">A <see cref="T:System.Windows.Forms.SplitterEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.SplitContainer.SplitterMoved" /> event.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + <format type="text/markdown"><. + + + +## Examples + The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.SplitterEventArgs" /> @@ -1905,22 +1905,22 @@ <param name="e">A <see cref="T:System.Windows.Forms.SplitterEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.SplitContainer.SplitterMoving" /> event.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + <format type="text/markdown"><. + + + +## Examples + The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.SplitterEventArgs" /> @@ -1969,20 +1969,20 @@ <summary>Gets or sets a value indicating the horizontal or vertical orientation of the <see cref="T:System.Windows.Forms.SplitContainer" /> panels.</summary> <value>One of the <see cref="T:System.Windows.Forms.Orientation" /> values. The default is <see langword="Vertical" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property to change the <xref:System.Windows.Forms.SplitContainer> from vertical to horizontal or from horizontal to vertical. - - - -## Examples - The following code example shows a horizontal splitter whose top and bottom panels contain <xref:System.Windows.Forms.ListView> controls. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property to change the <xref:System.Windows.Forms.SplitContainer> from vertical to horizontal or from horizontal to vertical. + + + +## Examples + The following code example shows a horizontal splitter whose top and bottom panels contain <xref:System.Windows.Forms.ListView> controls. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The assigned value is not one of the <see cref="T:System.Windows.Forms.Orientation" /> values.</exception> @@ -2033,11 +2033,11 @@ <summary>Gets or sets the interior spacing, in pixels, between the edges of a <see cref="T:System.Windows.Forms.SplitterPanel" /> and its contents. This property is not relevant to this class.</summary> <value>An object of type <see cref="T:System.Windows.Forms.Padding" /> representing the interior spacing.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -2078,11 +2078,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -2135,18 +2135,18 @@ <summary>Gets the left or top panel of the <see cref="T:System.Windows.Forms.SplitContainer" />, depending on <see cref="P:System.Windows.Forms.SplitContainer.Orientation" />.</summary> <value>If <see cref="P:System.Windows.Forms.SplitContainer.Orientation" /> is <see langword="Vertical" />, the left panel of the <see cref="T:System.Windows.Forms.SplitContainer" />. If <see cref="P:System.Windows.Forms.SplitContainer.Orientation" /> is <see langword="Horizontal" />, the top panel of the <see cref="T:System.Windows.Forms.SplitContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.Panel1%2A> property to configure the left panel of a vertical <xref:System.Windows.Forms.SplitContainer> or the top panel of a horizontal <xref:System.Windows.Forms.SplitContainer>. For example, you can specify the minimum size of the panel by changing the value of the <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> property, set the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to `Panel1` so that the panel remains the same size when the container is resized, or you can get or set the panel's <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> and <xref:System.Windows.Forms.SplitContainer.BackgroundImageLayout%2A> properties. - - You cannot remove <xref:System.Windows.Forms.SplitContainer.Panel1%2A> from the <xref:System.Windows.Forms.SplitContainer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.Panel1%2A> property to configure the left panel of a vertical <xref:System.Windows.Forms.SplitContainer> or the top panel of a horizontal <xref:System.Windows.Forms.SplitContainer>. For example, you can specify the minimum size of the panel by changing the value of the <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> property, set the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to `Panel1` so that the panel remains the same size when the container is resized, or you can get or set the panel's <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> and <xref:System.Windows.Forms.SplitContainer.BackgroundImageLayout%2A> properties. + + You cannot remove <xref:System.Windows.Forms.SplitContainer.Panel1%2A> from the <xref:System.Windows.Forms.SplitContainer>. + > [!NOTE] -> If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. - - If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. - +> If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. + + If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.Panel1MinSize" /> @@ -2237,22 +2237,22 @@ <summary>Gets or sets the minimum distance in pixels of the splitter from the left or top edge of <see cref="P:System.Windows.Forms.SplitContainer.Panel1" />.</summary> <value>An <see cref="T:System.Int32" /> representing the minimum distance in pixels of the splitter from the left or top edge of <see cref="P:System.Windows.Forms.SplitContainer.Panel1" />. The default value is 25 pixels, regardless of <see cref="P:System.Windows.Forms.SplitContainer.Orientation" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> property to prevent the splitter from moving too close to the left or top edge of the container. For example, you might want to prevent some of the display area of a <xref:System.Windows.Forms.TreeView> from being covered. - - If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Vertical` (the default), <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> returns the minimum distance in pixels of the splitter from the left edge of <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> returns the minimum distance in pixels of the splitter from the top edge of <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. - - - -## Examples - The following code example shows a vertical splitter where the minimum size of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> (the left panel) is set to 30 pixels, which is now the minimum distance the splitter can be from the left edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> property to prevent the splitter from moving too close to the left or top edge of the container. For example, you might want to prevent some of the display area of a <xref:System.Windows.Forms.TreeView> from being covered. + + If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Vertical` (the default), <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> returns the minimum distance in pixels of the splitter from the left edge of <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.Panel1MinSize%2A> returns the minimum distance in pixels of the splitter from the top edge of <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. + + + +## Examples + The following code example shows a vertical splitter where the minimum size of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> (the left panel) is set to 30 pixels, which is now the minimum distance the splitter can be from the left edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value is incompatible with the orientation.</exception> @@ -2308,16 +2308,16 @@ <summary>Gets the right or bottom panel of the <see cref="T:System.Windows.Forms.SplitContainer" />, depending on <see cref="P:System.Windows.Forms.SplitContainer.Orientation" />.</summary> <value>If <see cref="P:System.Windows.Forms.SplitContainer.Orientation" /> is <see langword="Vertical" />, the right panel of the <see cref="T:System.Windows.Forms.SplitContainer" />. If <see cref="P:System.Windows.Forms.SplitContainer.Orientation" /> is <see langword="Horizontal" />, the bottom panel of the <see cref="T:System.Windows.Forms.SplitContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.Panel2%2A> property to configure the right panel of a vertical <xref:System.Windows.Forms.SplitContainer> or the bottom panel of a horizontal <xref:System.Windows.Forms.SplitContainer>. For example, you can specify the minimum size of the panel by changing the value of the <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> property, set the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to `Panel2` so that the panel remains the same size when the container is resized, or you can get or set the panel's <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> and <xref:System.Windows.Forms.SplitContainer.BackgroundImageLayout%2A> properties. - - You cannot remove <xref:System.Windows.Forms.SplitContainer.Panel2%2A> from the <xref:System.Windows.Forms.SplitContainer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.Panel2%2A> property to configure the right panel of a vertical <xref:System.Windows.Forms.SplitContainer> or the bottom panel of a horizontal <xref:System.Windows.Forms.SplitContainer>. For example, you can specify the minimum size of the panel by changing the value of the <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> property, set the <xref:System.Windows.Forms.SplitContainer.FixedPanel%2A> property to `Panel2` so that the panel remains the same size when the container is resized, or you can get or set the panel's <xref:System.Windows.Forms.SplitContainer.BackgroundImage%2A> and <xref:System.Windows.Forms.SplitContainer.BackgroundImageLayout%2A> properties. + + You cannot remove <xref:System.Windows.Forms.SplitContainer.Panel2%2A> from the <xref:System.Windows.Forms.SplitContainer>. + > [!NOTE] -> If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. - +> If <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A> contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to <xref:System.Windows.Forms.SplitContainer.Panel1%2A> or <xref:System.Windows.Forms.SplitContainer.Panel2%2A>, set the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> to 0 and the <xref:System.Windows.Forms.SplitterPanel.TabIndex%2A> property of <xref:System.Windows.Forms.SplitContainer.Panel1%2A> to 1. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.Orientation" /> @@ -2408,22 +2408,22 @@ <summary>Gets or sets the minimum distance in pixels of the splitter from the right or bottom edge of <see cref="P:System.Windows.Forms.SplitContainer.Panel2" />.</summary> <value>An <see cref="T:System.Int32" /> representing the minimum distance in pixels of the splitter from the right or bottom edge of <see cref="P:System.Windows.Forms.SplitContainer.Panel2" />. The default value is 25 pixels, regardless of <see cref="P:System.Windows.Forms.SplitContainer.Orientation" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> property to prevent the splitter from moving too close to the right or bottom edge of the container. For example, you might want to prevent some of the display area of a <xref:System.Windows.Forms.TreeView> from being covered. - - If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Vertical` (the default), <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> returns the minimum distance in pixels that the splitter can be from the right edge of <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> returns the minimum distance in pixels that the splitter can be from the bottom edge of <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. - - - -## Examples - The following code example shows a vertical splitter where the minimum size of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> (the right panel) is set to 20 pixels, which is now the minimum distance the splitter can be from the right edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> property to prevent the splitter from moving too close to the right or bottom edge of the container. For example, you might want to prevent some of the display area of a <xref:System.Windows.Forms.TreeView> from being covered. + + If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Vertical` (the default), <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> returns the minimum distance in pixels that the splitter can be from the right edge of <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. If the <xref:System.Windows.Forms.SplitContainer.Orientation%2A> property is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.Panel2MinSize%2A> returns the minimum distance in pixels that the splitter can be from the bottom edge of <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. + + + +## Examples + The following code example shows a vertical splitter where the minimum size of <xref:System.Windows.Forms.SplitContainer.Panel2%2A> (the right panel) is set to 20 pixels, which is now the minimum distance the splitter can be from the right edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified value is incompatible with the orientation.</exception> @@ -2462,11 +2462,11 @@ <returns> <see langword="true" /> if the key was processed by the control; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is called during message preprocessing to handle dialog box key characters, such as TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROW. Keys that include the ALT or CONTROL modifiers are not handled. This method is called only if the <xref:System.Windows.Forms.Control.IsInputKey%2A?displayProperty=nameWithType> method indicates that the control is not processing the key. The <xref:System.Windows.Forms.Control.ProcessDialogKey%2A?displayProperty=nameWithType> simply sends the character to the parent's <xref:System.Windows.Forms.Control.ProcessDialogKey%2A?displayProperty=nameWithType> method, or returns `false` if the control has no parent. The <xref:System.Windows.Forms.Form?displayProperty=nameWithType> class overrides this method to perform actual processing of dialog box keys. The run time calls this method only when the control is hosted in a Windows Forms application or as an ActiveX control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is called during message preprocessing to handle dialog box key characters, such as TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROW. Keys that include the ALT or CONTROL modifiers are not handled. This method is called only if the <xref:System.Windows.Forms.Control.IsInputKey%2A?displayProperty=nameWithType> method indicates that the control is not processing the key. The <xref:System.Windows.Forms.Control.ProcessDialogKey%2A?displayProperty=nameWithType> simply sends the character to the parent's <xref:System.Windows.Forms.Control.ProcessDialogKey%2A?displayProperty=nameWithType> method, or returns `false` if the control has no parent. The <xref:System.Windows.Forms.Form?displayProperty=nameWithType> class overrides this method to perform actual processing of dialog box keys. The run time calls this method only when the control is hosted in a Windows Forms application or as an ActiveX control. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2509,21 +2509,21 @@ <returns> <see langword="true" /> if a control is selected; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.SplitContainer.ProcessTabKey%2A> controls the tab focus order in the following manner: - -- From the first control outside the <xref:System.Windows.Forms.SplitContainer> to the first control on <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. - -- All controls on <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. - -- The splitter (so that the user can use the arrow keys to move the splitter). - -- All controls on <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. - -- The second control outside the <xref:System.Windows.Forms.SplitContainer> that is next in the tab order. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.SplitContainer.ProcessTabKey%2A> controls the tab focus order in the following manner: + +- From the first control outside the <xref:System.Windows.Forms.SplitContainer> to the first control on <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. + +- All controls on <xref:System.Windows.Forms.SplitContainer.Panel1%2A>. + +- The splitter (so that the user can use the arrow keys to move the splitter). + +- All controls on <xref:System.Windows.Forms.SplitContainer.Panel2%2A>. + +- The second control outside the <xref:System.Windows.Forms.SplitContainer> that is next in the tab order. + ]]></format> </remarks> </Docs> @@ -2686,20 +2686,20 @@ <summary>Gets or sets the location of the splitter, in pixels, from the left or top edge of the <see cref="T:System.Windows.Forms.SplitContainer" />.</summary> <value>An <see cref="T:System.Int32" /> representing the location of the splitter, in pixels, from the left or top edge of the <see cref="T:System.Windows.Forms.SplitContainer" />. The default value is 50 pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> property to determine or specify the distance in pixels of the splitter from the left or top edge of the container. You can both specify an initial distance and change the distance at design time or run time. If <xref:System.Windows.Forms.SplitContainer.Orientation%2A> is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> is calculated in pixels from the top edge of the <xref:System.Windows.Forms.SplitContainer>. If <xref:System.Windows.Forms.SplitContainer.Orientation%2A> is `Vertical`, <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> is calculated in pixels from the left edge of the <xref:System.Windows.Forms.SplitContainer>. - - - -## Examples - The following code example specifies that the initial distance of the vertical splitter from the left edge of the container is 79 pixels. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> property to determine or specify the distance in pixels of the splitter from the left or top edge of the container. You can both specify an initial distance and change the distance at design time or run time. If <xref:System.Windows.Forms.SplitContainer.Orientation%2A> is `Horizontal`, <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> is calculated in pixels from the top edge of the <xref:System.Windows.Forms.SplitContainer>. If <xref:System.Windows.Forms.SplitContainer.Orientation%2A> is `Vertical`, <xref:System.Windows.Forms.SplitContainer.SplitterDistance%2A> is calculated in pixels from the left edge of the <xref:System.Windows.Forms.SplitContainer>. + + + +## Examples + The following code example specifies that the initial distance of the vertical splitter from the left edge of the container is 79 pixels. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The value is less than zero.</exception> @@ -2747,20 +2747,20 @@ <summary>Gets or sets a value representing the increment of splitter movement in pixels.</summary> <value>An <see cref="T:System.Int32" /> representing the increment of splitter movement in pixels. The default value is one pixel.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> property to create a snapping splitter that moves in larger increments than one pixel. - - - -## Examples - The following code example specifies that the vertical splitter moves in 10-pixel increments. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.SplitterIncrement%2A> property to create a snapping splitter that moves in larger increments than one pixel. + + + +## Examples + The following code example specifies that the vertical splitter moves in 10-pixel increments. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The value is less than one.</exception> @@ -2792,20 +2792,20 @@ <Docs> <summary>Occurs when the splitter control is moved.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + <format type="text/markdown"><. + + + +## Examples + The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.SplitContainer.OnSplitterMoved(System.Windows.Forms.SplitterEventArgs)" /> @@ -2840,22 +2840,22 @@ <Docs> <summary>Occurs when the splitter control is in the process of moving.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + <format type="text/markdown"><. + + + +## Examples + The following code example raises the <xref:System.Windows.Forms.SplitContainer.SplitterMoving> event, signified in this example by a change to the cursor style when you move the splitter. The <xref:System.Windows.Forms.SplitContainer.SplitterMoved> event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.SplitContainer.OnSplitterMoving(System.Windows.Forms.SplitterCancelEventArgs)" /> @@ -2896,20 +2896,20 @@ <summary>Gets the size and location of the splitter relative to the <see cref="T:System.Windows.Forms.SplitContainer" />.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that specifies the size and location of the splitter relative to the <see cref="T:System.Windows.Forms.SplitContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> to get the width and height of the splitter relative to the <xref:System.Windows.Forms.SplitContainer>. The <xref:System.Windows.Forms.SplitContainer.OnKeyDown%2A>, <xref:System.Windows.Forms.SplitContainer.OnKeyUp%2A>, <xref:System.Windows.Forms.SplitContainer.OnMouseDown%2A>, <xref:System.Windows.Forms.SplitContainer.OnMouseUp%2A>, and <xref:System.Windows.Forms.SplitContainer.OnMouseMove%2A> event handlers draw the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> to show the current position of the splitter while it is moving. - - The meaning of the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> values vary depending on the <xref:System.Windows.Forms.SplitContainer.Orientation%2A>. The output of <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> is in the format `{X, Y, Width, Height}`. The following table shows the meaning of the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> values for vertical and horizontal splitters. - -|Dimension|Vertical Splitter|Horizontal Splitter| -|---------------|-----------------------|-------------------------| -|X|The distance in pixels of the splitter from the left edge of the <xref:System.Windows.Forms.SplitContainer>.|This value is always 0 for a horizontal splitter, indicating that the splitter is flush with the left edge of the <xref:System.Windows.Forms.SplitContainer>.| -|Y|This value is always 0 for a vertical splitter, indicating that the splitter is flush with the top edge of the <xref:System.Windows.Forms.SplitContainer>.|The distance in pixels of the splitter from the top edge of the <xref:System.Windows.Forms.SplitContainer>.| -|Width|The width of the splitter.|The height of the splitter, which is equivalent to the height of the <xref:System.Windows.Forms.SplitContainer> control.| -|Height|The height of the splitter, which is equivalent to the height of the <xref:System.Windows.Forms.SplitContainer> control.|The width of the splitter.| - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> to get the width and height of the splitter relative to the <xref:System.Windows.Forms.SplitContainer>. The <xref:System.Windows.Forms.SplitContainer.OnKeyDown%2A>, <xref:System.Windows.Forms.SplitContainer.OnKeyUp%2A>, <xref:System.Windows.Forms.SplitContainer.OnMouseDown%2A>, <xref:System.Windows.Forms.SplitContainer.OnMouseUp%2A>, and <xref:System.Windows.Forms.SplitContainer.OnMouseMove%2A> event handlers draw the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> to show the current position of the splitter while it is moving. + + The meaning of the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> values vary depending on the <xref:System.Windows.Forms.SplitContainer.Orientation%2A>. The output of <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> is in the format `{X, Y, Width, Height}`. The following table shows the meaning of the <xref:System.Windows.Forms.SplitContainer.SplitterRectangle%2A> values for vertical and horizontal splitters. + +|Dimension|Vertical Splitter|Horizontal Splitter| +|---------------|-----------------------|-------------------------| +|X|The distance in pixels of the splitter from the left edge of the <xref:System.Windows.Forms.SplitContainer>.|This value is always 0 for a horizontal splitter, indicating that the splitter is flush with the left edge of the <xref:System.Windows.Forms.SplitContainer>.| +|Y|This value is always 0 for a vertical splitter, indicating that the splitter is flush with the top edge of the <xref:System.Windows.Forms.SplitContainer>.|The distance in pixels of the splitter from the top edge of the <xref:System.Windows.Forms.SplitContainer>.| +|Width|The width of the splitter.|The height of the splitter, which is equivalent to the height of the <xref:System.Windows.Forms.SplitContainer> control.| +|Height|The height of the splitter, which is equivalent to the height of the <xref:System.Windows.Forms.SplitContainer> control.|The width of the splitter.| + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.Orientation" /> @@ -2955,20 +2955,20 @@ <summary>Gets or sets the width of the splitter in pixels.</summary> <value>An <see cref="T:System.Int32" /> representing the width of the splitter, in pixels. The default is four pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.SplitContainer.SplitterWidth%2A> property to change the width of the splitter itself, not the <xref:System.Windows.Forms.SplitContainer>. - - - -## Examples - The following code example specifies that the initial width of the vertical splitter is 6 pixels (the default). Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.SplitContainer.SplitterWidth%2A> property to change the width of the splitter itself, not the <xref:System.Windows.Forms.SplitContainer>. + + + +## Examples + The following code example specifies that the initial width of the vertical splitter is 6 pixels (the default). Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the <xref:System.Windows.Forms.SplitContainer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The value is less than one or is incompatible with the orientation.</exception> @@ -3015,16 +3015,16 @@ <value> <see langword="true" /> if the user can give the focus to the splitter using the TAB key; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the user presses the TAB key, the input focus is set to the next control in the tab order of the form. Set <xref:System.Windows.Forms.SplitContainer.TabStop%2A> to `true` to give input focus to a splitter so that it can be moved with the arrow keys as well as with the mouse. Starting in the .NET Framework 4, setting <xref:System.Windows.Forms.SplitContainer.TabStop%2A> to `false` excludes the splitter and any of the controls that are contained in the <xref:System.Windows.Forms.SplitContainer> from the collection of controls in the tab order. To enable controls to get focus by using the TAB key, create a control that inherits from <xref:System.Windows.Forms.SplitContainer>. Create a new property named `TabStop` and override the <xref:System.Windows.Forms.SplitContainer.ProcessTabKey%2A> method. The following example demonstrates how to accomplish this. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the user presses the TAB key, the input focus is set to the next control in the tab order of the form. Set <xref:System.Windows.Forms.SplitContainer.TabStop%2A> to `true` to give input focus to a splitter so that it can be moved with the arrow keys as well as with the mouse. Starting in the .NET Framework 4, setting <xref:System.Windows.Forms.SplitContainer.TabStop%2A> to `false` excludes the splitter and any of the controls that are contained in the <xref:System.Windows.Forms.SplitContainer> from the collection of controls in the tab order. To enable controls to get focus by using the TAB key, create a control that inherits from <xref:System.Windows.Forms.SplitContainer>. Create a new property named `TabStop` and override the <xref:System.Windows.Forms.SplitContainer.ProcessTabKey%2A> method. The following example demonstrates how to accomplish this. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/TabStop/program.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/splitcontainertabstop/vb/module1.vb" id="Snippet1"::: - - You can manipulate the tab order by setting the control's <xref:System.Windows.Forms.Control.TabIndex%2A> property value. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/splitcontainertabstop/vb/module1.vb" id="Snippet1"::: + + You can manipulate the tab order by setting the control's <xref:System.Windows.Forms.Control.TabIndex%2A> property value. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.TabIndex" /> @@ -3074,11 +3074,11 @@ <summary>This property is not relevant to this class.</summary> <value>A string.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -3119,11 +3119,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -3157,13 +3157,13 @@ <param name="msg">The Windows <see cref="T:System.Windows.Forms.Message" /> to process.</param> <summary>Processes Windows messages.</summary> <remarks> - <format type="text/markdown"><). - + <format type="text/markdown"><). + ]]></format> </remarks> <block subset="none" type="overrides"> diff --git a/xml/System.Windows.Forms/StatusStrip.xml b/xml/System.Windows.Forms/StatusStrip.xml index 96dec3e6a74..7f0cb1ed674 100644 --- a/xml/System.Windows.Forms/StatusStrip.xml +++ b/xml/System.Windows.Forms/StatusStrip.xml @@ -71,8 +71,8 @@ The following items are specifically designed to work seamlessly with both <xref </remarks> <related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2010/ms233631(v=vs.100)">StatusStrip Items Collection Editor</related> <related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2008/ms233642(v=vs.90)">StatusStrip Tasks Dialog Box</related> - <related type="Article" href="/dotnet/framework/winforms/controls/statusstrip-control">StatusStrip Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-use-the-spring-property-interactively-in-a-statusstrip">How to: Use the Spring Property Interactively in a StatusStrip</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/statusstrip-control">StatusStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-use-the-spring-property-interactively-in-a-statusstrip">How to: Use the Spring Property Interactively in a StatusStrip</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/TabControl.xml b/xml/System.Windows.Forms/TabControl.xml index b97bd4c7194..68f702fb28f 100644 --- a/xml/System.Windows.Forms/TabControl.xml +++ b/xml/System.Windows.Forms/TabControl.xml @@ -58,54 +58,54 @@ <Docs> <summary>Manages a related set of tab pages.</summary> <remarks> - <format type="text/markdown"><. - - When the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to a value other than <xref:System.Windows.Forms.TabAlignment.Top> and the <xref:System.Windows.Forms.TabControl.Appearance%2A> property is set to a value other than <xref:System.Windows.Forms.TabAppearance.Normal>, the tab page contents might not render correctly. - - - -## Examples - The following code example uses the Visual Studio Windows Forms Designer to create a <xref:System.Windows.Forms.TabControl> with three tab pages. Each tab page contains several controls. - + <format type="text/markdown"><. + + When the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to a value other than <xref:System.Windows.Forms.TabAlignment.Top> and the <xref:System.Windows.Forms.TabControl.Appearance%2A> property is set to a value other than <xref:System.Windows.Forms.TabAppearance.Normal>, the tab page contents might not render correctly. + + + +## Examples + The following code example uses the Visual Studio Windows Forms Designer to create a <xref:System.Windows.Forms.TabControl> with three tab pages. Each tab page contains several controls. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic TabControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic TabControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic TabControl Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -133,15 +133,15 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TabControl" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. The <xref:System.Windows.Forms.TabControl.%23ctor%2A> constructor creates an instance of `tabControl1`. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. The <xref:System.Windows.Forms.TabControl.%23ctor%2A> constructor creates an instance of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabControl_constructor/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/.ctor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl_constructor/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl_constructor/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -195,27 +195,27 @@ <summary>Gets or sets the area of the control (for example, along the top) where the tabs are aligned.</summary> <value>One of the <see cref="T:System.Windows.Forms.TabAlignment" /> values. The default is <see langword="Top" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to <xref:System.Windows.Forms.TabAlignment.Left> or <xref:System.Windows.Forms.TabAlignment.Right>, the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is automatically set to `true`. - - When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to <xref:System.Windows.Forms.TabAppearance.FlatButtons>, it only appears as such when the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to <xref:System.Windows.Forms.TabAlignment.Top>. Otherwise, the <xref:System.Windows.Forms.TabControl.Appearance%2A> property displays as if set to the <xref:System.Windows.Forms.TabAppearance.Buttons> value. - - When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to <xref:System.Windows.Forms.TabAppearance.Buttons>, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to <xref:System.Windows.Forms.TabAlignment.Top> so that the buttons display correctly. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to <xref:System.Windows.Forms.TabAlignment.Left> or <xref:System.Windows.Forms.TabAlignment.Right>, the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is automatically set to `true`. + + When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to <xref:System.Windows.Forms.TabAppearance.FlatButtons>, it only appears as such when the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to <xref:System.Windows.Forms.TabAlignment.Top>. Otherwise, the <xref:System.Windows.Forms.TabControl.Appearance%2A> property displays as if set to the <xref:System.Windows.Forms.TabAppearance.Buttons> value. + + When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to <xref:System.Windows.Forms.TabAppearance.Buttons>, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to <xref:System.Windows.Forms.TabAlignment.Top> so that the buttons display correctly. + > [!NOTE] -> When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to `Top` so that the tab page contents display correctly. Additionally, when visual styles are enabled, and the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to a value other than <xref:System.Windows.Forms.TabAlignment.Top>, the tab contents may not render correctly. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with three <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Left`, which positions the tabs of `tabControl1` on the left side. - +> When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to `Top` so that the tab page contents display correctly. Additionally, when visual styles are enabled, and the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to a value other than <xref:System.Windows.Forms.TabAlignment.Top>, the tab contents may not render correctly. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with three <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Left`, which positions the tabs of `tabControl1` on the left side. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabAlignment/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Alignment/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabAlignment/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabAlignment/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.TabAlignment" /> value.</exception> @@ -261,23 +261,23 @@ <summary>Gets or sets the visual appearance of the control's tabs.</summary> <value>One of the <see cref="T:System.Windows.Forms.TabAppearance" /> values. The default is <see langword="Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `FlatButtons`, it only appears as such when the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Top`. Otherwise, the <xref:System.Windows.Forms.TabControl.Appearance%2A> property appears as if set to the `Buttons` value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `FlatButtons`, it only appears as such when the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Top`. Otherwise, the <xref:System.Windows.Forms.TabControl.Appearance%2A> property appears as if set to the `Buttons` value. + > [!NOTE] -> When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to `Top` so that the tab page contents display correctly. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. This example sets the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, which displays the tabs of the tab pages as buttons. - +> When you set the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, you must also set the <xref:System.Windows.Forms.TabControl.Alignment%2A> property to `Top` so that the tab page contents display correctly. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. This example sets the <xref:System.Windows.Forms.TabControl.Appearance%2A> property to `Buttons`, which displays the tabs of the tab pages as buttons. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Appearance/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Appearance/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Appearance/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Appearance/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.TabAppearance" /> value.</exception> @@ -452,11 +452,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.TabControl.BackgroundImage" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TabControl.BackgroundImage%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.BackgroundImageChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TabControl.BackgroundImage%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.BackgroundImageChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -539,11 +539,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.TabControl.BackgroundImageLayout" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TabControl.BackgroundImageLayout%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.BackgroundImageLayoutChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TabControl.BackgroundImageLayout%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.BackgroundImageLayoutChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -723,33 +723,33 @@ <Docs> <summary>Occurs when a tab is deselected.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. - -- <xref:System.Windows.Forms.TabControl.Deselecting> - -- <xref:System.Windows.Forms.TabControl.Deselected> - -- <xref:System.Windows.Forms.TabControl.Selecting> - -- <xref:System.Windows.Forms.TabControl.Selected> - - These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. - - The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Deselected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Deselected> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. + +- <xref:System.Windows.Forms.TabControl.Deselecting> + +- <xref:System.Windows.Forms.TabControl.Deselected> + +- <xref:System.Windows.Forms.TabControl.Selecting> + +- <xref:System.Windows.Forms.TabControl.Selected> + + These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. + + The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Deselected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Deselected> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet560"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet560"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet560"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TabPage" /> @@ -794,33 +794,33 @@ <Docs> <summary>Occurs before a tab is deselected, enabling a handler to cancel the tab change.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. - -- <xref:System.Windows.Forms.TabControl.Deselecting> - -- <xref:System.Windows.Forms.TabControl.Deselected> - -- <xref:System.Windows.Forms.TabControl.Selecting> - -- <xref:System.Windows.Forms.TabControl.Selected> - - These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. - - The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Deselecting> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Deselecting> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. + +- <xref:System.Windows.Forms.TabControl.Deselecting> + +- <xref:System.Windows.Forms.TabControl.Deselected> + +- <xref:System.Windows.Forms.TabControl.Selecting> + +- <xref:System.Windows.Forms.TabControl.Selected> + + These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. + + The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Deselecting> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Deselecting> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet559"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet559"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet559"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TabPage" /> @@ -879,11 +879,11 @@ <param name="index">The index in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection of the tab to deselect.</param> <summary>Makes the tab following the tab with the specified index the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -927,17 +927,17 @@ <param name="tabPageName">The <see cref="P:System.Windows.Forms.Control.Name" /> of the tab to deselect.</param> <summary>Makes the tab following the tab with the specified name the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]></format> </remarks> - <exception cref="T:System.ArgumentNullException">The <paramref name="tabPageName" /> argument is <see langword="null" />. - - -or- - + <exception cref="T:System.ArgumentNullException">The <paramref name="tabPageName" /> argument is <see langword="null" />. + + -or- + The <paramref name="tabPageName" /> argument does not match the <see cref="P:System.Windows.Forms.Control.Name" /> property of any <see cref="T:System.Windows.Forms.TabPage" /> in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection.</exception> <altmember cref="T:System.Windows.Forms.TabPage" /> <altmember cref="Overload:System.Windows.Forms.TabControl.SelectTab" /> @@ -978,18 +978,18 @@ <param name="tabPage">The <see cref="T:System.Windows.Forms.TabPage" /> to deselect.</param> <summary>Makes the tab following the specified <see cref="T:System.Windows.Forms.TabPage" /> the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically deselect a particular tab in a <xref:System.Windows.Forms.TabControl>. If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="index" /> is less than 0 or greater than the number of <see cref="T:System.Windows.Forms.TabPage" /> controls in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection minus 1. - - -or- - + <paramref name="index" /> is less than 0 or greater than the number of <see cref="T:System.Windows.Forms.TabPage" /> controls in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection minus 1. + + -or- + <paramref name="tabPage" /> is not in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection.</exception> <exception cref="T:System.ArgumentNullException">The <paramref name="tabPage" /> argument is <see langword="null" />.</exception> <altmember cref="T:System.Windows.Forms.TabPage" /> @@ -1029,15 +1029,15 @@ <summary>Gets the display area of the control's tab pages.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the display area of the tab pages.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.DisplayRectangle%2A> property to draw a <xref:System.Drawing.Rectangle> representing the tab page display area of `tabControl1`. Notice that the example uses the <xref:System.Drawing.Rectangle.Inflate%2A> method; otherwise, the <xref:System.Windows.Forms.TabPage> drawing code overwrites the <xref:System.Drawing.Rectangle> drawn in the `DrawOnTabPage` method. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.DisplayRectangle%2A> property to draw a <xref:System.Drawing.Rectangle> representing the tab page display area of `tabControl1`. Notice that the example uses the <xref:System.Drawing.Rectangle.Inflate%2A> method; otherwise, the <xref:System.Windows.Forms.TabPage> drawing code overwrites the <xref:System.Drawing.Rectangle> drawn in the `DrawOnTabPage` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DisplayRectangle1/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DisplayRectangle/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DisplayRectangle1/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DisplayRectangle1/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Drawing.Rectangle" /> @@ -1143,24 +1143,24 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.TabControl" /> needs to paint each of its tabs if the <see cref="P:System.Windows.Forms.TabControl.DrawMode" /> property is set to <see cref="F:System.Windows.Forms.TabDrawMode.OwnerDrawFixed" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example declares an event handler that is used to draw a string and `Rectangle` on the tab of `tabPage1`. The event handler is bound to the `DrawItem` event. - + <format type="text/markdown"><. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example declares an event handler that is used to draw a string and `Rectangle` on the tab of `tabPage1`. The event handler is bound to the `DrawItem` event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DrawItem/CPP/drawitem.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DrawItem/drawitem.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawItem/VB/drawitem.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawItem/VB/drawitem.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.DrawItemEventHandler" /> @@ -1204,24 +1204,24 @@ <summary>Gets or sets the way that the control's tabs are drawn.</summary> <value>One of the <see cref="T:System.Windows.Forms.TabDrawMode" /> values. The default is <see langword="Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you set the <xref:System.Windows.Forms.TabControl.DrawMode%2A> property to <xref:System.Windows.Forms.TabDrawMode.OwnerDrawFixed>, the <xref:System.Windows.Forms.TabControl> raises the <xref:System.Windows.Forms.TabControl.DrawItem> event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the <xref:System.Windows.Forms.TabControl.DrawItem> event. - - The <xref:System.Windows.Forms.TabControl> does not support variable tab sizes with owner drawing. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example sets the <xref:System.Windows.Forms.TabControl.DrawMode%2A> property to `OwnerDrawFixed`, which specifies that the tabs are drawn by the parent object `Form1`. The value `OwnerDrawFixed` also enables access to the <xref:System.Windows.Forms.TabControl.DrawItem> event, which, in this example, is used to draw `myTabRect` on the `tabPage1` tab. - - Use the <xref:System.Drawing> and <xref:System.Windows.Forms> namespaces with this example. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you set the <xref:System.Windows.Forms.TabControl.DrawMode%2A> property to <xref:System.Windows.Forms.TabDrawMode.OwnerDrawFixed>, the <xref:System.Windows.Forms.TabControl> raises the <xref:System.Windows.Forms.TabControl.DrawItem> event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the <xref:System.Windows.Forms.TabControl.DrawItem> event. + + The <xref:System.Windows.Forms.TabControl> does not support variable tab sizes with owner drawing. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example sets the <xref:System.Windows.Forms.TabControl.DrawMode%2A> property to `OwnerDrawFixed`, which specifies that the tabs are drawn by the parent object `Form1`. The value `OwnerDrawFixed` also enables access to the <xref:System.Windows.Forms.TabControl.DrawItem> event, which, in this example, is used to draw `myTabRect` on the `tabPage1` tab. + + Use the <xref:System.Drawing> and <xref:System.Windows.Forms> namespaces with this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DrawMode/CPP/drawmode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DrawMode/drawmode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawMode/VB/drawmode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawMode/VB/drawmode.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.TabDrawMode" /> value.</exception> @@ -1309,11 +1309,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.TabControl.ForeColor" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TabControl.ForeColor%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.ForeColorChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TabControl.ForeColor%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.ForeColorChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -1463,23 +1463,23 @@ <summary>Returns the bounding rectangle for a specified tab in this tab control.</summary> <returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the specified tab.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.GetTabRect%2A> method to get a `Rectangle` that represents the `tabPage1` tab area. The `myTabRect` `Rectangle` is drawn by the <xref:System.Windows.Forms.TabControl.DrawItem> event. - - Use the <xref:System.Drawing> and <xref:System.Windows.Forms> namespaces with this example. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.GetTabRect%2A> method to get a `Rectangle` that represents the `tabPage1` tab area. The `myTabRect` `Rectangle` is drawn by the <xref:System.Windows.Forms.TabControl.DrawItem> event. + + Use the <xref:System.Drawing> and <xref:System.Windows.Forms> namespaces with this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/GetTabRect/CPP/gettabrect.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/GetTabRect/gettabrect.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/GetTabRect/VB/gettabrect.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/GetTabRect/VB/gettabrect.vb" id="Snippet1"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentOutOfRangeException">The index is less than zero. - - -or- - + <exception cref="T:System.ArgumentOutOfRangeException">The index is less than zero. + + -or- + The index is greater than or equal to <see cref="P:System.Windows.Forms.TabControl.TabPageCollection.Count" />.</exception> </Docs> </Member> @@ -1552,20 +1552,20 @@ <value> <see langword="true" /> if the tabs change in appearance when the mouse passes over them; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The color that the tab changes to when the mouse is over it is determined by the local computer's system colors. To change the system colors, use Control Panel. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.HotTrack%2A> property is set to `true`, which highlights the tab <xref:System.Windows.Forms.TabPage.Text%2A> `myTabPage1` or `myTabPage2` when the mouse passes over the tabs. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The color that the tab changes to when the mouse is over it is determined by the local computer's system colors. To change the system colors, use Control Panel. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.HotTrack%2A> property is set to `true`, which highlights the tab <xref:System.Windows.Forms.TabPage.Text%2A> `myTabPage1` or `myTabPage2` when the mouse passes over the tabs. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/HotTrack/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/HotTrack/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/HotTrack/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/HotTrack/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1620,20 +1620,20 @@ <summary>Gets or sets the images to display on the control's tabs.</summary> <value>An <see cref="T:System.Windows.Forms.ImageList" /> that specifies the images to display on the tabs.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To display an image on a tab, set the <xref:System.Windows.Forms.TabPage.ImageIndex%2A> property of that <xref:System.Windows.Forms.TabPage>. The <xref:System.Windows.Forms.TabPage.ImageIndex%2A> acts as the index into the <xref:System.Windows.Forms.TabControl.ImageList%2A>. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.ImageList%2A> property to display images, from the collection defined by the <xref:System.Windows.Forms.ImageList> named `myImages`, on the tabs of `tabControl1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To display an image on a tab, set the <xref:System.Windows.Forms.TabPage.ImageIndex%2A> property of that <xref:System.Windows.Forms.TabPage>. The <xref:System.Windows.Forms.TabPage.ImageIndex%2A> acts as the index into the <xref:System.Windows.Forms.TabControl.ImageList%2A>. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.ImageList%2A> property to display images, from the collection defined by the <xref:System.Windows.Forms.ImageList> named `myImages`, on the tabs of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabControl.ImageList/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ImageList/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl.ImageList/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl.ImageList/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ImageList" /> @@ -1671,11 +1671,11 @@ <returns> <see langword="true" /> if the specified key is a regular input key; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Call this method during window-message preprocessing to determine whether the specified key is a regular input key that should be sent directly to the tab control or a special key (such as PAGE UP and PAGE DOWN) that should preprocessed. In the latter case, send the key to the control only if it is not consumed by the preprocessing phase. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Call this method during window-message preprocessing to determine whether the specified key is a regular input key that should be sent directly to the tab control or a special key (such as PAGE UP and PAGE DOWN) that should preprocessed. In the latter case, send the key to the control only if it is not consumed by the preprocessing phase. + ]]></format> </remarks> </Docs> @@ -1713,20 +1713,20 @@ <summary>Gets or sets the size of the control's tabs.</summary> <value>A <see cref="T:System.Drawing.Size" /> that represents the size of the tabs. The default automatically sizes the tabs to fit the icons and labels on the tabs.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To change the <xref:System.Drawing.Size.Width%2A> property of the <xref:System.Windows.Forms.TabControl.ItemSize%2A> property, the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property must be set to `Fixed`. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. To define the dimensions of the tabs, set the <xref:System.Windows.Forms.TabControl.ItemSize%2A> property equal to a <xref:System.Drawing.Size> structure. In this example, <xref:System.Drawing.Size> defines the tabs 90 pixels wide and 50 pixels high. You cannot change the width of the tabs unless the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property is set to the <xref:System.Windows.Forms.TabSizeMode.Fixed> value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To change the <xref:System.Drawing.Size.Width%2A> property of the <xref:System.Windows.Forms.TabControl.ItemSize%2A> property, the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property must be set to `Fixed`. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. To define the dimensions of the tabs, set the <xref:System.Windows.Forms.TabControl.ItemSize%2A> property equal to a <xref:System.Drawing.Size> structure. In this example, <xref:System.Drawing.Size> defines the tabs 90 pixels wide and 50 pixels high. You cannot change the width of the tabs unless the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property is set to the <xref:System.Windows.Forms.TabSizeMode.Fixed> value. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ItemSize/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ItemSize/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ItemSize/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ItemSize/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The width or height of the <see cref="T:System.Drawing.Size" /> is less than 0.</exception> @@ -1767,22 +1767,22 @@ <value> <see langword="true" /> if more than one row of tabs can be displayed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If <xref:System.Windows.Forms.TabControl.Multiline%2A> is `false`, only one row of tabs is displayed, even if all the tabs do not fit in the available space. In that case, however, arrows are displayed that enable the user to navigate to the undisplayed tabs. - - If the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is changed to `false` while the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Left` or `Right`, the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is automatically reset to `Top`. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with four <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Multiline%2A> property is set to `true`, which displays two rows of tabs instead of one. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If <xref:System.Windows.Forms.TabControl.Multiline%2A> is `false`, only one row of tabs is displayed, even if all the tabs do not fit in the available space. In that case, however, arrows are displayed that enable the user to navigate to the undisplayed tabs. + + If the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is changed to `false` while the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is set to `Left` or `Right`, the <xref:System.Windows.Forms.TabControl.Alignment%2A> property is automatically reset to `Top`. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with four <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Multiline%2A> property is set to `true`, which displays two rows of tabs instead of one. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Multiline/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Multiline/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Multiline/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Multiline/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TabControl.Alignment" /> @@ -1817,13 +1817,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.TabControlEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.Deselected" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnDeselected%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnDeselected%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1861,13 +1861,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.TabControlCancelEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.Deselecting" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnDeselecting%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnDeselecting%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1906,13 +1906,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.DrawItemEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.DrawItem" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnDrawItem%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnDrawItem%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1953,15 +1953,15 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Enter" /> event of the <see cref="T:System.Windows.Forms.TabControl" />.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnEnter%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnEnter%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2000,13 +2000,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnFontChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnFontChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2104,13 +2104,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.HandleDestroyed" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnHandleDestroyed%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnHandleDestroyed%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2150,18 +2150,18 @@ <param name="ke">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.KeyDown" /> event.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TabControl> control enables the user to use the keyboard to switch between <xref:System.Windows.Forms.TabPage> controls. The following table describes how the <xref:System.Windows.Forms.TabControl> switches between the selected <xref:System.Windows.Forms.TabPage> controls, depending on which keys are pressed. - -|Key|Description| -|---------|-----------------| -|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.Tab>|Selects the next <xref:System.Windows.Forms.TabPage>.| -|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.Shift> + <xref:System.Windows.Forms.Keys.Tab>|Selects the previous <xref:System.Windows.Forms.TabPage>.| -|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.PageDown>|Selects the next <xref:System.Windows.Forms.TabPage>.| -|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.PageUp>|Selects the previous <xref:System.Windows.Forms.TabPage>.| - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TabControl> control enables the user to use the keyboard to switch between <xref:System.Windows.Forms.TabPage> controls. The following table describes how the <xref:System.Windows.Forms.TabControl> switches between the selected <xref:System.Windows.Forms.TabPage> controls, depending on which keys are pressed. + +|Key|Description| +|---------|-----------------| +|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.Tab>|Selects the next <xref:System.Windows.Forms.TabPage>.| +|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.Shift> + <xref:System.Windows.Forms.Keys.Tab>|Selects the previous <xref:System.Windows.Forms.TabPage>.| +|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.PageDown>|Selects the next <xref:System.Windows.Forms.TabPage>.| +|<xref:System.Windows.Forms.Keys.Control> + <xref:System.Windows.Forms.Keys.PageUp>|Selects the previous <xref:System.Windows.Forms.TabPage>.| + ]]></format> </remarks> </Docs> @@ -2199,15 +2199,15 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Leave" /> event of the <see cref="T:System.Windows.Forms.TabControl" />.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnLeave%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnLeave%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2311,13 +2311,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.RightToLeftLayoutChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnRightToLeftLayoutChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnRightToLeftLayoutChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2355,13 +2355,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.TabControlEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.Selected" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnSelected%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnSelected%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2400,13 +2400,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.SelectedIndexChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnSelectedIndexChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnSelectedIndexChanged%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2443,13 +2443,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.TabControlCancelEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.TabControl.Selecting" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.TabControl.OnSelecting%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.TabControl.OnSelecting%2A> method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2527,15 +2527,15 @@ <summary>Gets or sets the amount of space around each item on the control's tab pages.</summary> <value>A <see cref="T:System.Drawing.Point" /> that specifies the amount of space around each item. The default is (6,3).</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Padding%2A> property is used to create a cushion of 22 pixels around the tab <xref:System.Windows.Forms.TabPage.Text%2A> `myTabPage1` and `myTabPage2`. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.Padding%2A> property is used to create a cushion of 22 pixels around the tab <xref:System.Windows.Forms.TabPage.Text%2A> `myTabPage1` and `myTabPage2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Padding/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Padding/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Padding/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Padding/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The width or height of the <see cref="T:System.Drawing.Point" /> is less than 0.</exception> @@ -2646,11 +2646,11 @@ <Docs> <summary>Removes all the tab pages and additional controls from this tab control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - All controls are removed through the `Controls` property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + All controls are removed through the `Controls` property. + ]]></format> </remarks> </Docs> @@ -2696,15 +2696,15 @@ <value> <see langword="true" /> if right-to-left mirror placement is turned on; <see langword="false" /> for standard child control placement. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.RightToLeft" /> @@ -2744,21 +2744,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.TabControl.RightToLeftLayout" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.RightToLeftLayoutChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.RightToLeftLayoutChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.RightToLeftLayoutChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.RightToLeftLayoutChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet555"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet555"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet555"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TabControl.RightToLeftLayout" /> @@ -2805,20 +2805,20 @@ <summary>Gets the number of rows that are currently being displayed in the control's tab strip.</summary> <value>The number of rows that are currently being displayed in the tab strip.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TabControl.RowCount%2A> property when the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is `true` and you want to know the number of rows that the tabs occupy. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage> objects. This example uses the <xref:System.Windows.Forms.TabControl.RowCount%2A> property to get the number of rows currently in the `tabControl1` tab strip. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TabControl.RowCount%2A> property when the <xref:System.Windows.Forms.TabControl.Multiline%2A> property is `true` and you want to know the number of rows that the tabs occupy. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage> objects. This example uses the <xref:System.Windows.Forms.TabControl.RowCount%2A> property to get the number of rows currently in the `tabControl1` tab strip. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/RowCount/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/RowCount/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RowCount/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RowCount/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2895,33 +2895,33 @@ <Docs> <summary>Occurs when a tab is selected.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. - -- <xref:System.Windows.Forms.TabControl.Deselecting> - -- <xref:System.Windows.Forms.TabControl.Deselected> - -- <xref:System.Windows.Forms.TabControl.Selecting> - -- <xref:System.Windows.Forms.TabControl.Selected> - - These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. - - The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Selected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Selected> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. + +- <xref:System.Windows.Forms.TabControl.Deselecting> + +- <xref:System.Windows.Forms.TabControl.Deselected> + +- <xref:System.Windows.Forms.TabControl.Selecting> + +- <xref:System.Windows.Forms.TabControl.Selected> + + These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. + + The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Selected> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Selected> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet558"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet558"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet558"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TabPage" /> @@ -2971,15 +2971,15 @@ <summary>Gets or sets the index of the currently selected tab page.</summary> <value>The zero-based index of the currently selected tab page. The default is -1, which is also the value if no tab page is selected.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> property sets `tabPage2` as the currently selected tab page using its index value. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> property sets `tabPage2` as the currently selected tab page using its index value. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SelectedIndex/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SelectedIndex/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedIndex/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedIndex/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The value is less than -1.</exception> @@ -3026,23 +3026,23 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.TabControl.SelectedIndex" /> property has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.SelectedIndexChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.SelectedIndexChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.SelectedIndexChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.SelectedIndexChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet556"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet556"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet556"::: + ]]></format> </remarks> </Docs> @@ -3101,20 +3101,20 @@ <summary>Gets or sets the currently selected tab page.</summary> <value>A <see cref="T:System.Windows.Forms.TabPage" /> that represents the selected tab page. If no tab page is selected, the value is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The tab page must be in the <xref:System.Windows.Forms.TabControl.TabPages%2A> collection to make it the current tab page. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property sets `tabPage2` as the currently selected tab page. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The tab page must be in the <xref:System.Windows.Forms.TabControl.TabPages%2A> collection to make it the current tab page. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. The <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property sets `tabPage2` as the currently selected tab page. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SelectedTab/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SelectedTab/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedTab/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedTab/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TabControl.TabPages" /> @@ -3160,33 +3160,33 @@ <Docs> <summary>Occurs before a tab is selected, enabling a handler to cancel the tab change.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. - -- <xref:System.Windows.Forms.TabControl.Deselecting> - -- <xref:System.Windows.Forms.TabControl.Deselected> - -- <xref:System.Windows.Forms.TabControl.Selecting> - -- <xref:System.Windows.Forms.TabControl.Selected> - - These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. - - The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Selecting> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Selecting> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the current tab changes in a <xref:System.Windows.Forms.TabControl>, the following events occur in the following order. + +- <xref:System.Windows.Forms.TabControl.Deselecting> + +- <xref:System.Windows.Forms.TabControl.Deselected> + +- <xref:System.Windows.Forms.TabControl.Selecting> + +- <xref:System.Windows.Forms.TabControl.Selected> + + These events let you perform tasks such as canceling a tab change if a <xref:System.Windows.Forms.TabPage> is in an invalid state or updating the state of a newly displayed <xref:System.Windows.Forms.TabPage>. + + The current tab changes when the user clicks a tab, when you call the <xref:System.Windows.Forms.TabControl.DeselectTab%2A> or <xref:System.Windows.Forms.TabControl.SelectTab%2A> method, or when you change the value of the <xref:System.Windows.Forms.TabControl.SelectedIndex%2A> or <xref:System.Windows.Forms.TabControl.SelectedTab%2A> property. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TabControl.Selecting> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TabControl> named `TabControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TabControl.Selecting> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet557"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet557"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet557"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TabPage" /> @@ -3245,11 +3245,11 @@ <param name="index">The index in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection of the tab to select.</param> <summary>Makes the tab with the specified index the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -3293,17 +3293,17 @@ <param name="tabPageName">The <see cref="P:System.Windows.Forms.Control.Name" /> of the tab to select.</param> <summary>Makes the tab with the specified name the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. + ]]></format> </remarks> - <exception cref="T:System.ArgumentNullException">The <paramref name="tabPageName" /> argument is <see langword="null" />. - - -or- - + <exception cref="T:System.ArgumentNullException">The <paramref name="tabPageName" /> argument is <see langword="null" />. + + -or- + The <paramref name="tabPageName" /> argument does not match the <see cref="P:System.Windows.Forms.Control.Name" /> property of any <see cref="T:System.Windows.Forms.TabPage" /> in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection.</exception> <altmember cref="T:System.Windows.Forms.TabPage" /> <altmember cref="Overload:System.Windows.Forms.TabControl.DeselectTab" /> @@ -3344,18 +3344,18 @@ <param name="tabPage">The <see cref="T:System.Windows.Forms.TabPage" /> to select.</param> <summary>Makes the specified <see cref="T:System.Windows.Forms.TabPage" /> the current tab.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this method to programmatically select a particular tab in a <xref:System.Windows.Forms.TabControl>. + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> - <paramref name="index" /> is less than 0 or greater than the number of <see cref="T:System.Windows.Forms.TabPage" /> controls in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection minus 1. - - -or- - + <paramref name="index" /> is less than 0 or greater than the number of <see cref="T:System.Windows.Forms.TabPage" /> controls in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection minus 1. + + -or- + <paramref name="tabPage" /> is not in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection.</exception> <exception cref="T:System.ArgumentNullException">The <paramref name="tabPage" /> argument is <see langword="null" />.</exception> <altmember cref="Overload:System.Windows.Forms.TabControl.DeselectTab" /> @@ -3406,20 +3406,20 @@ <value> <see langword="true" /> if ToolTips are shown for the tabs that have them; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - To create a ToolTip for a tab, set the <xref:System.Windows.Forms.TabPage.ToolTipText%2A> property of the <xref:System.Windows.Forms.TabPage>. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. For tab page ToolTips to display, the <xref:System.Windows.Forms.TabControl.ShowToolTips%2A> property must equal to `true`, as in this example. The <xref:System.Windows.Forms.TabPage.ToolTipText%2A> property is used to assign string values to the ToolTips. - + <format type="text/markdown"><![CDATA[ + +## Remarks + To create a ToolTip for a tab, set the <xref:System.Windows.Forms.TabPage.ToolTipText%2A> property of the <xref:System.Windows.Forms.TabPage>. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with two <xref:System.Windows.Forms.TabPage> objects. For tab page ToolTips to display, the <xref:System.Windows.Forms.TabControl.ShowToolTips%2A> property must equal to `true`, as in this example. The <xref:System.Windows.Forms.TabPage.ToolTipText%2A> property is used to assign string values to the ToolTips. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTipText/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ShowToolTips/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTipText/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTipText/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolTip" /> @@ -3470,15 +3470,15 @@ <summary>Gets or sets the way that the control's tabs are sized.</summary> <value>One of the <see cref="T:System.Windows.Forms.TabSizeMode" /> values. The default is <see langword="Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage>. This example sets the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property to `FillToRight`, which sizes the tabs so that each row fills the entire width of `tabControl1`. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage>. This example sets the <xref:System.Windows.Forms.TabControl.SizeMode%2A> property to `FillToRight`, which sizes the tabs so that each row fills the entire width of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SizeMode/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SizeMode/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SizeMode/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SizeMode/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.TabSizeMode" /> value.</exception> @@ -3530,15 +3530,15 @@ <summary>Gets the number of tabs in the tab strip.</summary> <value>The number of tabs in the tab strip.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage> objects. This example uses the <xref:System.Windows.Forms.TabControl.TabCount%2A> property to get the number of tabs currently in the `tabControl1` tab strip. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with five <xref:System.Windows.Forms.TabPage> objects. This example uses the <xref:System.Windows.Forms.TabControl.TabCount%2A> property to get the number of tabs currently in the `tabControl1` tab strip. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabCount/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/TabCount/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabCount/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabCount/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -3600,20 +3600,20 @@ <summary>Gets the collection of tab pages in this tab control.</summary> <value>A <see cref="T:System.Windows.Forms.TabControl.TabPageCollection" /> that contains the <see cref="T:System.Windows.Forms.TabPage" /> objects in this <see cref="T:System.Windows.Forms.TabControl" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The order of tab pages in this collection reflects the order the tabs appear in the control. - - - -## Examples - The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.TabPageCollection.Add%2A> method to add a single tab page to the `tabControl1` tab control. Notice the <xref:System.Windows.Forms.TabControl.TabPages%2A> property is used to get the `tabControl1` controls collection to add the `tabPage1` to this collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The order of tab pages in this collection reflects the order the tabs appear in the control. + + + +## Examples + The following code example creates a <xref:System.Windows.Forms.TabControl> with one <xref:System.Windows.Forms.TabPage>. This example uses the <xref:System.Windows.Forms.TabControl.TabPageCollection.Add%2A> method to add a single tab page to the `tabControl1` tab control. Notice the <xref:System.Windows.Forms.TabControl.TabPages%2A> property is used to get the `tabControl1` controls collection to add the `tabPage1` to this collection. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabPageCollection.Add/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl+TabPageCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabPageCollection.Add/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabPageCollection.Add/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TabControl.TabPageCollection" /> @@ -3704,11 +3704,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.TabControl.Text" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TabControl.Text%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.TextChanged> event to detect the change. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TabControl.Text%2A> property is not meaningful for this control, although you can change its value and handle the <xref:System.Windows.Forms.TabControl.TextChanged> event to detect the change. + ]]></format> </remarks> </Docs> @@ -3741,11 +3741,11 @@ <summary>Returns a string that represents the <see cref="T:System.Windows.Forms.TabControl" /> control.</summary> <returns>A string that represents the current <see cref="T:System.Windows.Forms.TabControl" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The string includes the type and the <xref:System.Windows.Forms.TabControl.TabPageCollection.Count%2A> property of the control. If there is at least one <xref:System.Windows.Forms.TabPage> control on the <xref:System.Windows.Forms.TabControl>, this method returns a string that includes the string returned by the <xref:System.Windows.Forms.TabPage.ToString%2A> method for the first <xref:System.Windows.Forms.TabPage>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The string includes the type and the <xref:System.Windows.Forms.TabControl.TabPageCollection.Count%2A> property of the control. If there is at least one <xref:System.Windows.Forms.TabPage> control on the <xref:System.Windows.Forms.TabControl>, this method returns a string that includes the string returned by the <xref:System.Windows.Forms.TabPage.ToString%2A> method for the first <xref:System.Windows.Forms.TabPage>. + ]]></format> </remarks> </Docs> @@ -3789,11 +3789,11 @@ <see langword="true" /> to change focus to the next <see cref="T:System.Windows.Forms.TabPage" />; otherwise, <see langword="false" />.</param> <summary>Sets the <see cref="P:System.Windows.Forms.TabPage.Visible" /> property to <see langword="true" /> for the appropriate <see cref="T:System.Windows.Forms.TabPage" /> control in the <see cref="P:System.Windows.Forms.TabControl.TabPages" /> collection.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method ensures the appropriate <xref:System.Windows.Forms.TabControlEventArgs.TabPage%2A> is visible. If you want the tab control to set the <xref:System.Windows.Forms.TabPage.Visible%2A> property to `true` for the next <xref:System.Windows.Forms.TabPage> in the tab order, call this method with `updateFocus` set to `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method ensures the appropriate <xref:System.Windows.Forms.TabControlEventArgs.TabPage%2A> is visible. If you want the tab control to set the <xref:System.Windows.Forms.TabPage.Visible%2A> property to `true` for the next <xref:System.Windows.Forms.TabPage> in the tab order, call this method with `updateFocus` set to `true`. + ]]></format> </remarks> <forInternalUseOnly /> diff --git a/xml/System.Windows.Forms/TabRenderer.xml b/xml/System.Windows.Forms/TabRenderer.xml index 755dff0cb74..5123ec49404 100644 --- a/xml/System.Windows.Forms/TabRenderer.xml +++ b/xml/System.Windows.Forms/TabRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a tab control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods to draw a basic tab control with two tabs. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods to draw a basic tab control with two tabs. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -99,21 +99,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -153,21 +153,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -222,21 +222,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, and with the specified text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -280,21 +280,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, with the specified image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -352,30 +352,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, with the specified text, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TabRenderer.DrawTabItem%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.TabItemState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a tab item. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TabRenderer.DrawTabItem%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Boolean%2CSystem.Windows.Forms.VisualStyles.TabItemState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a tab item. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -429,21 +429,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, with the specified text and text formatting, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -512,21 +512,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds, with the specified text and image, and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -591,21 +591,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TabItemState" /> values that specifies the visual state of the tab.</param> <summary>Draws a tab in the specified state and bounds; with the specified text, text formatting, and image; and with an optional focus rectangle.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -640,30 +640,30 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds of the tab page.</param> <summary>Draws a tab page in the specified bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a tab page. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a tab page. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -694,20 +694,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TabRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TabRenderer.DrawTabPage%2A> and <xref:System.Windows.Forms.TabRenderer.DrawTabItem%2A> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TabRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/TableLayoutPanel.xml b/xml/System.Windows.Forms/TableLayoutPanel.xml index 8557491c2f5..7a683c873c7 100644 --- a/xml/System.Windows.Forms/TableLayoutPanel.xml +++ b/xml/System.Windows.Forms/TableLayoutPanel.xml @@ -85,66 +85,66 @@ <Docs> <summary>Represents a panel that dynamically lays out its contents in a grid composed of rows and columns.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel> control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so it can respond to changes such as the parent control resizing or text length changing due to localization. - - Any Windows Forms control can be a child of the <xref:System.Windows.Forms.TableLayoutPanel> control, including other instances of <xref:System.Windows.Forms.TableLayoutPanel>. This allows you to construct sophisticated layouts that adapt to changes at runtime. - - The <xref:System.Windows.Forms.TableLayoutPanel> control can expand to accommodate new controls when they are added, depending on the value of the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> properties. Setting either the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> property to a value of 0 specifies that the <xref:System.Windows.Forms.TableLayoutPanel> will be unbound in the corresponding direction. - - You can also control the direction of expansion (horizontal or vertical) after the <xref:System.Windows.Forms.TableLayoutPanel> control is full of child controls. By default, the <xref:System.Windows.Forms.TableLayoutPanel> control expands downward by adding rows. - - If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the <xref:System.Windows.Forms.TableLayoutPanel.RowStyles%2A> and <xref:System.Windows.Forms.TableLayoutPanel.ColumnStyles%2A> properties. You can set the properties of rows or columns individually. - - The <xref:System.Windows.Forms.TableLayoutPanel> control adds the following properties to its child controls: `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan`. - - You can merge cells in the <xref:System.Windows.Forms.TableLayoutPanel> control by setting the `ColumnSpan` or `RowSpan` properties on a child control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel> control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so it can respond to changes such as the parent control resizing or text length changing due to localization. + + Any Windows Forms control can be a child of the <xref:System.Windows.Forms.TableLayoutPanel> control, including other instances of <xref:System.Windows.Forms.TableLayoutPanel>. This allows you to construct sophisticated layouts that adapt to changes at runtime. + + The <xref:System.Windows.Forms.TableLayoutPanel> control can expand to accommodate new controls when they are added, depending on the value of the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> properties. Setting either the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> property to a value of 0 specifies that the <xref:System.Windows.Forms.TableLayoutPanel> will be unbound in the corresponding direction. + + You can also control the direction of expansion (horizontal or vertical) after the <xref:System.Windows.Forms.TableLayoutPanel> control is full of child controls. By default, the <xref:System.Windows.Forms.TableLayoutPanel> control expands downward by adding rows. + + If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the <xref:System.Windows.Forms.TableLayoutPanel.RowStyles%2A> and <xref:System.Windows.Forms.TableLayoutPanel.ColumnStyles%2A> properties. You can set the properties of rows or columns individually. + + The <xref:System.Windows.Forms.TableLayoutPanel> control adds the following properties to its child controls: `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan`. + + You can merge cells in the <xref:System.Windows.Forms.TableLayoutPanel> control by setting the `ColumnSpan` or `RowSpan` properties on a child control. + > [!NOTE] -> To set the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the <xref:System.Windows.Forms.TableLayoutPanel.SetCellPosition%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetRow%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods. -> -> To read the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the <xref:System.Windows.Forms.TableLayoutPanel.GetCellPosition%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> methods. - - The docking behavior of child controls is the same as other container controls. - - The anchoring behavior of child controls in a <xref:System.Windows.Forms.TableLayoutPanel> differs from the behavior in other container controls. If the value of the child control's <xref:System.Windows.Forms.Control.Anchor%2A> property is set to <xref:System.Windows.Forms.AnchorStyles.Left> or <xref:System.Windows.Forms.AnchorStyles.Right>, the control will be placed against the left or right border of the cell, at a distance that is the sum of the control's <xref:System.Windows.Forms.Control.Margin%2A> property and the panel's <xref:System.Windows.Forms.Control.Padding%2A> property. If both the <xref:System.Windows.Forms.AnchorStyles.Left> and <xref:System.Windows.Forms.AnchorStyles.Right> values are set, the control will be sized to the width of the cell, with the <xref:System.Windows.Forms.Control.Margin%2A> and <xref:System.Windows.Forms.Control.Padding%2A> values taken into account. The behavior for <xref:System.Windows.Forms.AnchorStyles.Top> and <xref:System.Windows.Forms.AnchorStyles.Bottom> anchoring is analogous. For more information, see [How to: Anchor and Dock Child Controls in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control). - - If you need a child control to mimic the default anchoring behavior in other container controls, you can adjust the <xref:System.Windows.Forms.Control.Margin%2A> and <xref:System.Windows.Forms.Control.Padding%2A> properties to maintain a constant distance between the control's border and the cell's border. - - Setting the values of both the `Column` and `Row` properties of a child control to -1 will cause the control to be moved to the first empty cell in the <xref:System.Windows.Forms.TableLayoutPanel> control. The empty cell will be chosen in a search that proceeds from left to right and from top to bottom. This order is dependent on the culture, so it will behave correctly in right-to-left (RTL) layouts. - +> To set the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the <xref:System.Windows.Forms.TableLayoutPanel.SetCellPosition%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetRow%2A>, <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods. +> +> To read the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the <xref:System.Windows.Forms.TableLayoutPanel.GetCellPosition%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A>, <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> methods. + + The docking behavior of child controls is the same as other container controls. + + The anchoring behavior of child controls in a <xref:System.Windows.Forms.TableLayoutPanel> differs from the behavior in other container controls. If the value of the child control's <xref:System.Windows.Forms.Control.Anchor%2A> property is set to <xref:System.Windows.Forms.AnchorStyles.Left> or <xref:System.Windows.Forms.AnchorStyles.Right>, the control will be placed against the left or right border of the cell, at a distance that is the sum of the control's <xref:System.Windows.Forms.Control.Margin%2A> property and the panel's <xref:System.Windows.Forms.Control.Padding%2A> property. If both the <xref:System.Windows.Forms.AnchorStyles.Left> and <xref:System.Windows.Forms.AnchorStyles.Right> values are set, the control will be sized to the width of the cell, with the <xref:System.Windows.Forms.Control.Margin%2A> and <xref:System.Windows.Forms.Control.Padding%2A> values taken into account. The behavior for <xref:System.Windows.Forms.AnchorStyles.Top> and <xref:System.Windows.Forms.AnchorStyles.Bottom> anchoring is analogous. For more information, see [How to: Anchor and Dock Child Controls in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control). + + If you need a child control to mimic the default anchoring behavior in other container controls, you can adjust the <xref:System.Windows.Forms.Control.Margin%2A> and <xref:System.Windows.Forms.Control.Padding%2A> properties to maintain a constant distance between the control's border and the cell's border. + + Setting the values of both the `Column` and `Row` properties of a child control to -1 will cause the control to be moved to the first empty cell in the <xref:System.Windows.Forms.TableLayoutPanel> control. The empty cell will be chosen in a search that proceeds from left to right and from top to bottom. This order is dependent on the culture, so it will behave correctly in right-to-left (RTL) layouts. + > [!NOTE] -> Only controls that have the <xref:System.Windows.Forms.Control.Visible%2A> property set to `true` participate in the <xref:System.Windows.Forms.TableLayoutPanel> control's layout computations. - - Also see: - -- [How to: Align and Stretch a Control in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-align-and-stretch-a-control-in-a-tablelayoutpanel-control) - -- [How to: Span Rows and Columns in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-span-rows-and-columns-in-a-tablelayoutpanel-control) - -- [How to: Edit Columns and Rows in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-edit-columns-and-rows-in-a-tablelayoutpanel-control) - -- [Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel](/dotnet/framework/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-a-tablelayoutpanel) - - - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.TableLayoutPanel.OnCellPaint%2A> method to create a custom appearance for a cell. - +> Only controls that have the <xref:System.Windows.Forms.Control.Visible%2A> property set to `true` participate in the <xref:System.Windows.Forms.TableLayoutPanel> control's layout computations. + + Also see: + +- [How to: Align and Stretch a Control in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-align-and-stretch-a-control-in-a-tablelayoutpanel-control) + +- [How to: Span Rows and Columns in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-span-rows-and-columns-in-a-tablelayoutpanel-control) + +- [How to: Edit Columns and Rows in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-edit-columns-and-rows-in-a-tablelayoutpanel-control) + +- [Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel](/dotnet/desktop/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-a-tablelayoutpanel) + + + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.TableLayoutPanel.OnCellPaint%2A> method to create a custom appearance for a cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.FlowLayoutPanel" /> <altmember cref="T:System.Windows.Forms.TableLayoutSettings" /> - <related type="Article" href="/dotnet/framework/winforms/controls/best-practices-for-the-tablelayoutpanel-control">Best Practices for the TableLayoutPanel Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control">How to: Anchor and Dock Child Controls in a TableLayoutPanel Control</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-design-a-windows-forms-layout-that-responds-well-to-localization">How to: Design a Windows Forms Layout that Responds Well to Localization</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-resizable-windows-form-for-data-entry">How to: Create a Resizable Windows Form for Data Entry</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/best-practices-for-the-tablelayoutpanel-control">Best Practices for the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control">How to: Anchor and Dock Child Controls in a TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-design-a-windows-forms-layout-that-responds-well-to-localization">How to: Design a Windows Forms Layout that Responds Well to Localization</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-resizable-windows-form-for-data-entry">How to: Create a Resizable Windows Form for Data Entry</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -169,11 +169,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor sets the <xref:System.Windows.Forms.TableLayoutPanel.BorderStyle%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> properties to their default values. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor sets the <xref:System.Windows.Forms.TableLayoutPanel.BorderStyle%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, and <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> properties to their default values. + ]]></format> </remarks> </Docs> @@ -256,18 +256,18 @@ <summary>Gets or sets the style of the cell borders.</summary> <value>One of the <see cref="T:System.Windows.Forms.TableLayoutPanelCellBorderStyle" /> values describing the style of all the cell borders in the table. The default is <see cref="F:System.Windows.Forms.TableLayoutPanelCellBorderStyle.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - + <format type="text/markdown"><![CDATA[ + ## Remarks Setting this value causes the panel to redraw itself and its contents. -## Examples - The following code example sets the value of the <xref:System.Windows.Forms.TableLayoutPanel.BorderStyle%2A> property depending on the selected <xref:System.Windows.Forms.RadioButton>. - +## Examples + The following code example sets the value of the <xref:System.Windows.Forms.TableLayoutPanel.BorderStyle%2A> property depending on the selected <xref:System.Windows.Forms.RadioButton>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">.NET 6 and later versions only: The property value is not valid for the enumeration type.</exception> @@ -308,21 +308,21 @@ Setting this value causes the panel to redraw itself and its contents. <Docs> <summary>Occurs when the cell is redrawn.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TableLayoutPanel.CellPaint> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TableLayoutPanel> named `TableLayoutPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TableLayoutPanel.CellPaint> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TableLayoutPanel.CellPaint> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TableLayoutPanel> named `TableLayoutPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TableLayoutPanel.CellPaint> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet561"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet561"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet561"::: + ]]></format> </remarks> </Docs> @@ -363,17 +363,17 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets or sets the maximum number of columns allowed in the table.</summary> <value>The maximum number of columns in the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> control. The default is 0.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks Setting the <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> property does not create columns or allocate any backing memory. Memory allocation occurs when the columns are created, so you can set this property to <xref:System.Int32.MaxValue>. - - Setting this property causes the table to undergo another layout operation. - You can specify both the <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property allows for such growth. If the value of <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> is 0, the panel will grow by adding rows, and if the value of <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> is 0, the panel will grow by adding columns. Specifying panel growth with the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property is preferred to setting <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> to 0, however. - - Controls can be added or deleted from the table using the <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property. - + Setting this property causes the table to undergo another layout operation. + + You can specify both the <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property allows for such growth. If the value of <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> is 0, the panel will grow by adding rows, and if the value of <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> is 0, the panel will grow by adding columns. Specifying panel growth with the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property is preferred to setting <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> to 0, however. + + Controls can be added or deleted from the table using the <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TableLayoutPanel.GrowStyle" /> @@ -430,32 +430,32 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets a collection of column styles for the <see cref="T:System.Windows.Forms.TableLayoutPanel" />.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutColumnStyleCollection" /> containing a <see cref="T:System.Windows.Forms.ColumnStyle" /> for each column in the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TableLayoutPanel.ColumnStyles%2A> property to access the style properties of specific columns. You can use members of the <xref:System.Windows.Forms.ColumnStyle> class to set the characteristics of individual columns in the table. - - When the <xref:System.Windows.Forms.TableLayoutPanel> control arranges its columns, it assigns priorities to each <xref:System.Windows.Forms.ColumnStyle> in the following order: - -1. Columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.Absolute> are considered first, and their fixed widths are allocated. - -2. Columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.AutoSize> are sized to their contents. - -3. Remaining space is divided among columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.Percent>. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.ColumnStyle> properties of each column when a <xref:System.Windows.Forms.Button> is clicked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TableLayoutPanel.ColumnStyles%2A> property to access the style properties of specific columns. You can use members of the <xref:System.Windows.Forms.ColumnStyle> class to set the characteristics of individual columns in the table. + + When the <xref:System.Windows.Forms.TableLayoutPanel> control arranges its columns, it assigns priorities to each <xref:System.Windows.Forms.ColumnStyle> in the following order: + +1. Columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.Absolute> are considered first, and their fixed widths are allocated. + +2. Columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.AutoSize> are sized to their contents. + +3. Remaining space is divided among columns with <xref:System.Windows.Forms.ColumnStyle> set to <xref:System.Windows.Forms.SizeType.Percent>. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.ColumnStyle> properties of each column when a <xref:System.Windows.Forms.Button> is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ColumnStyle" /> <altmember cref="P:System.Windows.Forms.TableLayoutPanel.RowStyles" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> </Docs> </Member> <Member MemberName="Controls"> @@ -498,19 +498,19 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets the collection of controls contained within the <see cref="T:System.Windows.Forms.TableLayoutPanel" />.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutControlCollection" /> containing the controls associated with the current <see cref="T:System.Windows.Forms.TableLayoutPanel" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property contains all of the controls associated with the table, including controls that may not be currently displayed because of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, or <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> limitations. - - - -## Examples - The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property contains all of the controls associated with the table, including controls that may not be currently displayed because of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A>, <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A>, or <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> limitations. + + + +## Examples + The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.Controls" /> @@ -654,25 +654,25 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Returns the column position of the specified child control.</summary> <returns>The column position of the specified child control, or -1 if the position of <paramref name="control" /> is determined by <see cref="P:System.Windows.Forms.TableLayoutPanel.LayoutEngine" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If `control` spans two or more columns, the <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> method will return the lowest column index. - - The column position value is zero based, so you can use it as an index for the array returned by <xref:System.Windows.Forms.TableLayoutPanel.GetColumnWidths%2A>. - - This method is called by the `Column` property, which the panel adds to its child controls at design time. - - To get the actual position of `control`, even when its position is determined by <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>, call the <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method. - - - -## Examples - The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel> and finds the column index for each control using the <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If `control` spans two or more columns, the <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> method will return the lowest column index. + + The column position value is zero based, so you can use it as an index for the array returned by <xref:System.Windows.Forms.TableLayoutPanel.GetColumnWidths%2A>. + + This method is called by the `Column` property, which the panel adds to its child controls at design time. + + To get the actual position of `control`, even when its position is determined by <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>, call the <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method. + + + +## Examples + The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel> and finds the column index for each control using the <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -724,21 +724,21 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Returns the number of columns spanned by the specified child control.</summary> <returns>The number of columns spanned by the child control. The default is 1.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Column spanning is often useful for positioning a control that is considerably wider than its peers. - - This method is called by the `ColumnSpan` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Column spanning is often useful for positioning a control that is considerably wider than its peers. + + This method is called by the `ColumnSpan` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TableLayoutPanel.SetColumnSpan(System.Windows.Forms.Control,System.Int32)" /> @@ -819,19 +819,19 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Returns the child control occupying the specified position.</summary> <returns>The child control occupying the specified cell; otherwise, <see langword="null" /> if no control exists at the specified column and row, or if the control has its <see cref="P:System.Windows.Forms.Control.Visible" /> property set to <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The column and row position values are zero based. - - - -## Examples - The following code example enumerates all the cell positions in the <xref:System.Windows.Forms.TableLayoutPanel> by looping through the columns and rows given by <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, and then calling the <xref:System.Windows.Forms.TableLayoutPanel.GetControlFromPosition%2A> method to retrieve the control at each cell. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The column and row position values are zero based. + + + +## Examples + The following code example enumerates all the cell positions in the <xref:System.Windows.Forms.TableLayoutPanel> by looping through the columns and rows given by <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A>, and then calling the <xref:System.Windows.Forms.TableLayoutPanel.GetControlFromPosition%2A> method to retrieve the control at each cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">Either <paramref name="column" /> or <paramref name="row" /> (or both) is less than 0.</exception> @@ -870,11 +870,11 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets the <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the row and the column of the cell that contains the control.</summary> <returns>A <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the cell position.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method returns the actual current position of `control`, even if its position is determined by the <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>. This method takes into account the entire <xref:System.Windows.Forms.TableLayoutPanel> control state, including column or row spanning and when the <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A> has placed a control with its `Column` and `Row` properties set to -1. This is equivalent to the situation in which <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> and <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> return -1. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method returns the actual current position of `control`, even if its position is determined by the <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>. This method takes into account the entire <xref:System.Windows.Forms.TableLayoutPanel> control state, including column or row spanning and when the <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A> has placed a control with its `Column` and `Row` properties set to -1. This is equivalent to the situation in which <xref:System.Windows.Forms.TableLayoutPanel.GetColumn%2A> and <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> return -1. + ]]></format> </remarks> </Docs> @@ -927,25 +927,25 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Returns the row position of the specified child control.</summary> <returns>The row position of <paramref name="control" />, or -1 if the position of <paramref name="control" /> is determined by <see cref="P:System.Windows.Forms.TableLayoutPanel.LayoutEngine" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If `control` spans two or more rows, the <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> method will return the lowest row index. - - The row position value is zero based, so you can use it as an index for the array returned by <xref:System.Windows.Forms.TableLayoutPanel.GetRowHeights%2A>. - - This method is called by the `Row` property, which the panel adds to its child controls at design time. - - To get the actual position of `control`, even when its position is determined by <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>, call the <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method. - - - -## Examples - The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel> and finds the row index for each using the <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If `control` spans two or more rows, the <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> method will return the lowest row index. + + The row position value is zero based, so you can use it as an index for the array returned by <xref:System.Windows.Forms.TableLayoutPanel.GetRowHeights%2A>. + + This method is called by the `Row` property, which the panel adds to its child controls at design time. + + To get the actual position of `control`, even when its position is determined by <xref:System.Windows.Forms.TableLayoutPanel.LayoutEngine%2A>, call the <xref:System.Windows.Forms.TableLayoutPanel.GetPositionFromControl%2A> method. + + + +## Examples + The following code example enumerates all the child controls in the <xref:System.Windows.Forms.TableLayoutPanel> and finds the row index for each using the <xref:System.Windows.Forms.TableLayoutPanel.GetRow%2A> method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -1036,21 +1036,21 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Returns the number of rows spanned by the specified child control.</summary> <returns>The number of rows spanned by the child control. The default is 1.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Row spanning is often useful for positioning a control that is considerably taller than its peers. - - This method is called by the `RowSpan` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Row spanning is often useful for positioning a control that is considerably taller than its peers. + + This method is called by the `RowSpan` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TableLayoutPanel.SetRowSpan(System.Windows.Forms.Control,System.Int32)" /> @@ -1091,22 +1091,22 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets or sets a value indicating whether the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> control should expand to accommodate new cells when all existing cells are occupied.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutPanelGrowStyle" /> indicating the growth scheme. The default is <see cref="F:System.Windows.Forms.TableLayoutPanelGrowStyle.AddRows" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.TableLayoutPanel> control expands downward by adding rows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.TableLayoutPanel> control expands downward by adding rows. + > [!NOTE] -> If an attempt is made to add a control to a full <xref:System.Windows.Forms.TableLayoutPanel> control, and the value of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> is <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize>, then an <xref:System.ArgumentException> is thrown. - - - -## Examples - The following code example sets the value of the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property depending on the selected <xref:System.Windows.Forms.RadioButton>. At run time, when the user clicks on the button labeled **Test GrowStyle**, a <xref:System.Windows.Forms.Button> control is added to the <xref:System.Windows.Forms.TableLayoutPanel> control. If the <xref:System.Windows.Forms.TableLayoutPanel> control is full, it expands by adding a row or column, or it raises an exception, depending on the value of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A>. - +> If an attempt is made to add a control to a full <xref:System.Windows.Forms.TableLayoutPanel> control, and the value of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> is <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize>, then an <xref:System.ArgumentException> is thrown. + + + +## Examples + The following code example sets the value of the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property depending on the selected <xref:System.Windows.Forms.RadioButton>. At run time, when the user clicks on the button labeled **Test GrowStyle**, a <xref:System.Windows.Forms.Button> control is added to the <xref:System.Windows.Forms.TableLayoutPanel> control. If the <xref:System.Windows.Forms.TableLayoutPanel> control is full, it expands by adding a row or column, or it raises an exception, depending on the value of <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet7"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentException">The property value is invalid for the <see cref="T:System.Windows.Forms.TableLayoutPanelGrowStyle" /> enumeration.</exception> @@ -1228,14 +1228,14 @@ Setting this value causes the panel to redraw itself and its contents. <param name="e">A <see cref="T:System.Windows.Forms.TableLayoutCellPaintEventArgs" /> that provides data for the event.</param> <summary>Receives a call when the cell should be refreshed.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.TableLayoutPanel.OnCellPaint%2A> method to create a custom appearance for a cell. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.TableLayoutPanel.OnCellPaint%2A> method to create a custom appearance for a cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: + ]]></format> </remarks> </Docs> @@ -1275,11 +1275,11 @@ Setting this value causes the panel to redraw itself and its contents. <param name="levent">A <see cref="T:System.Windows.Forms.LayoutEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Layout" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> @@ -1351,17 +1351,17 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets or sets the maximum number of rows allowed in the table.</summary> <value>The maximum number of rows in the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> control. The default is 0.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks Setting the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> property does not create rows or allocate any backing memory. Memory allocation occurs when the rows are created, so you can set this property to <xref:System.Int32.MaxValue>. - - Setting this property causes the table to undergo another layout operation. - You can specify both the <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property allows for such growth. If the value of <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> is 0, the panel will grow by adding rows, and if the value of <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> is 0, the panel will grow by adding columns. Specifying panel growth with the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property is preferred to setting <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> to 0, however. - - Controls can be added or deleted from the table using the <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property. - + Setting this property causes the table to undergo another layout operation. + + You can specify both the <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> and the <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property allows for such growth. If the value of <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> is 0, the panel will grow by adding rows, and if the value of <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> is 0, the panel will grow by adding columns. Specifying panel growth with the <xref:System.Windows.Forms.TableLayoutPanel.GrowStyle%2A> property is preferred to setting <xref:System.Windows.Forms.TableLayoutPanel.RowCount%2A> or <xref:System.Windows.Forms.TableLayoutPanel.ColumnCount%2A> to 0, however. + + Controls can be added or deleted from the table using the <xref:System.Windows.Forms.TableLayoutPanel.Controls%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TableLayoutPanel.GrowStyle" /> @@ -1418,32 +1418,32 @@ Setting this value causes the panel to redraw itself and its contents. <summary>Gets a collection of row styles for the <see cref="T:System.Windows.Forms.TableLayoutPanel" />.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutRowStyleCollection" /> containing a <see cref="T:System.Windows.Forms.RowStyle" /> for each row in the <see cref="T:System.Windows.Forms.TableLayoutPanel" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TableLayoutPanel.RowStyles%2A> property to access the style properties of specific rows. You can use members of the <xref:System.Windows.Forms.RowStyle> class to set the characteristics of individual rows in the table. - - When the <xref:System.Windows.Forms.TableLayoutPanel> control arranges its rows, it assigns priorities to each <xref:System.Windows.Forms.RowStyle> in the following order: - -1. Rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.Absolute> are considered first, and their fixed heights are allocated. - -2. Rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.AutoSize> are sized to their contents. - -3. Remaining space is divided among rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.Percent>. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.RowStyle> properties of each row when a <xref:System.Windows.Forms.Button> is clicked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TableLayoutPanel.RowStyles%2A> property to access the style properties of specific rows. You can use members of the <xref:System.Windows.Forms.RowStyle> class to set the characteristics of individual rows in the table. + + When the <xref:System.Windows.Forms.TableLayoutPanel> control arranges its rows, it assigns priorities to each <xref:System.Windows.Forms.RowStyle> in the following order: + +1. Rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.Absolute> are considered first, and their fixed heights are allocated. + +2. Rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.AutoSize> are sized to their contents. + +3. Remaining space is divided among rows with <xref:System.Windows.Forms.RowStyle> set to <xref:System.Windows.Forms.SizeType.Percent>. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.RowStyle> properties of each row when a <xref:System.Windows.Forms.Button> is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet9"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.RowStyle" /> <altmember cref="P:System.Windows.Forms.TableLayoutPanel.ColumnStyles" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> </Docs> </Member> <Member MemberName="ScaleControl"> @@ -1516,11 +1516,11 @@ Setting this value causes the panel to redraw itself and its contents. <param name="dy">The ratio by which to scale the control vertically.</param> <summary>Performs the work of scaling the entire panel and any child controls.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel.ScaleCore%2A> method uses the `dx` and `dy` parameter values to scale both the height and width of the panel independently. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel.ScaleCore%2A> method uses the `dx` and `dy` parameter values to scale both the height and width of the panel independently. + ]]></format> </remarks> </Docs> @@ -1589,23 +1589,23 @@ Setting this value causes the panel to redraw itself and its contents. <param name="column">The column to which <paramref name="control" /> will be moved.</param> <summary>Sets the column position of the specified child control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method moves the control to another column in the <xref:System.Windows.Forms.TableLayoutPanel>. The columns and rows have zero-based indexes. Setting the column position to -1 specifies that the control will flow to the first empty cell. - - This method reapplies the table layout to all controls in the <xref:System.Windows.Forms.TableLayoutPanel>. - - This method is called by the `Column` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method to swap two controls contained within a <xref:System.Windows.Forms.TableLayoutPanel> control. The example assumes a <xref:System.Windows.Forms.TableLayoutPanel> control with at least two rows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method moves the control to another column in the <xref:System.Windows.Forms.TableLayoutPanel>. The columns and rows have zero-based indexes. Setting the column position to -1 specifies that the control will flow to the first empty cell. + + This method reapplies the table layout to all controls in the <xref:System.Windows.Forms.TableLayoutPanel>. + + This method is called by the `Column` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method to swap two controls contained within a <xref:System.Windows.Forms.TableLayoutPanel> control. The example assumes a <xref:System.Windows.Forms.TableLayoutPanel> control with at least two rows. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet12"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TableLayoutPanel.SetRow(System.Windows.Forms.Control,System.Int32)" /> @@ -1644,21 +1644,21 @@ Setting this value causes the panel to redraw itself and its contents. <param name="value">The number of columns to span.</param> <summary>Sets the number of columns spanned by the child control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Column spanning is often useful for positioning a control that is considerably wider than its peers. - - This method is called by the `ColumnSpan` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Column spanning is often useful for positioning a control that is considerably wider than its peers. + + This method is called by the `ColumnSpan` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetColumnSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetColumnSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -1700,23 +1700,23 @@ Setting this value causes the panel to redraw itself and its contents. <param name="row">The row to which <paramref name="control" /> will be moved.</param> <summary>Sets the row position of the specified child control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutPanel.SetRow%2A> method moves the control to another row in the <xref:System.Windows.Forms.TableLayoutPanel> control. The columns and rows have zero-based indexes. Setting the row position to -1 specifies that the control will flow to the first empty cell. - - This method reapplies the table layout to all controls in the <xref:System.Windows.Forms.TableLayoutPanel>. - - This method is called by the `Row` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method to swap two controls contained within a <xref:System.Windows.Forms.TableLayoutPanel> control. The example assumes a <xref:System.Windows.Forms.TableLayoutPanel> control with at least two rows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutPanel.SetRow%2A> method moves the control to another row in the <xref:System.Windows.Forms.TableLayoutPanel> control. The columns and rows have zero-based indexes. Setting the row position to -1 specifies that the control will flow to the first empty cell. + + This method reapplies the table layout to all controls in the <xref:System.Windows.Forms.TableLayoutPanel>. + + This method is called by the `Row` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.SetColumn%2A> method to swap two controls contained within a <xref:System.Windows.Forms.TableLayoutPanel> control. The example assumes a <xref:System.Windows.Forms.TableLayoutPanel> control with at least two rows. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet13"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TableLayoutPanel.SetRow(System.Windows.Forms.Control,System.Int32)" /> @@ -1755,21 +1755,21 @@ Setting this value causes the panel to redraw itself and its contents. <param name="value">The number of rows to span.</param> <summary>Sets the number of rows spanned by the child control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Row spanning is often useful for positioning a control that is considerably taller than its peers. - - This method is called by the `RowSpan` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Row spanning is often useful for positioning a control that is considerably taller than its peers. + + This method is called by the `RowSpan` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TableLayoutPanel.GetRowSpan%2A> and <xref:System.Windows.Forms.TableLayoutPanel.SetRowSpan%2A> methods to set the width of a <xref:System.Windows.Forms.Button> control in a <xref:System.Windows.Forms.TableLayoutPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException"> @@ -1814,11 +1814,11 @@ Setting this value causes the panel to redraw itself and its contents. <returns> <see langword="true" /> if this object can provide extender properties to the specified object; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.TableLayoutPanel> instance is cast to an <xref:System.ComponentModel.IExtenderProvider> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.TableLayoutPanel> instance is cast to an <xref:System.ComponentModel.IExtenderProvider> interface. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml b/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml index 3ef22e689c9..b86eea3a342 100644 --- a/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml +++ b/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml @@ -37,14 +37,14 @@ <Docs> <summary>Represents a cell in a <see cref="T:System.Windows.Forms.TableLayoutPanel" />.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutPanel" /> @@ -78,14 +78,14 @@ <param name="row">The row position of the cell.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> class.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutPanel" /> diff --git a/xml/System.Windows.Forms/TableLayoutSettings.xml b/xml/System.Windows.Forms/TableLayoutSettings.xml index f17f55cb04a..98e6470ccc8 100644 --- a/xml/System.Windows.Forms/TableLayoutSettings.xml +++ b/xml/System.Windows.Forms/TableLayoutSettings.xml @@ -41,27 +41,27 @@ <Docs> <summary>Collects the characteristics associated with table layouts.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Layout.LayoutEngine" /> @@ -102,21 +102,21 @@ <summary>Gets or sets the maximum number of columns allowed in the table layout.</summary> <value>The maximum number of columns allowed in the table layout. The default is 0.</value> <remarks> - <format type="text/markdown"><. - + + Setting this property causes the table to undergo another layout operation. + + + +## Examples + The following example shows how to initialize a <xref:System.Windows.Forms.TableLayoutSettings> object for a <xref:System.Windows.Forms.TableLayoutPanel> control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The property value is less than 0.</exception> @@ -160,11 +160,11 @@ <summary>Gets the collection of styles used to determine the look and feel of the table layout columns.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutColumnStyleCollection" /> that contains the column styles for the layout table.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TableLayoutSettings.ColumnStyles%2A> property to access the style properties of specific columns. The order of the styles in a <xref:System.Windows.Forms.TableLayoutColumnStyleCollection?displayProperty=nameWithType> matches the order of the corresponding columns in the layout table. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TableLayoutSettings.ColumnStyles%2A> property to access the style properties of specific columns. The order of the styles in a <xref:System.Windows.Forms.TableLayoutColumnStyleCollection?displayProperty=nameWithType> matches the order of the corresponding columns in the layout table. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutColumnStyleCollection" /> @@ -208,14 +208,14 @@ <summary>Gets the <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the row and the column of the cell.</summary> <returns>A <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the cell position.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -403,11 +403,11 @@ <summary>Gets or sets a value indicating how the table layout should expand to accommodate new cells when all existing cells are occupied.</summary> <value>One of the <see cref="T:System.Windows.Forms.TableLayoutPanelGrowStyle" /> values. The default is <see cref="F:System.Windows.Forms.TableLayoutPanelGrowStyle.AddRows" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutSettings.GrowStyle%2A> property determines how the layout engine should add a new cell to a full table. This property can be set to <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.AddRows> to indicate that rows should be added, <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.AddColumns> to indicate that columns should be added, or <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize> to disallow expansion. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutSettings.GrowStyle%2A> property determines how the layout engine should add a new cell to a full table. This property can be set to <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.AddRows> to indicate that rows should be added, <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.AddColumns> to indicate that columns should be added, or <xref:System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize> to disallow expansion. + ]]></format> </remarks> <exception cref="T:System.ArgumentException">.NET Framework only: The property value is not valid for the enumeration type.</exception> @@ -449,15 +449,15 @@ <summary>Gets the current table layout engine.</summary> <value>The <see cref="T:System.Windows.Forms.Layout.LayoutEngine" /> currently being used.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutSettings.LayoutEngine%2A> property is typically used in two contexts: - -- A container that uses a table layout. - -- A control contained within a table layout container, such as a button contained in a cell of a <xref:System.Windows.Forms.TableLayoutPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutSettings.LayoutEngine%2A> property is typically used in two contexts: + +- A container that uses a table layout. + +- A control contained within a table layout container, such as a button contained in a cell of a <xref:System.Windows.Forms.TableLayoutPanel>. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Layout.LayoutEngine" /> @@ -496,21 +496,21 @@ <summary>Gets or sets the maximum number of rows allowed in the table layout.</summary> <value>The maximum number of rows allowed in the table layout. The default is 0.</value> <remarks> - <format type="text/markdown"><. - + + Setting this property causes the table to undergo another layout operation. + + + +## Examples + The following example shows how to initialize a <xref:System.Windows.Forms.TableLayoutSettings> object for a <xref:System.Windows.Forms.TableLayoutPanel> control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The property value is less than 0.</exception> @@ -554,11 +554,11 @@ <summary>Gets the collection of styles used to determine the look and feel of the table layout rows.</summary> <value>A <see cref="T:System.Windows.Forms.TableLayoutRowStyleCollection" /> that contains the row styles for the layout table.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TableLayoutSettings.RowStyles%2A> property to access the style properties of specific rows. The order of the styles in a <xref:System.Windows.Forms.TableLayoutRowStyleCollection?displayProperty=nameWithType> matches the order of the corresponding rows in the layout table. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TableLayoutSettings.RowStyles%2A> property to access the style properties of specific rows. The order of the styles in a <xref:System.Windows.Forms.TableLayoutRowStyleCollection?displayProperty=nameWithType> matches the order of the corresponding rows in the layout table. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutRowStyleCollection" /> @@ -603,14 +603,14 @@ <param name="cellPosition">A <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the cell position.</param> <summary>Sets the <see cref="T:System.Windows.Forms.TableLayoutPanelCellPosition" /> that represents the row and the column of the cell.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -804,11 +804,11 @@ <param name="context">The destination context of the serialization.</param> <summary>For a description of this member, see <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.TableLayoutSettings> instance is cast to an <xref:System.Runtime.Serialization.ISerializable> interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.TableLayoutSettings> instance is cast to an <xref:System.Runtime.Serialization.ISerializable> interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TableLayoutPanel" /> diff --git a/xml/System.Windows.Forms/TableLayoutStyle.xml b/xml/System.Windows.Forms/TableLayoutStyle.xml index cd6f3de777d..f94929d1600 100644 --- a/xml/System.Windows.Forms/TableLayoutStyle.xml +++ b/xml/System.Windows.Forms/TableLayoutStyle.xml @@ -37,13 +37,13 @@ <Docs> <summary>Implements the basic functionality that represents the appearance and behavior of a table layout.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TableLayoutStyle> class is a common base class for the <xref:System.Windows.Forms.ColumnStyle> and <xref:System.Windows.Forms.RowStyle> classes, which describe the appearance and behavior of columns and rows, respectively, in a <xref:System.Windows.Forms.TableLayoutPanel>. - - The series of styles that represent the current columns and rows in the current table layout are aggregated in a <xref:System.Windows.Forms.TableLayoutColumnStyleCollection> and <xref:System.Windows.Forms.TableLayoutRowStyleCollection>, respectively. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TableLayoutStyle> class is a common base class for the <xref:System.Windows.Forms.ColumnStyle> and <xref:System.Windows.Forms.RowStyle> classes, which describe the appearance and behavior of columns and rows, respectively, in a <xref:System.Windows.Forms.TableLayoutPanel>. + + The series of styles that represent the current columns and rows in the current table layout are aggregated in a <xref:System.Windows.Forms.TableLayoutColumnStyleCollection> and <xref:System.Windows.Forms.TableLayoutRowStyleCollection>, respectively. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ColumnStyle" /> @@ -52,7 +52,7 @@ <altmember cref="T:System.Windows.Forms.TableLayoutStyleCollection" /> <altmember cref="T:System.Windows.Forms.TableLayoutColumnStyleCollection" /> <altmember cref="T:System.Windows.Forms.TableLayoutRowStyleCollection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -83,11 +83,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TableLayoutStyle" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This is the parameterless constructor for the <xref:System.Windows.Forms.TableLayoutStyle> class. It effectively sets the <xref:System.Windows.Forms.SizeType> property to <xref:System.Windows.Forms.SizeType.AutoSize>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This is the parameterless constructor for the <xref:System.Windows.Forms.TableLayoutStyle> class. It effectively sets the <xref:System.Windows.Forms.SizeType> property to <xref:System.Windows.Forms.SizeType.AutoSize>. + ]]></format> </remarks> </Docs> @@ -128,21 +128,21 @@ <summary>Gets or sets a flag indicating how a row or column should be sized relative to its containing table.</summary> <value>One of the <see cref="T:System.Windows.Forms.SizeType" /> values that specifies how rows or columns of user interface (UI) elements should be sized relative to their container. The default is <see cref="F:System.Windows.Forms.SizeType.AutoSize" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The table layout engine sizes a row or column in one of the following ways: - -- In an absolute number of pixels (<xref:System.Windows.Forms.SizeType.Absolute>). - -- As a percentage of the parent container (<xref:System.Windows.Forms.SizeType.Percent>). - -- To share equal space with its peers (<xref:System.Windows.Forms.SizeType.AutoSize>). - + <format type="text/markdown"><![CDATA[ + +## Remarks + The table layout engine sizes a row or column in one of the following ways: + +- In an absolute number of pixels (<xref:System.Windows.Forms.SizeType.Absolute>). + +- As a percentage of the parent container (<xref:System.Windows.Forms.SizeType.Percent>). + +- To share equal space with its peers (<xref:System.Windows.Forms.SizeType.AutoSize>). + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.SizeType" /> - <related type="Article" href="/dotnet/framework/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/autosize-behavior-in-the-tablelayoutpanel-control">AutoSize Behavior in the TableLayoutPanel Control</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/TextBoxRenderer.xml b/xml/System.Windows.Forms/TextBoxRenderer.xml index 23ed0631a93..35221b67959 100644 --- a/xml/System.Windows.Forms/TextBoxRenderer.xml +++ b/xml/System.Windows.Forms/TextBoxRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a text box control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method to draw a text box. The control also allows the user to select one of the <xref:System.Windows.Forms.TextFormatFlags> values to apply to the text box text. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method to draw a text box. The control also allows the user to select one of the <xref:System.Windows.Forms.TextFormatFlags> values to apply to the text box text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -99,21 +99,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TextBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box control in the specified state and bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -168,21 +168,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TextBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box control in the specified state and bounds, and with the specified text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -239,21 +239,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TextBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box control in the specified state and bounds, and with the specified text and text bounds.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -304,21 +304,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TextBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box control in the specified state and bounds, and with the specified text and text formatting.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -371,30 +371,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TextBoxState" /> values that specifies the visual state of the text box.</param> <summary>Draws a text box control in the specified state and bounds, and with the specified text, text bounds, and text formatting.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Drawing.Rectangle%2CSystem.Windows.Forms.TextFormatFlags%2CSystem.Windows.Forms.VisualStyles.TextBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a text box. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TextBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property returns `true`. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%28System.Drawing.Graphics%2CSystem.Drawing.Rectangle%2CSystem.String%2CSystem.Drawing.Font%2CSystem.Drawing.Rectangle%2CSystem.Windows.Forms.TextFormatFlags%2CSystem.Windows.Forms.VisualStyles.TextBoxState%29> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a text box. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TextBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -425,20 +425,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TextBoxRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TextBoxRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TextBoxRenderer.DrawTextBox%2A> method. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TextBoxRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/TextFormatFlags.xml b/xml/System.Windows.Forms/TextFormatFlags.xml index 94761327274..4bfe84c16f2 100644 --- a/xml/System.Windows.Forms/TextFormatFlags.xml +++ b/xml/System.Windows.Forms/TextFormatFlags.xml @@ -28,22 +28,22 @@ <Docs> <summary>Specifies the display and layout information for text strings.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `TextFormatFlags` enumeration is used by the <xref:System.Windows.Forms.TextRenderer> when drawing and measuring text. The <xref:System.Windows.Forms.TextRenderer> does not support adding tab stops to drawn text, although you can expand existing tab stops using the `ExpandTabs` flag. - - - -## Examples - The following example demonstrates how to use the `TextFormatFlags` enumeration. To run this example, paste the following code into a Windows Form. Call `RenderText6` from the form's <xref:System.Windows.Forms.Control.Paint> event handler, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `TextFormatFlags` enumeration is used by the <xref:System.Windows.Forms.TextRenderer> when drawing and measuring text. The <xref:System.Windows.Forms.TextRenderer> does not support adding tab stops to drawn text, although you can expand existing tab stops using the `ExpandTabs` flag. + + + +## Examples + The following example demonstrates how to use the `TextFormatFlags` enumeration. To run this example, paste the following code into a Windows Form. Call `RenderText6` from the form's <xref:System.Windows.Forms.Control.Paint> event handler, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextFormatFlags/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextRendererExamples/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextRendererExamples/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/using-fonts-and-text">Using Fonts and Text</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/using-fonts-and-text">Using Fonts and Text</related> </Docs> <Members> <Member MemberName="Bottom"> diff --git a/xml/System.Windows.Forms/ToolStrip.xml b/xml/System.Windows.Forms/ToolStrip.xml index 70932ee8486..accc213546a 100644 --- a/xml/System.Windows.Forms/ToolStrip.xml +++ b/xml/System.Windows.Forms/ToolStrip.xml @@ -109,7 +109,7 @@ <altmember cref="T:System.Windows.Forms.ToolStripItem" /> <altmember cref="T:System.Windows.Forms.ToolStripDropDown" /> <altmember cref="T:System.Windows.Forms.ToolStripContainer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -334,7 +334,7 @@ <altmember cref="E:System.Windows.Forms.Control.DragEnter" /> <altmember cref="E:System.Windows.Forms.Control.DragLeave" /> <altmember cref="E:System.Windows.Forms.Control.DragDrop" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-enable-reordering-of-toolstrip-items-at-run-time-in-windows-forms">How to: Enable Reordering of ToolStrip Items at Run Time in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-enable-reordering-of-toolstrip-items-at-run-time-in-windows-forms">How to: Enable Reordering of ToolStrip Items at Run Time in Windows Forms</related> </Docs> </Member> <Member MemberName="AllowMerge"> @@ -965,7 +965,7 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-manage-toolstrip-overflow-in-windows-forms">How to: Manage ToolStrip Overflow in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-manage-toolstrip-overflow-in-windows-forms">How to: Manage ToolStrip Overflow in Windows Forms</related> </Docs> </Member> <Member MemberName="CausesValidation"> @@ -1859,7 +1859,7 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-define-z-ordering-of-docked-toolstrip-controls">How to: Define Z-Ordering of Docked ToolStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-define-z-ordering-of-docked-toolstrip-controls">How to: Define Z-Ordering of Docked ToolStrip Controls</related> </Docs> </Member> <Member MemberName="EndDrag"> @@ -2167,7 +2167,7 @@ <summary>Returns the item located at the specified point in the client area of the <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <returns>The <see cref="T:System.Windows.Forms.ToolStripItem" /> at the specified location, or <see langword="null" /> if the <see cref="T:System.Windows.Forms.ToolStripItem" /> is not found.</returns> <remarks>To be added.</remarks> - <related type="Article" href="/dotnet/framework/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> + <related type="Article" href="/dotnet/desktop/winforms/windows-forms-coordinates">Windows Forms Coordinates</related> </Docs> </Member> <Member MemberName="GetItemAt"> @@ -4313,10 +4313,10 @@ <block subset="none" type="overrides"> <para>When overriding <see cref="M:System.Windows.Forms.ToolStrip.OnRendererChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.ToolStrip.OnRendererChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para> </block> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> </Docs> </Member> <Member MemberName="OnRightToLeftChanged"> @@ -4783,10 +4783,10 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> </Docs> </Member> <Member MemberName="RendererChanged"> @@ -4836,10 +4836,10 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> </Docs> </Member> <Member MemberName="RenderMode"> @@ -4885,10 +4885,10 @@ <exception cref="T:System.NotSupportedException"> <see cref="T:System.Windows.Forms.ToolStripRenderMode" /> is set to <see cref="F:System.Windows.Forms.ToolStripRenderMode.Custom" /> without the <see cref="P:System.Windows.Forms.ToolStrip.Renderer" /> property being assigned to a new instance of <see cref="T:System.Windows.Forms.ToolStripRenderer" />.</exception> <altmember cref="P:System.Windows.Forms.ToolStrip.Renderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/create-and-set-a-custom-renderer-for-the-toolstrip-control-in-wf">How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-at-run-time">How to: Set the ToolStrip Renderer at Run Time</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-set-the-toolstrip-renderer-for-an-application">How to: Set the ToolStrip Renderer for an Application</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control">How to: Create a Professionally Styled ToolStrip Control</related> </Docs> </Member> <Member MemberName="RescaleConstantsForDpi"> @@ -5333,7 +5333,7 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-use-tooltips-in-toolstrip-controls">How to: Use ToolTips in ToolStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-use-tooltips-in-toolstrip-controls">How to: Use ToolTips in ToolStrip Controls</related> </Docs> </Member> <Member MemberName="Stretch"> diff --git a/xml/System.Windows.Forms/ToolStripButton.xml b/xml/System.Windows.Forms/ToolStripButton.xml index 2030f0d0791..ea16df920c0 100644 --- a/xml/System.Windows.Forms/ToolStripButton.xml +++ b/xml/System.Windows.Forms/ToolStripButton.xml @@ -33,29 +33,29 @@ <Docs> <summary>Represents a selectable <see cref="T:System.Windows.Forms.ToolStripItem" /> that can contain text and images.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use <xref:System.Windows.Forms.ToolStripButton> to create a toolbar button that supports both text and images. Use the <xref:System.Windows.Forms.ToolStripItem.ImageAlign%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ToolStripItem.TextAlign%2A?displayProperty=nameWithType> properties to get or set the positioning of <xref:System.Windows.Forms.ToolStripButton> images and text. - - You can display a <xref:System.Windows.Forms.ToolStripButton> with various border styles, and you can use it to represent and activate operational states. You can also define it to have the focus by default. - - Although <xref:System.Windows.Forms.ToolStripButton> replaces and extends the <xref:System.Windows.Forms.ToolBarButton> control of previous versions, <xref:System.Windows.Forms.ToolBarButton> is retained for both backward compatibility and future use. - - - -## Examples - The following code example shows two <xref:System.Windows.Forms.ToolStripButton> controls with both image and text on a <xref:System.Windows.Forms.ToolStrip>. Clicking the **New**<xref:System.Windows.Forms.ToolStripButton> displays a message box. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use <xref:System.Windows.Forms.ToolStripButton> to create a toolbar button that supports both text and images. Use the <xref:System.Windows.Forms.ToolStripItem.ImageAlign%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ToolStripItem.TextAlign%2A?displayProperty=nameWithType> properties to get or set the positioning of <xref:System.Windows.Forms.ToolStripButton> images and text. + + You can display a <xref:System.Windows.Forms.ToolStripButton> with various border styles, and you can use it to represent and activate operational states. You can also define it to have the focus by default. + + Although <xref:System.Windows.Forms.ToolStripButton> replaces and extends the <xref:System.Windows.Forms.ToolBarButton> control of previous versions, <xref:System.Windows.Forms.ToolBarButton> is retained for both backward compatibility and future use. + + + +## Examples + The following code example shows two <xref:System.Windows.Forms.ToolStripButton> controls with both image and text on a <xref:System.Windows.Forms.ToolStrip>. Clicking the **New**<xref:System.Windows.Forms.ToolStripButton> displays a message box. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripButton/vb/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripButton/vb/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStrip" /> <altmember cref="T:System.Windows.Forms.MenuStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -118,11 +118,11 @@ <param name="image">The image to display on the <see cref="T:System.Windows.Forms.ToolStripButton" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripButton" /> class that displays the specified image.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays only an image on the <xref:System.Windows.Forms.ToolStripButton>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays only an image on the <xref:System.Windows.Forms.ToolStripButton>. + ]]></format> </remarks> </Docs> @@ -154,11 +154,11 @@ <param name="text">The text to display on the <see cref="T:System.Windows.Forms.ToolStripButton" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripButton" /> class that displays the specified text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays only text on the <xref:System.Windows.Forms.ToolStripButton>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays only text on the <xref:System.Windows.Forms.ToolStripButton>. + ]]></format> </remarks> </Docs> @@ -192,11 +192,11 @@ <param name="image">The image to display on the <see cref="T:System.Windows.Forms.ToolStripButton" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripButton" /> class that displays the specified text and image.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays both an image and text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays both an image and text. + ]]></format> </remarks> </Docs> @@ -232,11 +232,11 @@ <param name="onClick">An event handler that raises the <see cref="E:System.Windows.Forms.ToolStripItem.Click" /> event.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripButton" /> class that displays the specified text and image and that raises the <see cref="E:System.Windows.Forms.ToolStripItem.Click" /> event.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays both an image and text and raises the <xref:System.Windows.Forms.ToolStripItem.Click> event when clicked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> that displays both an image and text and raises the <xref:System.Windows.Forms.ToolStripItem.Click> event when clicked. + ]]></format> </remarks> </Docs> @@ -274,11 +274,11 @@ <param name="name">The name of the <see cref="T:System.Windows.Forms.ToolStripButton" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripButton" /> class with the specified name that displays the specified text and image and that raises the <see cref="E:System.Windows.Forms.ToolStripItem.Click" /> event.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> with the specified name that displays both an image and text and raises the <xref:System.Windows.Forms.ToolStripItem.Click> event when clicked. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this constructor to create a <xref:System.Windows.Forms.ToolStripButton> with the specified name that displays both an image and text and raises the <xref:System.Windows.Forms.ToolStripItem.Click> event when clicked. + ]]></format> </remarks> </Docs> @@ -316,19 +316,19 @@ <value> <see langword="true" /> if default <see cref="T:System.Windows.Forms.ToolTip" /> text is displayed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripButton.AutoToolTip%2A> property to `false` to display custom <xref:System.Windows.Forms.ToolStripItem.ToolTipText%2A> on a <xref:System.Windows.Forms.ToolStripItem>. - - - -## Examples - The following code example turns off the automatic <xref:System.Windows.Forms.ToolTip> text for a <xref:System.Windows.Forms.ToolStripButton> and sets custom <xref:System.Windows.Forms.ToolStripItem.ToolTipText%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripButton.AutoToolTip%2A> property to `false` to display custom <xref:System.Windows.Forms.ToolStripItem.ToolTipText%2A> on a <xref:System.Windows.Forms.ToolStripItem>. + + + +## Examples + The following code example turns off the automatic <xref:System.Windows.Forms.ToolTip> text for a <xref:System.Windows.Forms.ToolStripButton> and sets custom <xref:System.Windows.Forms.ToolStripItem.ToolTipText%2A>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStrip/ShowItemToolTips/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripToolTip/vb/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripToolTip/vb/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -392,15 +392,15 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripButton" /> is pressed in or not pressed in; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]></format> </remarks> </Docs> @@ -431,20 +431,20 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripButton.Checked" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. - + <format type="text/markdown"><. + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]></format> </remarks> </Docs> @@ -490,15 +490,15 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripButton" /> should automatically appear pressed in and not pressed in when clicked; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.ToolStripButton.CheckOnClick%2A> property to `true` and uses the <xref:System.Windows.Forms.ToolStripButton.Checked%2A> property in a <xref:System.Windows.Forms.ToolStripButton.CheckedChanged> event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]></format> </remarks> </Docs> @@ -539,11 +539,11 @@ <summary>Gets or sets a value indicating whether the <see cref="T:System.Windows.Forms.ToolStripButton" /> is in the pressed or not pressed state by default, or is in an indeterminate state.</summary> <value>One of the <see cref="T:System.Windows.Forms.CheckState" /> values. The default is <see langword="Unchecked" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripButton.CheckState%2A> to `Indeterminate` when you do not want to set a default state. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripButton.CheckState%2A> to `Indeterminate` when you do not want to set a default state. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.CheckState" /> values.</exception> @@ -575,21 +575,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripButton.CheckState" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripButton.CheckStateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripButton> named `ToolStripButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripButton.CheckStateChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripButton.CheckStateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripButton> named `ToolStripButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripButton.CheckStateChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet568"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet568"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet568"::: + ]]></format> </remarks> </Docs> @@ -627,14 +627,14 @@ <summary>Creates a new accessibility object for the <see cref="T:System.Windows.Forms.ToolStripButton" />.</summary> <returns>A new <see cref="T:System.Windows.Forms.AccessibleObject" /> for the <see cref="T:System.Windows.Forms.ToolStripButton" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you do not explicitly call <xref:System.Windows.Forms.ToolStripButton.CreateAccessibilityInstance%2A>, it will be called when the <xref:System.Windows.Forms.ToolStripItem.AccessibilityObject%2A> property is referenced. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you do not explicitly call <xref:System.Windows.Forms.ToolStripButton.CreateAccessibilityInstance%2A>, it will be called when the <xref:System.Windows.Forms.ToolStripItem.AccessibilityObject%2A> property is referenced. + > [!NOTE] -> To get or set the <xref:System.Windows.Forms.ToolStripItem.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set the <xref:System.Windows.Forms.ToolStripItem.AccessibilityObject%2A> property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.Control.CreateAccessibilityInstance" /> @@ -730,13 +730,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripButton.CheckedChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripButton.OnCheckedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripButton.OnCheckedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -773,13 +773,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripButton.CheckStateChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripButton.OnCheckStateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripButton.OnCheckStateChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -816,13 +816,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Click" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripButton.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripButton.OnClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -859,13 +859,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripButton.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripButton.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> diff --git a/xml/System.Windows.Forms/ToolStripComboBox.xml b/xml/System.Windows.Forms/ToolStripComboBox.xml index 4bb6c344873..67f8c5a7908 100644 --- a/xml/System.Windows.Forms/ToolStripComboBox.xml +++ b/xml/System.Windows.Forms/ToolStripComboBox.xml @@ -37,31 +37,31 @@ <Docs> <summary>Represents a <see cref="T:System.Windows.Forms.ToolStripComboBox" /> that is properly rendered in a <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripComboBox> is the <xref:System.Windows.Forms.ComboBox> optimized for hosting in a <xref:System.Windows.Forms.ToolStrip>. A subset of the hosted control's properties and events are exposed at the <xref:System.Windows.Forms.ToolStripComboBox> level, but the underlying <xref:System.Windows.Forms.ComboBox> control is fully accessible through the <xref:System.Windows.Forms.ToolStripComboBox.ComboBox%2A> property. - - A <xref:System.Windows.Forms.ToolStripComboBox> displays an editing field combined with a <xref:System.Windows.Forms.ListBox>, allowing the user to select from the list or to enter new text. By default, a <xref:System.Windows.Forms.ToolStripComboBox> displays an edit field with a hidden drop-down list. The <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property determines the style of combo box to display. You can enter a value that allows for a simple drop-down, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down list box, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a <xref:System.Windows.Forms.ListBox> control. - - To add objects to the list at run time, assign an array of object references with the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method. The list then displays the default string value for each object. You can add individual objects with the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method. - - In addition to display and selection functionality, the <xref:System.Windows.Forms.ToolStripComboBox> also provides features that enable you to efficiently add items to the <xref:System.Windows.Forms.ToolStripComboBox> and to find text within the items of the list. The <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> and <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> methods enable you to add a large number of items to the <xref:System.Windows.Forms.ToolStripComboBox> without the control being repainted each time an item is added to the list. The <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> and <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> methods enable you to search for an item in the list that contains a specific search string. - - Use the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property to get or set the current item in the drop-down list, and use the <xref:System.Windows.Forms.ToolStripComboBox.SelectedItem%2A> property to get or set a reference to the current item in the drop-down list. - - - -## Examples - The following code example demonstrates a <xref:System.Windows.Forms.ToolStripComboBox> with various property settings, including automatic completion. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripComboBox> is the <xref:System.Windows.Forms.ComboBox> optimized for hosting in a <xref:System.Windows.Forms.ToolStrip>. A subset of the hosted control's properties and events are exposed at the <xref:System.Windows.Forms.ToolStripComboBox> level, but the underlying <xref:System.Windows.Forms.ComboBox> control is fully accessible through the <xref:System.Windows.Forms.ToolStripComboBox.ComboBox%2A> property. + + A <xref:System.Windows.Forms.ToolStripComboBox> displays an editing field combined with a <xref:System.Windows.Forms.ListBox>, allowing the user to select from the list or to enter new text. By default, a <xref:System.Windows.Forms.ToolStripComboBox> displays an edit field with a hidden drop-down list. The <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property determines the style of combo box to display. You can enter a value that allows for a simple drop-down, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down list box, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a <xref:System.Windows.Forms.ListBox> control. + + To add objects to the list at run time, assign an array of object references with the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method. The list then displays the default string value for each object. You can add individual objects with the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method. + + In addition to display and selection functionality, the <xref:System.Windows.Forms.ToolStripComboBox> also provides features that enable you to efficiently add items to the <xref:System.Windows.Forms.ToolStripComboBox> and to find text within the items of the list. The <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> and <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> methods enable you to add a large number of items to the <xref:System.Windows.Forms.ToolStripComboBox> without the control being repainted each time an item is added to the list. The <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> and <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> methods enable you to search for an item in the list that contains a specific search string. + + Use the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property to get or set the current item in the drop-down list, and use the <xref:System.Windows.Forms.ToolStripComboBox.SelectedItem%2A> property to get or set a reference to the current item in the drop-down list. + + + +## Examples + The following code example demonstrates a <xref:System.Windows.Forms.ToolStripComboBox> with various property settings, including automatic completion. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -217,23 +217,23 @@ <summary>Gets or sets the custom string collection to use when the <see cref="P:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource" /> property is set to <see cref="F:System.Windows.Forms.AutoCompleteSource.CustomSource" />.</summary> <value>An <see cref="T:System.Windows.Forms.AutoCompleteStringCollection" /> that contains the strings.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripComboBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripComboBox> controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property to <xref:System.Windows.Forms.AutoCompleteSource.CustomSource> in order to use <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A>. - - You must use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripComboBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripComboBox> controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property to <xref:System.Windows.Forms.AutoCompleteSource.CustomSource> in order to use <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A>. + + You must use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode" /> @@ -280,19 +280,19 @@ <summary>Gets or sets a value that indicates the text completion behavior of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.AutoCompleteMode" /> values. The default is <see cref="F:System.Windows.Forms.AutoCompleteMode.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> property to get or set the behavior of automatic completion. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> property to get or set the behavior of automatic completion. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteMode%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource" /> @@ -339,19 +339,19 @@ <summary>Gets or sets the source of complete strings used for automatic completion.</summary> <value>One of the <see cref="T:System.Windows.Forms.AutoCompleteSource" /> values. The default is <see cref="F:System.Windows.Forms.AutoCompleteSource.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property to get or set automatic completion strings. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property to get or set automatic completion strings. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.AutoCompleteSource%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripComboBox.AutoCompleteCustomSource" /> @@ -407,11 +407,11 @@ <summary>This property is not relevant to this class.</summary> <value>The background image displayed in the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -460,11 +460,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the values of <see cref="T:System.Windows.Forms.ImageLayout" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -495,13 +495,13 @@ <Docs> <summary>Maintains performance when items are added to the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> one at a time.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method prevents the control from painting until the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method is called. - - The preferred way to add items to the <xref:System.Windows.Forms.ToolStripComboBox> is to use the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method through the <xref:System.Windows.Forms.ToolStripComboBox.Items%2A> property of the <xref:System.Windows.Forms.ToolStripComboBox>. This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method, you can use the <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ToolStripComboBox> each time an item is added to the list. Once you have completed the task of adding items to the list, call the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ToolStripComboBox> to repaint. This way of adding items can prevent flicker during the drawing of the <xref:System.Windows.Forms.ToolStripComboBox> when a large number of items are being added to the list. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method prevents the control from painting until the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method is called. + + The preferred way to add items to the <xref:System.Windows.Forms.ToolStripComboBox> is to use the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method through the <xref:System.Windows.Forms.ToolStripComboBox.Items%2A> property of the <xref:System.Windows.Forms.ToolStripComboBox>. This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method, you can use the <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ToolStripComboBox> each time an item is added to the list. Once you have completed the task of adding items to the list, call the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ToolStripComboBox> to repaint. This way of adding items can prevent flicker during the drawing of the <xref:System.Windows.Forms.ToolStripComboBox> when a large number of items are being added to the list. + ]]></format> </remarks> </Docs> @@ -546,11 +546,11 @@ <summary>Gets a <see cref="T:System.Windows.Forms.ComboBox" /> in which the user can enter text, along with a list from which the user can select.</summary> <value>A <see cref="T:System.Windows.Forms.ComboBox" /> for a <see cref="T:System.Windows.Forms.ToolStrip" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.ComboBox%2A> property to get <xref:System.Windows.Forms.ComboBox> properties, methods, and events that have not been wrapped into <xref:System.Windows.Forms.ToolStripComboBox>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.ComboBox%2A> property to get <xref:System.Windows.Forms.ComboBox> properties, methods, and events that have not been wrapped into <xref:System.Windows.Forms.ToolStripComboBox>. + ]]></format> </remarks> </Docs> @@ -603,11 +603,11 @@ <summary>Gets the default spacing, in pixels, between the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> and an adjacent item.</summary> <value>A <see cref="T:System.Windows.Forms.Padding" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Override the <xref:System.Windows.Forms.ToolStripComboBox.DefaultMargin%2A> property to configure a default size for your <xref:System.Windows.Forms.ToolStripComboBox>. This is more efficient than setting the size in the constructor. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Override the <xref:System.Windows.Forms.ToolStripComboBox.DefaultMargin%2A> property to configure a default size for your <xref:System.Windows.Forms.ToolStripComboBox>. This is more efficient than setting the size in the constructor. + ]]></format> </remarks> </Docs> @@ -638,13 +638,13 @@ <summary>Gets the default size of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The default <see cref="T:System.Drawing.Size" /> of the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> in pixels. The default size is 100 x 20 pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!NOTE] -> In order to maintain better performance, you should not set the <xref:System.Drawing.Size> of a <xref:System.Windows.Forms.ToolStripComboBox> in its constructor. The preferred method is to override the <xref:System.Windows.Forms.ToolStripComboBox.DefaultSize%2A> property. - +> In order to maintain better performance, you should not set the <xref:System.Drawing.Size> of a <xref:System.Windows.Forms.ToolStripComboBox> in its constructor. The preferred method is to override the <xref:System.Windows.Forms.ToolStripComboBox.DefaultSize%2A> property. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -692,11 +692,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -733,21 +733,21 @@ <Docs> <summary>Occurs when the drop-down portion of a <see cref="T:System.Windows.Forms.ToolStripComboBox" /> is shown.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDown> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDown> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDown> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet578"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet578"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet578"::: + ]]></format> </remarks> </Docs> @@ -784,21 +784,21 @@ <Docs> <summary>Occurs when the drop-down portion of the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> has closed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDownClosed> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDownClosed> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDownClosed> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDownClosed> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet579"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet579"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet579"::: + ]]></format> </remarks> </Docs> @@ -843,19 +843,19 @@ <summary>Gets or sets the height, in pixels, of the drop-down portion box of a <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The height, in pixels, of the drop-down box.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property resets the <xref:System.Windows.Forms.ToolStripComboBox.IntegralHeight%2A> property to `false`. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property resets the <xref:System.Windows.Forms.ToolStripComboBox.IntegralHeight%2A> property to `false`. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -900,19 +900,19 @@ <summary>Gets or sets a value specifying the style of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.ComboBoxStyle" /> values. The default is <see cref="F:System.Windows.Forms.ComboBoxStyle.DropDown" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property controls the interface that is presented to the user. You can enter a value that allows for a simple drop-down list box, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a <xref:System.Windows.Forms.ListBox> control. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property controls the interface that is presented to the user. You can enter a value that allows for a simple drop-down list box, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a <xref:System.Windows.Forms.ListBox> control. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyle%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -949,21 +949,21 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.ToolStripComboBox.DropDownStyle" /> property has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyleChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.DropDownStyleChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet580"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet580"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet580"::: + ]]></format> </remarks> </Docs> @@ -994,19 +994,19 @@ <summary>Gets or sets the width, in pixels, of the drop-down portion of a <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The width, in pixels, of the drop-down box.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.DropDownWidth%2A> property to get or set the width of the drop-down portion of a <xref:System.Windows.Forms.ToolStripComboBox>. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownWidth%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.DropDownWidth%2A> property to get or set the width of the drop-down portion of a <xref:System.Windows.Forms.ToolStripComboBox>. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.DropDownWidth%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1080,11 +1080,11 @@ <Docs> <summary>Resumes painting the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> control after painting is suspended by the <see cref="M:System.Windows.Forms.ToolStripComboBox.BeginUpdate" /> method.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The preferred way to add items to the <xref:System.Windows.Forms.ToolStripComboBox> is to use the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method through the <xref:System.Windows.Forms.ToolStripComboBox.Items%2A> property of the <xref:System.Windows.Forms.ToolStripComboBox>. This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method, you can use the <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ToolStripComboBox> each time an item is added to the list. Once you have completed the task of adding items to the list, call the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ToolStripComboBox> to repaint. This way of adding items can prevent flicker during the drawing of the <xref:System.Windows.Forms.ToolStripComboBox> when a large number of items are being added to the list. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The preferred way to add items to the <xref:System.Windows.Forms.ToolStripComboBox> is to use the <xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A> method through the <xref:System.Windows.Forms.ToolStripComboBox.Items%2A> property of the <xref:System.Windows.Forms.ToolStripComboBox>. This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method, you can use the <xref:System.Windows.Forms.ToolStripComboBox.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ToolStripComboBox> each time an item is added to the list. Once you have completed the task of adding items to the list, call the <xref:System.Windows.Forms.ToolStripComboBox.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ToolStripComboBox> to repaint. This way of adding items can prevent flicker during the drawing of the <xref:System.Windows.Forms.ToolStripComboBox> when a large number of items are being added to the list. + ]]></format> </remarks> </Docs> @@ -1129,11 +1129,11 @@ <summary>Finds the first item in the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> that starts with the specified string.</summary> <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text, and returning the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to perform a search for an exact word match instead of a partial match, use the <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text, and returning the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to perform a search for an exact word match instead of a partial match, use the <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> method. + ]]></format> </remarks> </Docs> @@ -1171,11 +1171,11 @@ <summary>Finds the first item after the given index which starts with the given string.</summary> <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use this method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to perform a search for an exact word match instead of a partial match, use the <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use this method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to perform a search for an exact word match instead of a partial match, use the <xref:System.Windows.Forms.ToolStripComboBox.FindStringExact%2A> method. + ]]></format> </remarks> </Docs> @@ -1220,11 +1220,11 @@ <summary>Finds the first item in the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> that exactly matches the specified string.</summary> <returns>The zero-based index of the first item found; -1 if no match is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to search for a partial match instead of the exact word, use the <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the <xref:System.Windows.Forms.ToolStripComboBox>, use <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to search for a partial match instead of the exact word, use the <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method. + ]]></format> </remarks> </Docs> @@ -1262,11 +1262,11 @@ <summary>Finds the first item after the specified index that exactly matches the specified string.</summary> <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of exact text in the <xref:System.Windows.Forms.ToolStripComboBox>, use this method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to search for a partial match instead of the exact word, use the <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The search performed by this method is not case-sensitive. The `s` parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of exact text in the <xref:System.Windows.Forms.ToolStripComboBox>, use this method to specify a starting index within the <xref:System.Windows.Forms.ToolStripComboBox>. If you want to search for a partial match instead of the exact word, use the <xref:System.Windows.Forms.ToolStripComboBox.FindString%2A> method. + ]]></format> </remarks> </Docs> @@ -1307,27 +1307,27 @@ <summary>Gets or sets the appearance of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>One of the values of <see cref="T:System.Windows.Forms.FlatStyle" />. The options are <see cref="F:System.Windows.Forms.FlatStyle.Flat" />, <see cref="F:System.Windows.Forms.FlatStyle.Popup" />, <see cref="F:System.Windows.Forms.FlatStyle.Standard" />, and <see cref="F:System.Windows.Forms.FlatStyle.System" />. The default is <see cref="F:System.Windows.Forms.FlatStyle.Popup" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property to get or set the display style of the <xref:System.Windows.Forms.ToolStripComboBox>. - - Starting with the .NET Framework 4.5.2, if the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.Flat> or <xref:System.Windows.Forms.FlatStyle.Popup>, the drop-down arrow may be resized. Resizing is determined by the system DPI setting when the app.config file contains the following entry: - -``` -<appSettings> - <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" /> -</appSettings> -``` - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property to get or set the display style of the <xref:System.Windows.Forms.ToolStripComboBox>. + + Starting with the .NET Framework 4.5.2, if the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.Flat> or <xref:System.Windows.Forms.FlatStyle.Popup>, the drop-down arrow may be resized. Resizing is determined by the system DPI setting when the app.config file contains the following entry: + +``` +<appSettings> + <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" /> +</appSettings> +``` + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.FlatStyle%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1433,13 +1433,13 @@ <value> <see langword="true" /> if the list portion can contain only complete items; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When this property is set to `true`, the control automatically resizes to ensure that an item is not partially displayed. If you want to maintain the original size of the <xref:System.Windows.Forms.ToolStripComboBox> based on the space requirements of your form, set this property to `false`. If the <xref:System.Windows.Forms.ToolStripComboBox> does not contain any items, this property has no effect. - - Setting the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property resets the <xref:System.Windows.Forms.ToolStripComboBox.IntegralHeight%2A> property to `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When this property is set to `true`, the control automatically resizes to ensure that an item is not partially displayed. If you want to maintain the original size of the <xref:System.Windows.Forms.ToolStripComboBox> based on the space requirements of your form, set this property to `false`. If the <xref:System.Windows.Forms.ToolStripComboBox> does not contain any items, this property has no effect. + + Setting the <xref:System.Windows.Forms.ToolStripComboBox.DropDownHeight%2A> property resets the <xref:System.Windows.Forms.ToolStripComboBox.IntegralHeight%2A> property to `false`. + ]]></format> </remarks> </Docs> @@ -1530,19 +1530,19 @@ <summary>Gets or sets the maximum number of items to be shown in the drop-down portion of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The maximum number of items in the drop-down portion. The minimum for this property is 1 and the maximum is 100.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripComboBox.MaxDropDownItems%2A> property to get or set the maximum number of items to show in the drop-down portion of the <xref:System.Windows.Forms.ToolStripComboBox>. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.MaxDropDownItems%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripComboBox.MaxDropDownItems%2A> property to get or set the maximum number of items to show in the drop-down portion of the <xref:System.Windows.Forms.ToolStripComboBox>. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.MaxDropDownItems%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1614,13 +1614,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripComboBox.DropDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1657,13 +1657,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripComboBox.DropDownClosed" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDownClosed%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDownClosed%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1700,13 +1700,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripComboBox.DropDownStyleChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDownStyleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnDropDownStyleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1743,13 +1743,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnSelectedIndexChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnSelectedIndexChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1786,15 +1786,15 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ComboBox.SelectionChangeCommitted" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnSelectionChangeCommitted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnSelectionChangeCommitted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1832,17 +1832,17 @@ <param name="control">The control from which to subscribe events.</param> <summary>Subscribes events from the specified control.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnSubscribeControlEvents%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnSubscribeControlEvents%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1879,13 +1879,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripComboBox.TextUpdate" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnTextUpdate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnTextUpdate%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1923,15 +1923,15 @@ <param name="control">The control from which to unsubscribe events.</param> <summary>Unsubscribes events from the specified control.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripComboBox.OnUnsubscribeControlEvents%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripComboBox.OnUnsubscribeControlEvents%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1970,17 +1970,17 @@ <param name="length">The number of characters to select.</param> <summary>Selects a range of text in the editable portion of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you want to set the start position to the first character in the control's text, set the `start` parameter to zero. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you want to set the start position to the first character in the control's text, set the `start` parameter to zero. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. + ]]></format> </remarks> - <exception cref="T:System.ArgumentException">The <paramref name="start" /> is less than zero. - - -or- - + <exception cref="T:System.ArgumentException">The <paramref name="start" /> is less than zero. + + -or- + <paramref name="start" /> minus <paramref name="length" /> is less than zero.</exception> </Docs> </Member> @@ -2052,13 +2052,13 @@ <summary>Gets or sets the index specifying the currently selected item.</summary> <value>A zero-based index of the currently selected item. A value of negative one (-1) is returned if no item is selected.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property indicates the zero-based index of the currently selected item in the combo box list. Setting a new index raises the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. - - **Note** To deselect the currently selected item, set the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> to -1. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property indicates the zero-based index of the currently selected item in the combo box list. Setting a new index raises the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. + + **Note** To deselect the currently selected item, set the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> to -1. + ]]></format> </remarks> </Docs> @@ -2095,21 +2095,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripComboBox.SelectedIndex" /> property has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndexChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet581"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet581"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet581"::: + ]]></format> </remarks> </Docs> @@ -2163,11 +2163,11 @@ <summary>Gets or sets currently selected item in the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The object that is the currently selected item or <see langword="null" /> if there is no currently selected item.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When you set the <xref:System.Windows.Forms.ToolStripComboBox.SelectedItem%2A> property to an object, the <xref:System.Windows.Forms.ToolStripComboBox> attempts to make that object the currently selected one in the list. If the object is found in the list, it is displayed in the edit portion of the <xref:System.Windows.Forms.ToolStripComboBox> and the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property is set to the corresponding index. If the object does not exist in the list, the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property is left at its current value. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When you set the <xref:System.Windows.Forms.ToolStripComboBox.SelectedItem%2A> property to an object, the <xref:System.Windows.Forms.ToolStripComboBox> attempts to make that object the currently selected one in the list. If the object is found in the list, it is displayed in the edit portion of the <xref:System.Windows.Forms.ToolStripComboBox> and the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property is set to the corresponding index. If the object does not exist in the list, the <xref:System.Windows.Forms.ToolStripComboBox.SelectedIndex%2A> property is left at its current value. + ]]></format> </remarks> </Docs> @@ -2212,11 +2212,11 @@ <summary>Gets or sets the text that is selected in the editable portion of a <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>A string that represents the currently selected text in the combo box. If <see cref="P:System.Windows.Forms.ToolStripComboBox.DropDownStyle" /> is set to <see langword="DropDownList" />, the return value is an empty string ("").</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can assign text to this property to change the text currently selected in the combo box. If no text is currently selected in the combo box, this property returns a zero-length string. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can assign text to this property to change the text currently selected in the combo box. If no text is currently selected in the combo box, this property returns a zero-length string. + ]]></format> </remarks> </Docs> @@ -2261,11 +2261,11 @@ <summary>Gets or sets the number of characters selected in the editable portion of the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The number of characters selected in the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to determine whether any characters are currently selected in the combo box control before performing operations on the selected text. When the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is set to a value that is larger than the number of characters within the text of the control, the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is set to the entire length of text within the control minus the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property (if any value is specified for the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property). - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to determine whether any characters are currently selected in the combo box control before performing operations on the selected text. When the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is set to a value that is larger than the number of characters within the text of the control, the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is set to the entire length of text within the control minus the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property (if any value is specified for the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property). + ]]></format> </remarks> </Docs> @@ -2310,11 +2310,11 @@ <summary>Gets or sets the starting index of text selected in the <see cref="T:System.Windows.Forms.ToolStripComboBox" />.</summary> <value>The zero-based index of the first character in the string of the current text selection.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position is placed after the last character. When text is selected in the text box control, changing this property can release the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property. If the remaining text in the control after the position indicated by the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property is less than the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property, the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is automatically decreased. The value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property never causes an increase in the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position is placed after the last character. When text is selected in the text box control, changing this property can release the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property. If the remaining text in the control after the position indicated by the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property is less than the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property, the value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property is automatically decreased. The value of the <xref:System.Windows.Forms.ToolStripComboBox.SelectionStart%2A> property never causes an increase in the <xref:System.Windows.Forms.ToolStripComboBox.SelectionLength%2A> property. + ]]></format> </remarks> </Docs> @@ -2352,19 +2352,19 @@ <value> <see langword="true" /> if the combo box is sorted; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property specifies whether the <xref:System.Windows.Forms.ToolStripComboBox> sorts existing entries and add new entries to the appropriate sorted position in the list. You can use this property to automatically sort items in a <xref:System.Windows.Forms.ToolStripComboBox>. As items are added to a sorted <xref:System.Windows.Forms.ToolStripComboBox>, the items are moved to the appropriate location in the sorted list. When you set the property to `false`, new items are added to the end of the existing list. The sort is case-insensitive and in alphabetically ascending order. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.Sorted%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property specifies whether the <xref:System.Windows.Forms.ToolStripComboBox> sorts existing entries and add new entries to the appropriate sorted position in the list. You can use this property to automatically sort items in a <xref:System.Windows.Forms.ToolStripComboBox>. As items are added to a sorted <xref:System.Windows.Forms.ToolStripComboBox>, the items are moved to the appropriate location in the sorted list. When you set the property to `false`, new items are added to the end of the existing list. The sort is case-insensitive and in alphabetically ascending order. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripComboBox> properties, including the <xref:System.Windows.Forms.ToolStripComboBox.Sorted%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2401,21 +2401,21 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.ToolStripComboBox" /> text has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.TextUpdate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.TextUpdate> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripComboBox.TextUpdate> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripComboBox> named `ToolStripComboBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripComboBox.TextUpdate> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet582"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet582"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet582"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripContainer.xml b/xml/System.Windows.Forms/ToolStripContainer.xml index d3b0eb6878e..3eff9dc6e68 100644 --- a/xml/System.Windows.Forms/ToolStripContainer.xml +++ b/xml/System.Windows.Forms/ToolStripContainer.xml @@ -45,27 +45,27 @@ <Docs> <summary>Provides panels on each side of the form and a central panel that can hold one or more controls.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripContainer> is similar to <xref:System.Windows.Forms.SplitContainer>. It uses four docked side panels (instances of <xref:System.Windows.Forms.ToolStripPanel>) and one central panel (an instance of <xref:System.Windows.Forms.ToolStripContentPanel>) to create a typical arrangement. You cannot remove the side panels, but you can hide them by setting their respective <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanelVisible%2A>, <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanelVisible%2A>, <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanelVisible%2A>, and <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanelVisible%2A> properties to `false`. By default, each of these properties is `true` at design time. Also at design time, the <xref:System.Windows.Forms.ToolStripContainer> appears with its top panel already expanded. You can neither remove nor hide the <xref:System.Windows.Forms.ToolStripContentPanel>. You can arrange one or more <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls in the side panels, and you can use the central panel for other controls. The <xref:System.Windows.Forms.ToolStripContentPanel> also provides a way to get renderer support into the body of your form for a consistent appearance. - - <xref:System.Windows.Forms.ToolStripContainer> does not support Multiple Document Interface (MDI) applications. Use <xref:System.Windows.Forms.ToolStripPanel> for MDI applications. - - - -## Examples - The following code example demonstrates adding a <xref:System.Windows.Forms.ToolStripContainer> and a <xref:System.Windows.Forms.ToolStrip> to a Windows Forms, adding items to the <xref:System.Windows.Forms.ToolStrip>, and adding the <xref:System.Windows.Forms.ToolStrip> to the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanel%2A> of the <xref:System.Windows.Forms.ToolStripContainer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripContainer> is similar to <xref:System.Windows.Forms.SplitContainer>. It uses four docked side panels (instances of <xref:System.Windows.Forms.ToolStripPanel>) and one central panel (an instance of <xref:System.Windows.Forms.ToolStripContentPanel>) to create a typical arrangement. You cannot remove the side panels, but you can hide them by setting their respective <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanelVisible%2A>, <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanelVisible%2A>, <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanelVisible%2A>, and <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanelVisible%2A> properties to `false`. By default, each of these properties is `true` at design time. Also at design time, the <xref:System.Windows.Forms.ToolStripContainer> appears with its top panel already expanded. You can neither remove nor hide the <xref:System.Windows.Forms.ToolStripContentPanel>. You can arrange one or more <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls in the side panels, and you can use the central panel for other controls. The <xref:System.Windows.Forms.ToolStripContentPanel> also provides a way to get renderer support into the body of your form for a consistent appearance. + + <xref:System.Windows.Forms.ToolStripContainer> does not support Multiple Document Interface (MDI) applications. Use <xref:System.Windows.Forms.ToolStripPanel> for MDI applications. + + + +## Examples + The following code example demonstrates adding a <xref:System.Windows.Forms.ToolStripContainer> and a <xref:System.Windows.Forms.ToolStrip> to a Windows Forms, adding items to the <xref:System.Windows.Forms.ToolStrip>, and adding the <xref:System.Windows.Forms.ToolStrip> to the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanel%2A> of the <xref:System.Windows.Forms.ToolStripContainer>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStrip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/vb/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStrip" /> <altmember cref="T:System.Windows.Forms.MenuStrip" /> <altmember cref="T:System.Windows.Forms.StatusStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -137,11 +137,11 @@ <value> <see langword="true" /> to enable automatic scrolling; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -190,11 +190,11 @@ <summary>This property is not relevant for this class.</summary> <value>A <see cref="T:System.Drawing.Size" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -243,11 +243,11 @@ <summary>This property is not relevant for this class.</summary> <value>A <see cref="T:System.Drawing.Size" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -296,11 +296,11 @@ <summary>This property is not relevant for this class.</summary> <value>A <see cref="T:System.Drawing.Color" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -349,11 +349,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -403,11 +403,11 @@ <summary>This property is not relevant for this class.</summary> <value>TTThe background image displayed in the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -456,11 +456,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -509,11 +509,11 @@ <summary>This property is not relevant for this class.</summary> <value>The background image layout as defined in the ImageLayout enumeration.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -562,11 +562,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -619,11 +619,11 @@ <summary>Gets the bottom panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripPanel" /> representing the bottom panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. + ]]></format> </remarks> </Docs> @@ -661,11 +661,11 @@ <value> <see langword="true" /> if the bottom panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" /> is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a bottom panel. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripContainer.BottomToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a bottom panel. + ]]></format> </remarks> </Docs> @@ -715,11 +715,11 @@ <value> <see langword="true" /> if the control causes validation; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -760,11 +760,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripContainer.CausesValidation" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> @@ -817,11 +817,11 @@ <summary>Gets the center panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripContentPanel" /> representing the center panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the top, bottom, left, and right panels of the <xref:System.Windows.Forms.ToolStripContainer> to hold <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls. Controls other than <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> are automatically added to the <xref:System.Windows.Forms.ToolStripContentPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the top, bottom, left, and right panels of the <xref:System.Windows.Forms.ToolStripContainer> to hold <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls. Controls other than <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> are automatically added to the <xref:System.Windows.Forms.ToolStripContentPanel>. + ]]></format> </remarks> </Docs> @@ -871,11 +871,11 @@ <summary>This property is not relevant for this class.</summary> <value>The ContextMenuStrip associated with this control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -916,11 +916,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripContainer.ContextMenuStrip" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> @@ -969,11 +969,11 @@ <summary>This property is not relevant for this class.</summary> <value>The collection of controls contained within the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1086,11 +1086,11 @@ <summary>This property is not relevant for this class.</summary> <value>The cursor that is displayed when the mouse pointer is over the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1139,11 +1139,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1220,11 +1220,11 @@ <summary>This property is not relevant for this class.</summary> <value>The foreground color of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1273,11 +1273,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1330,11 +1330,11 @@ <summary>Gets the left panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripPanel" /> representing the left panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. + ]]></format> </remarks> </Docs> @@ -1372,11 +1372,11 @@ <value> <see langword="true" /> if the left panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" /> is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a left panel. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripContainer.LeftToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a left panel. + ]]></format> </remarks> </Docs> @@ -1441,13 +1441,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.SizeChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripContainer.OnSizeChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripContainer.OnSizeChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1503,11 +1503,11 @@ <summary>Gets the right panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripPanel" /> representing the right panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. + ]]></format> </remarks> </Docs> @@ -1545,11 +1545,11 @@ <value> <see langword="true" /> if the right panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" /> is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a right panel. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripContainer.RightToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a right panel. + ]]></format> </remarks> </Docs> @@ -1602,11 +1602,11 @@ <summary>Gets the top panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</summary> <value>A <see cref="T:System.Windows.Forms.ToolStripPanel" /> representing the top panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanel%2A> property to add <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls or move them from another <xref:System.Windows.Forms.ToolStripPanel>. + ]]></format> </remarks> </Docs> @@ -1644,11 +1644,11 @@ <value> <see langword="true" /> if the top panel of the <see cref="T:System.Windows.Forms.ToolStripContainer" /> is visible; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a top panel. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripContainer.TopToolStripPanelVisible%2A> property to `false` to use a <xref:System.Windows.Forms.ToolStripContainer> without a top panel. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripContentPanel.xml b/xml/System.Windows.Forms/ToolStripContentPanel.xml index 0701b1d5b22..79db69591a3 100644 --- a/xml/System.Windows.Forms/ToolStripContentPanel.xml +++ b/xml/System.Windows.Forms/ToolStripContentPanel.xml @@ -61,24 +61,24 @@ <Docs> <summary>Represents the center panel of a <see cref="T:System.Windows.Forms.ToolStripContainer" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the top, bottom, left, and right panels of the <xref:System.Windows.Forms.ToolStripContainer> to hold <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls. Use the <xref:System.Windows.Forms.ToolStripContentPanel> to hold controls other than these. - - - -## Examples - The following code example demonstrates adding a <xref:System.Windows.Forms.RichTextBox> to a <xref:System.Windows.Forms.ToolStripContentPanel>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the top, bottom, left, and right panels of the <xref:System.Windows.Forms.ToolStripContainer> to hold <xref:System.Windows.Forms.ToolStrip>, <xref:System.Windows.Forms.MenuStrip>, or <xref:System.Windows.Forms.StatusStrip> controls. Use the <xref:System.Windows.Forms.ToolStripContentPanel> to hold controls other than these. + + + +## Examples + The following code example demonstrates adding a <xref:System.Windows.Forms.RichTextBox> to a <xref:System.Windows.Forms.ToolStripContentPanel>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripContentPanel/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripContainer/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripContainer/VB/Form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripContainer" /> <altmember cref="T:System.Windows.Forms.ToolStrip" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -149,11 +149,11 @@ <summary>This property is not relevant to this class.</summary> <value>The edges of the container to which a control is bound and determines how a control is resized with its parent.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -195,11 +195,11 @@ <value> <see langword="true" /> to enable automatic scrolling; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -248,11 +248,11 @@ <summary>This property is not relevant to this class.</summary> <value>The distance between any child controls and the edges of the scrollable parent control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -301,11 +301,11 @@ <summary>This property is not relevant to this class.</summary> <value>The minimum size of the auto-scroll.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -355,11 +355,11 @@ <value> <see langword="true" /> to enable automatic sizing; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -408,11 +408,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -465,11 +465,11 @@ <summary>This property is not relevant to this class.</summary> <value>The mode by which the content panel automatically resizes itself.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -547,11 +547,11 @@ <value> <see langword="true" /> if the control causes validation; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -592,11 +592,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -645,11 +645,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.DockStyle" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -698,11 +698,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -733,21 +733,21 @@ <Docs> <summary>Occurs when the content panel loads.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripContentPanel.Load> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripContentPanel> named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripContentPanel.Load> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripContentPanel.Load> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripContentPanel> named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripContentPanel.Load> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet604"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet604"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet604"::: + ]]></format> </remarks> </Docs> @@ -796,11 +796,11 @@ <summary>This property is not relevant to this class.</summary> <value>The coordinates of the upper-left corner of the control relative to the upper-left corner of its container.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -849,11 +849,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -902,11 +902,11 @@ <summary>This property is not relevant to this class.</summary> <value>The size that is the upper limit that GetPreferredSize can specify.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -955,11 +955,11 @@ <summary>This property is not relevant to this class.</summary> <value>The size that is the lower limit that GetPreferredSize can specify.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1012,11 +1012,11 @@ <summary>This property is not relevant to this class.</summary> <value>The name of the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1088,13 +1088,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Form.Load" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripContentPanel.OnLoad%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripContentPanel.OnLoad%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1137,15 +1137,15 @@ <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> <summary>Renders the <see cref="T:System.Windows.Forms.ToolStripContentPanel" />.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripContentPanel.OnPaintBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripContentPanel.OnPaintBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1182,13 +1182,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripContentPanel.RendererChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripContentPanel.OnRendererChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripContentPanel.OnRendererChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1268,21 +1268,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripContentPanel.Renderer" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripContentPanel.RendererChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripContentPanel> named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripContentPanel.RendererChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripContentPanel.RendererChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripContentPanel> named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripContentPanel.RendererChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet605"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet605"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet605"::: + ]]></format> </remarks> </Docs> @@ -1359,11 +1359,11 @@ <summary>This property is not relevant to this class.</summary> <value>The tab order of the control within its container.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1404,11 +1404,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> @@ -1458,11 +1458,11 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripContentPanel" /> can be tabbed to; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1503,11 +1503,11 @@ <Docs> <summary>This event is not relevant for this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant for this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant for this class. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripControlHost.xml b/xml/System.Windows.Forms/ToolStripControlHost.xml index 04a1e4851b8..e4ec8827f0f 100644 --- a/xml/System.Windows.Forms/ToolStripControlHost.xml +++ b/xml/System.Windows.Forms/ToolStripControlHost.xml @@ -53,8 +53,8 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-wrap-a-windows-forms-control-with-toolstripcontrolhost">How To: Wrap a Windows Forms Control with ToolStripControlHost</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-wrap-a-windows-forms-control-with-toolstripcontrolhost">How To: Wrap a Windows Forms Control with ToolStripControlHost</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/ToolStripDropDown.xml b/xml/System.Windows.Forms/ToolStripDropDown.xml index 14bad68ddd5..d21ece2eae1 100644 --- a/xml/System.Windows.Forms/ToolStripDropDown.xml +++ b/xml/System.Windows.Forms/ToolStripDropDown.xml @@ -70,7 +70,7 @@ Use the <xref:System.Windows.Forms.ToolStripDropDown> to display drop-down lists </remarks> <altmember cref="T:System.Windows.Forms.ToolStripDropDownButton" /> <altmember cref="T:System.Windows.Forms.ToolStripDropDownItem" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <Member MemberName=".ctor"> diff --git a/xml/System.Windows.Forms/ToolStripDropDownButton.xml b/xml/System.Windows.Forms/ToolStripDropDownButton.xml index d9f8e9859c2..3838aeececd 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownButton.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownButton.xml @@ -33,26 +33,26 @@ <Docs> <summary>Represents a control that when clicked displays an associated <see cref="T:System.Windows.Forms.ToolStripDropDown" /> from which the user can select a single item.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripDropDownButton> looks like <xref:System.Windows.Forms.ToolStripButton>, but it shows a drop-down area when the user clicks it. Hide or show the drop-down arrow by setting the <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property. <xref:System.Windows.Forms.ToolStripDropDownButton> hosts a <xref:System.Windows.Forms.ToolStripOverflowButton> that displays items that overflow the <xref:System.Windows.Forms.ToolStrip>. - - Use the <xref:System.Windows.Forms.ToolStripDropDownButton> to activate familiar drop-down controls such as color pickers. Set the <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property to `true` to more clearly indicate to the user that further options are available on the drop-down list. - - - -## Examples - The following code example displays three <xref:System.Windows.Forms.ToolStripButton> controls when the <xref:System.Windows.Forms.ToolStripDropDownButton> is clicked. The buttons change the foreground color of the form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripDropDownButton> looks like <xref:System.Windows.Forms.ToolStripButton>, but it shows a drop-down area when the user clicks it. Hide or show the drop-down arrow by setting the <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property. <xref:System.Windows.Forms.ToolStripDropDownButton> hosts a <xref:System.Windows.Forms.ToolStripOverflowButton> that displays items that overflow the <xref:System.Windows.Forms.ToolStrip>. + + Use the <xref:System.Windows.Forms.ToolStripDropDownButton> to activate familiar drop-down controls such as color pickers. Set the <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property to `true` to more clearly indicate to the user that further options are available on the drop-down list. + + + +## Examples + The following code example displays three <xref:System.Windows.Forms.ToolStripButton> controls when the <xref:System.Windows.Forms.ToolStripDropDownButton> is clicked. The buttons change the foreground color of the form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripDropDownItem" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -86,15 +86,15 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripDropDownButton" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.ToolStripDropDownButton> control. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.ToolStripDropDownButton> control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> @@ -361,14 +361,14 @@ <summary>Creates a new accessibility object for this <see cref="T:System.Windows.Forms.ToolStripDropDownButton" /> instance.</summary> <returns>A new accessibility object for this <see cref="T:System.Windows.Forms.ToolStripDropDownButton" /> instance.</returns> <remarks> - <format type="text/markdown"><. -The <xref:System.Windows.Forms.AccessibleObject> instance returned by this method supports the UI Automation expand/collapse pattern. -However, it's only available in applications that are running on the .NET Framework 4.7.1 or later versions and are either recompiled to target the .NET Framework 4.7.1 or opt in to this .NET Framework accessibility enhancements by using an AppCompat switch. -For more information, see the [migration guide](/dotnet/framework/migration-guide/retargeting/4.7-4.7.1#windows-forms). - ]]></format> </remarks> </Docs> @@ -460,13 +460,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.MouseDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripDropDownButton.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripDropDownButton.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -503,13 +503,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.MouseLeave" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripDropDownButton.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripDropDownButton.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -577,13 +577,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.Paint" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripDropDownButton.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripDropDownButton.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -661,15 +661,15 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid <value> <see langword="true" /> to show an arrow on the <see cref="T:System.Windows.Forms.ToolStripDropDownButton" />; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates and initializes a <xref:System.Windows.Forms.ToolStripDropDownButton> control. The <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property is set to `false`. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates and initializes a <xref:System.Windows.Forms.ToolStripDropDownButton> control. The <xref:System.Windows.Forms.ToolStripDropDownButton.ShowDropDownArrow%2A> property is set to `false`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripDropDownItem.xml b/xml/System.Windows.Forms/ToolStripDropDownItem.xml index 41fe39810eb..b27881f210b 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownItem.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownItem.xml @@ -56,9 +56,9 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-insert-a-menustrip-into-an-mdi-drop-down-menu-windows-forms">How To: Insert a MenuStrip into an MDI Drop-Down Menu (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-insert-a-menustrip-into-an-mdi-drop-down-menu-windows-forms">How To: Insert a MenuStrip into an MDI Drop-Down Menu (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -585,7 +585,7 @@ ## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ToolStripDropDownItem.DropDownItems%2A> property to create a menu with sub-menus. For the complete code example, see [How to: Display Option Buttons in a MenuStrip](/dotnet/framework/winforms/controls/how-to-display-option-buttons-in-a-menustrip-windows-forms). + The following code example demonstrates how to use the <xref:System.Windows.Forms.ToolStripDropDownItem.DropDownItems%2A> property to create a menu with sub-menus. For the complete code example, see [How to: Display Option Buttons in a MenuStrip](/dotnet/desktop/winforms/controls/how-to-display-option-buttons-in-a-menustrip-windows-forms). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripDropDownItem/DropDownItems/ToolStripRadioButtonMenuItem.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolStripRadioButtonMenuItem/vb/ToolStripRadioButtonMenuItem.vb" id="Snippet200"::: diff --git a/xml/System.Windows.Forms/ToolStripDropDownMenu.xml b/xml/System.Windows.Forms/ToolStripDropDownMenu.xml index d80b7f0a7c5..092f098f247 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownMenu.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownMenu.xml @@ -45,30 +45,30 @@ <Docs> <summary>Provides basic functionality for the <see cref="T:System.Windows.Forms.ContextMenuStrip" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks <xref:System.Windows.Forms.ToolStripDropDownMenu> is the base class for <xref:System.Windows.Forms.ContextMenuStrip>, providing necessary painting and layout properties and methods. The properties of this class that you are most likely to use directly are the <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A> and <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> properties, which determine whether the shortcut menu will be able to display a check mark, an image, or both. - + <xref:System.Windows.Forms.ToolStripDropDownMenu> and <xref:System.Windows.Forms.ToolStripDropDown> replace and extend the <xref:System.Windows.Forms.Menu> control, which was removed in .NET Core 3.1. -## Examples - The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. - +## Examples + The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. + > [!IMPORTANT] -> This code is not a complete sample, so it won't compile. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). - +> This code is not a complete sample, so it won't compile. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ContextMenuStrip" /> <altmember cref="T:System.Windows.Forms.ToolStripDropDown" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -93,14 +93,14 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> class.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet62"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet62"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet62"::: + ]]></format> </remarks> </Docs> @@ -165,11 +165,11 @@ <summary>Creates a default <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> with the specified text, image, and event handler on a new <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary> <returns>A <see cref="T:System.Windows.Forms.ToolStripMenuItem" />, or a <see cref="T:System.Windows.Forms.ToolStripSeparator" /> if the <paramref name="text" /> parameter is a hyphen (-).</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripDropDownMenu.CreateDefaultItem%2A> method to add a <xref:System.Windows.Forms.ToolStripMenuItem> with commonly used characteristics to a <xref:System.Windows.Forms.ToolStripDropDownMenu>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripDropDownMenu.CreateDefaultItem%2A> method to add a <xref:System.Windows.Forms.ToolStripMenuItem> with commonly used characteristics to a <xref:System.Windows.Forms.ToolStripDropDownMenu>. + ]]></format> </remarks> </Docs> @@ -298,11 +298,11 @@ <summary>Gets or sets a value indicating how the items of <see cref="T:System.Windows.Forms.ContextMenuStrip" /> are displayed.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripLayoutStyle" /> values. The default is <see cref="F:System.Windows.Forms.ToolStripLayoutStyle.Flow" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, <xref:System.Windows.Forms.ContextMenuStrip> items flow horizontally or vertically as necessary. See the <xref:System.Windows.Forms.ToolStripLayoutStyle> enumeration for the other possibilities. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, <xref:System.Windows.Forms.ContextMenuStrip> items flow horizontally or vertically as necessary. See the <xref:System.Windows.Forms.ToolStripLayoutStyle> enumeration for the other possibilities. + ]]></format> </remarks> </Docs> @@ -364,13 +364,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripDropDown.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -407,13 +407,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.LayoutEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.Layout" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnLayout%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnLayout%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -514,21 +514,21 @@ <value> <see langword="true" /> if the check margin is shown; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><. - +## Examples + The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> </Docs> </Member> <Member MemberName="ShowImageMargin"> @@ -564,21 +564,21 @@ <value> <see langword="true" /> if the image margin is shown; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><. - +## Examples + The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/ToolStripItem.xml b/xml/System.Windows.Forms/ToolStripItem.xml index de5e6b553fd..e5a25ae8a3b 100644 --- a/xml/System.Windows.Forms/ToolStripItem.xml +++ b/xml/System.Windows.Forms/ToolStripItem.xml @@ -112,7 +112,7 @@ <altmember cref="T:System.Windows.Forms.ToolStripMenuItem" /> <altmember cref="T:System.Windows.Forms.ToolStripSplitButton" /> <altmember cref="T:System.Windows.Forms.ToolStripDropDownButton" /> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -7748,7 +7748,7 @@ If you set the <xref:System.Windows.Forms.ToolStripItem.ImageKey%2A> property, t <format type="text/markdown"><. + You can create an access key to the item by adding an ampersand ("&") before a letter in the text value. For more information, see [How to: Create Access Keys for Windows Forms Controls](/dotnet/desktop/winforms/controls/how-to-create-access-keys-for-windows-forms-controls). <xref:System.Windows.Forms.ToolStripItem> uses the <xref:System.Windows.Forms.ToolStripItem.Text%2A> property as the default source for the <xref:System.Windows.Forms.ToolTip> content. Set <xref:System.Windows.Forms.ToolStripItem.AutoToolTip%2A> to `false` to use <xref:System.Windows.Forms.ToolStripItem.ToolTipText%2A> as the source for <xref:System.Windows.Forms.ToolTip> content. diff --git a/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml b/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml index 24648ba0efc..49e6f02ef41 100644 --- a/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml +++ b/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml @@ -29,53 +29,53 @@ <Docs> <summary>Provides data for the events that render the background of objects derived from <see cref="T:System.Windows.Forms.ToolStripItem" /> in the <see cref="T:System.Windows.Forms.ToolStripRenderer" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripItemRenderEventArgs> class provides data for the following events: - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> - -- <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> - - In addition, it provides data for the following methods: - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawButtonBackground%2A> - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawDropDownButtonBackground%2A> - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawItemBackground%2A> - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawLabelBackground%2A> - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawMenuItemBackground%2A> - -- <xref:System.Windows.Forms.ToolStripRenderer.DrawOverflowButtonBackground%2A> - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripItemRenderEventArgs> class provides data for the following events: + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> + +- <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> + + In addition, it provides data for the following methods: + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawButtonBackground%2A> + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawDropDownButtonBackground%2A> + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawItemBackground%2A> + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawLabelBackground%2A> + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawMenuItemBackground%2A> + +- <xref:System.Windows.Forms.ToolStripRenderer.DrawOverflowButtonBackground%2A> + - <xref:System.Windows.Forms.ToolStripRenderer.DrawSplitButton%2A> - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -148,20 +148,20 @@ <summary>Gets the graphics used to paint the <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <value>The <see cref="T:System.Drawing.Graphics" /> used to paint the <see cref="T:System.Windows.Forms.ToolStripItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> <Member MemberName="Item"> @@ -196,20 +196,20 @@ <summary>Gets the <see cref="T:System.Windows.Forms.ToolStripItem" /> to paint.</summary> <value>The <see cref="T:System.Windows.Forms.ToolStripItem" /> to paint.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> <Member MemberName="ToolStrip"> @@ -245,25 +245,25 @@ <summary>Gets the value of the <see cref="P:System.Windows.Forms.ToolStripItem.Owner" /> property for the <see cref="T:System.Windows.Forms.ToolStripItem" /> to paint.</summary> <value>The <see cref="T:System.Windows.Forms.ToolStrip" /> that is the owner of the <see cref="T:System.Windows.Forms.ToolStripItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.ToolStripItem> is in the overflow area of the <xref:System.Windows.Forms.Form>, the <xref:System.Windows.Forms.ToolStripItemRenderEventArgs.ToolStrip%2A> property returns an empty string. - - - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.ToolStripItem> is in the overflow area of the <xref:System.Windows.Forms.Form>, the <xref:System.Windows.Forms.ToolStripItemRenderEventArgs.ToolStrip%2A> property returns an empty string. + + + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/ToolStripLabel.xml b/xml/System.Windows.Forms/ToolStripLabel.xml index b563b5c141b..f9d0a5298fd 100644 --- a/xml/System.Windows.Forms/ToolStripLabel.xml +++ b/xml/System.Windows.Forms/ToolStripLabel.xml @@ -33,30 +33,30 @@ <Docs> <summary>Represents a nonselectable <see cref="T:System.Windows.Forms.ToolStripItem" /> that renders text and images and can display hyperlinks.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripLabel> class to create a label that can render text and images that can implement the <xref:System.Windows.Forms.ToolStripItem.TextAlign%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ToolStripItem.ImageAlign%2A?displayProperty=nameWithType> properties. The <xref:System.Windows.Forms.ToolStripLabel> also has many properties that enable it to display one or more hyperlinks, and other properties that modify the appearance and behavior of hyperlinks. - - The <xref:System.Windows.Forms.ToolStripLabel> is like a <xref:System.Windows.Forms.ToolStripButton> that does not get focus by default and that does not render as pushed or highlighted. - - <xref:System.Windows.Forms.ToolStripLabel> as a hosted item supports access keys. - - Use the <xref:System.Windows.Forms.LinkLabel.LinkColor%2A>, <xref:System.Windows.Forms.LinkLabel.LinkVisited%2A>, and <xref:System.Windows.Forms.LinkLabel.LinkBehavior%2A> properties on a <xref:System.Windows.Forms.ToolStripLabel> to support link control in a <xref:System.Windows.Forms.ToolStrip>. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripLabel> class to create a label that can render text and images that can implement the <xref:System.Windows.Forms.ToolStripItem.TextAlign%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ToolStripItem.ImageAlign%2A?displayProperty=nameWithType> properties. The <xref:System.Windows.Forms.ToolStripLabel> also has many properties that enable it to display one or more hyperlinks, and other properties that modify the appearance and behavior of hyperlinks. + + The <xref:System.Windows.Forms.ToolStripLabel> is like a <xref:System.Windows.Forms.ToolStripButton> that does not get focus by default and that does not render as pushed or highlighted. + + <xref:System.Windows.Forms.ToolStripLabel> as a hosted item supports access keys. + + Use the <xref:System.Windows.Forms.LinkLabel.LinkColor%2A>, <xref:System.Windows.Forms.LinkLabel.LinkVisited%2A>, and <xref:System.Windows.Forms.LinkLabel.LinkBehavior%2A> properties on a <xref:System.Windows.Forms.ToolStripLabel> to support link control in a <xref:System.Windows.Forms.ToolStrip>. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -327,24 +327,24 @@ <summary>Gets or sets the color used to display an active link.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color to display an active link. The default color is specified by the system. Typically, this color is <see langword="Color.Red" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An active link is a link that is in the process of being clicked. This is similar to the depressed state of a <xref:System.Windows.Forms.Button> control. You can use this property to specify the color that the link is displayed in when the link is in the process of being clicked. - - There are a number of colors associated with a link. The <xref:System.Windows.Forms.LinkLabel.LinkColor%2A> specifies the color of all links displayed in the <xref:System.Windows.Forms.LinkLabel> control. The <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A> property enables you to specify the color of a link after it has been visited by the user. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An active link is a link that is in the process of being clicked. This is similar to the depressed state of a <xref:System.Windows.Forms.Button> control. You can use this property to specify the color that the link is displayed in when the link is in the process of being clicked. + + There are a number of colors associated with a link. The <xref:System.Windows.Forms.LinkLabel.LinkColor%2A> specifies the color of all links displayed in the <xref:System.Windows.Forms.LinkLabel> control. The <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A> property enables you to specify the color of a link after it has been visited by the user. + > [!NOTE] -> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is in the process of being clicked. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - +> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is in the process of being clicked. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -376,11 +376,11 @@ <value> <see langword="false" /> in all cases.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A <xref:System.Windows.Forms.ToolStripLabel> is a nonselectable <xref:System.Windows.Forms.ToolStripItem>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A <xref:System.Windows.Forms.ToolStripLabel> is a nonselectable <xref:System.Windows.Forms.ToolStripItem>. + ]]></format> </remarks> </Docs> @@ -458,14 +458,14 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripLabel" /> is a hyperlink; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -506,19 +506,19 @@ <summary>Gets or sets a value that represents the behavior of a link.</summary> <value>One of the <see cref="T:System.Windows.Forms.LinkBehavior" /> values. The default is <see langword="LinkBehavior.SystemDefault" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property enables you to specify the behavior of links when they are displayed in the control. For example, if you want links to be displayed with an underline only when the mouse pointer is over a link, you can set this property to `LinkBehavior.HoverUnderline`. For more information about the types of behaviors that can be associated with a link, see <xref:System.Windows.Forms.LinkBehavior>. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property enables you to specify the behavior of links when they are displayed in the control. For example, if you want links to be displayed with an underline only when the mouse pointer is over a link, you can set this property to `LinkBehavior.HoverUnderline`. For more information about the types of behaviors that can be associated with a link, see <xref:System.Windows.Forms.LinkBehavior>. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -549,14 +549,14 @@ <summary>Gets or sets the color used when displaying a normal link.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color used to displaying a normal link. The default color is specified by the system. Typically, this color is <see langword="Color.Blue" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -598,19 +598,19 @@ <value> <see langword="true" /> if links should display as though they were visited; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A <xref:System.Windows.Forms.LinkLabel> control does not automatically denote that a link is a visited link. To display the link as a visited link, you can set the value of this property to `true` in an event handler for the click event of the <xref:System.Windows.Forms.LinkLabel>. A visited link is displayed using the color specified in the <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A> property of the <xref:System.Windows.Forms.ToolStripLabel> control. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A <xref:System.Windows.Forms.LinkLabel> control does not automatically denote that a link is a visited link. To display the link as a visited link, you can set the value of this property to `true` in an event handler for the click event of the <xref:System.Windows.Forms.LinkLabel>. A visited link is displayed using the color specified in the <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A> property of the <xref:System.Windows.Forms.ToolStripLabel> control. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -644,13 +644,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripLabel.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripLabel.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -687,13 +687,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.MouseEnter" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripLabel.OnMouseEnter%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripLabel.OnMouseEnter%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -730,13 +730,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.MouseLeave" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripLabel.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripLabel.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -773,13 +773,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripItem.Paint" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripLabel.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripLabel.OnPaint%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -818,13 +818,13 @@ <returns> <see langword="true" /> if the character was processed as a mnemonic by the control; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is called to give an item the opportunity to process a mnemonic character. The method should determine whether the item is in a state to process mnemonics and if whether the given character represents a mnemonic. If so, the method should perform the action associated with the mnemonic and return `true`. If not, the method should return `false`. - - The <xref:System.Windows.Forms.ToolStripLabel> implementation relies on the host <xref:System.Windows.Forms.ToolStrip> control to call the <xref:System.Windows.Forms.Control.IsMnemonic%2A> method to determine whether the given character matches a mnemonic in the item's text. In this case, the method selects the item associated with the label, or raises the <xref:System.Windows.Forms.ToolStripItem.Click> event if the item cannot be selected. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is called to give an item the opportunity to process a mnemonic character. The method should determine whether the item is in a state to process mnemonics and if whether the given character represents a mnemonic. If so, the method should perform the action associated with the mnemonic and return `true`. If not, the method should return `false`. + + The <xref:System.Windows.Forms.ToolStripLabel> implementation relies on the host <xref:System.Windows.Forms.ToolStrip> control to call the <xref:System.Windows.Forms.Control.IsMnemonic%2A> method to determine whether the given character matches a mnemonic in the item's text. In this case, the method selects the item associated with the label, or raises the <xref:System.Windows.Forms.ToolStripItem.Click> event if the item cannot be selected. + ]]></format> </remarks> </Docs> @@ -855,22 +855,22 @@ <summary>Gets or sets the color used when displaying a link that has been previously visited.</summary> <value>A <see cref="T:System.Drawing.Color" /> that represents the color used to display links that have been visited. The default color is specified by the system. Typically, this color is <see langword="Color.Purple" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property enables you to specify the color that is displayed for all links in the <xref:System.Windows.Forms.ToolStripLabel> that have been visited by the user. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property enables you to specify the color that is displayed for all links in the <xref:System.Windows.Forms.ToolStripLabel> that have been visited by the user. + > [!NOTE] -> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is displayed as a visited link. - - - -## Examples - The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. - +> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is displayed as a visited link. + + + +## Examples + The following code example demonstrates how to initialize a <xref:System.Windows.Forms.ToolStripLabel> to contain a link by setting the <xref:System.Windows.Forms.ToolStripLabel.IsLink%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.ActiveLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.VisitedLinkColor%2A>, <xref:System.Windows.Forms.ToolStripLabel.LinkVisited%2A> and <xref:System.Windows.Forms.ToolStripLabel.LinkBehavior%2A> properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripMenuItem.xml b/xml/System.Windows.Forms/ToolStripMenuItem.xml index 9b4469752ee..0b8015048d8 100644 --- a/xml/System.Windows.Forms/ToolStripMenuItem.xml +++ b/xml/System.Windows.Forms/ToolStripMenuItem.xml @@ -1729,7 +1729,7 @@ ## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.ToolStripMenuItem.ShortcutKeys%2A> property to assign the key combination CTRL+P to a menu item called `printToolStripMenuItem`. For the complete example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + The following code example demonstrates how to use the <xref:System.Windows.Forms.ToolStripMenuItem.ShortcutKeys%2A> property to assign the key combination CTRL+P to a menu item called `printToolStripMenuItem`. For the complete example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet100"::: diff --git a/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml b/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml index cc483133190..4bd380e4fea 100644 --- a/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml +++ b/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml @@ -29,19 +29,19 @@ <Docs> <summary>Handles the painting functionality for <see cref="T:System.Windows.Forms.ToolStrip" /> objects, applying a custom palette and a streamlined style.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripProfessionalRenderer/Overview/StackView.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet10"::: + ]]></format> </remarks> </Docs> @@ -77,14 +77,14 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to create an instance of a class derived from the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to create an instance of a class derived from the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> class. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripProfessionalRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripProfessionalRenderer/Overview/StackView.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> @@ -654,13 +654,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripContentPanelRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripContentPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripContentPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -697,13 +697,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripPanelRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -740,13 +740,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripStatusLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripStatusLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> diff --git a/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml b/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml index 095423be432..26177f39ed8 100644 --- a/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml +++ b/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml @@ -29,25 +29,25 @@ <Docs> <summary>Provides data for the <see cref="M:System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs)" />, <see cref="M:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs)" />, and <see cref="M:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground(System.Windows.Forms.ToolStripRenderEventArgs)" /> methods.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderEventArgs> class also provides data for the <xref:System.Windows.Forms.ToolStripRenderer.DrawImageMargin%2A>, <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBorder%2A>, and <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground%2A> methods. - - - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderEventArgs> class also provides data for the <xref:System.Windows.Forms.ToolStripRenderer.DrawImageMargin%2A>, <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBorder%2A>, and <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground%2A> methods. + + + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -155,20 +155,20 @@ <summary>Gets the <see cref="T:System.Drawing.Rectangle" /> representing the bounds of the area to be painted.</summary> <value>The <see cref="T:System.Drawing.Rectangle" /> representing the bounds of the area to be painted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> <Member MemberName="BackColor"> @@ -197,16 +197,16 @@ <summary>Gets the <see cref="T:System.Drawing.Color" /> that the background of the <see cref="T:System.Windows.Forms.ToolStrip" /> is painted with.</summary> <value>The <see cref="T:System.Drawing.Color" /> that the background of the <see cref="T:System.Windows.Forms.ToolStrip" /> is painted with.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]></format> </remarks> </Docs> @@ -237,21 +237,21 @@ <summary>Gets the <see cref="T:System.Drawing.Rectangle" /> representing the overlap area between a <see cref="T:System.Windows.Forms.ToolStripDropDown" /> and its <see cref="P:System.Windows.Forms.ToolStripDropDown.OwnerItem" />.</summary> <value>The <see cref="T:System.Drawing.Rectangle" /> representing the overlap area between a <see cref="T:System.Windows.Forms.ToolStripDropDown" /> and its <see cref="P:System.Windows.Forms.ToolStripDropDown.OwnerItem" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.ToolStrip> is not a <xref:System.Windows.Forms.ToolStripDropDown> or the <xref:System.Windows.Forms.ToolStripDropDown.OwnerItem%2A?displayProperty=nameWithType> is `null`, the <xref:System.Windows.Forms.ToolStripRenderEventArgs.ConnectedArea%2A> property returns an empty <xref:System.Drawing.Rectangle>. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.ToolStrip> is not a <xref:System.Windows.Forms.ToolStripDropDown> or the <xref:System.Windows.Forms.ToolStripDropDown.OwnerItem%2A?displayProperty=nameWithType> is `null`, the <xref:System.Windows.Forms.ToolStripRenderEventArgs.ConnectedArea%2A> property returns an empty <xref:System.Drawing.Rectangle>. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground?displayProperty=nameWithType> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]></format> </remarks> </Docs> @@ -288,20 +288,20 @@ <summary>Gets the <see cref="T:System.Drawing.Graphics" /> used to paint.</summary> <value>The <see cref="T:System.Drawing.Graphics" /> used to paint.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> <Member MemberName="ToolStrip"> @@ -336,20 +336,20 @@ <summary>Gets the <see cref="T:System.Windows.Forms.ToolStrip" /> to be painted.</summary> <value>The <see cref="T:System.Windows.Forms.ToolStrip" /> to be painted.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method to paint a gradient in the background of a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method to paint a gradient in the background of a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolStripRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripProfessionalRenderer" /> <altmember cref="T:System.Windows.Forms.ToolStripSystemRenderer" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer">How to: Implement a Custom ToolStripRenderer</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/ToolStripRenderer.xml b/xml/System.Windows.Forms/ToolStripRenderer.xml index e517a230386..2634e04e3ae 100644 --- a/xml/System.Windows.Forms/ToolStripRenderer.xml +++ b/xml/System.Windows.Forms/ToolStripRenderer.xml @@ -29,29 +29,29 @@ <Docs> <summary>Handles the painting functionality for <see cref="T:System.Windows.Forms.ToolStrip" /> objects.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.MenuStrip" /> @@ -89,11 +89,11 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripRenderer" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripRenderer> is an abstract class, so the constructor is only available to classes derived from it. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripRenderer> is an abstract class, so the constructor is only available to classes derived from it. + ]]></format> </remarks> </Docs> @@ -159,11 +159,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripArrowRenderEventArgs" /> that contains data to draw the arrow.</param> <summary>Draws an arrow on a <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawArrow%2A> method provides an entry point to the arrow rendering code. Use this method to draw an arrow when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force an arrow to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way an arrow is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderArrow%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawArrow%2A> method provides an entry point to the arrow rendering code. Use this method to draw an arrow when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force an arrow to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way an arrow is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderArrow%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -197,11 +197,11 @@ <param name="e">The <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains data to draw the button's background.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStripButton" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawButtonBackground%2A> method provides an entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripButton>. Use this method to draw the background of a button when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawButtonBackground%2A> method provides an entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripButton>. Use this method to draw the background of a button when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -235,11 +235,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the data to draw the drop-down button's background.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStripDropDownButton" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawDropDownButtonBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripDropDownButton>. Use this method to draw the background of a drop-down button when overriding the <xref:System.Windows.Forms.ToolStripDropDownButton.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a drop-down button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderDropDownButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawDropDownButtonBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripDropDownButton>. Use this method to draw the background of a drop-down button when overriding the <xref:System.Windows.Forms.ToolStripDropDownButton.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a drop-down button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderDropDownButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -273,11 +273,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripGripRenderEventArgs" /> that contains the data to draw the move handle.</param> <summary>Draws a move handle on a <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawGrip%2A> method provides an entry point to the rendering code for a move handle located on a <xref:System.Windows.Forms.ToolStrip>. Use this method when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaintGrip%2A?displayProperty=nameWithType> method, or to force a move handle to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way a move handle is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderGrip%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawGrip%2A> method provides an entry point to the rendering code for a move handle located on a <xref:System.Windows.Forms.ToolStrip>. Use this method when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaintGrip%2A?displayProperty=nameWithType> method, or to force a move handle to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way a move handle is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderGrip%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -311,11 +311,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the data to draw the space around the image.</param> <summary>Draws the space around an image on a <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawImageMargin%2A> method provides the entry point to the rendering code for the image. Use this method to draw the image margin when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the image margin to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the image margin is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawImageMargin%2A> method provides the entry point to the rendering code for the image. Use this method to draw the image margin when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the image margin to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the image margin is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -349,11 +349,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the data to draw the background of the item.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemBackground%2A> method provides the entry point to the rendering code for the background of an item. Use this method to draw the background of an item when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of an item to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of an item is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemBackground%2A> method provides the entry point to the rendering code for the background of an item. Use this method to draw the background of an item when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of an item to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of an item is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -387,11 +387,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemImageRenderEventArgs" /> that contains the data to draw the selected image.</param> <summary>Draws an image on a <see cref="T:System.Windows.Forms.ToolStripItem" /> that indicates the item is in a selected state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemCheck%2A> method provides the entry point to the rendering code for an image in a selected state. Use this method to draw a selected image when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force a selected image to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way a selected image is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemCheck%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemCheck%2A> method provides the entry point to the rendering code for an image in a selected state. Use this method to draw a selected image when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force a selected image to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way a selected image is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemCheck%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -425,11 +425,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemImageRenderEventArgs" /> that contains the data to draw the image.</param> <summary>Draws an image on a <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemImage%2A> method provides the entry point to the rendering code for an image. Use this method to draw an image when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method or to force the image to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the image is rendered, override the `OnDrawItem` method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemImage%2A> method provides the entry point to the rendering code for an image. Use this method to draw an image when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method or to force the image to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the image is rendered, override the `OnDrawItem` method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -463,11 +463,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemTextRenderEventArgs" /> that contains the data to draw the text.</param> <summary>Draws text on a <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemText%2A> method provides the entry point to the rendering code for the text of a <xref:System.Windows.Forms.ToolStripItem>. Use this method to draw the item text when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the item text to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the item text is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemText%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawItemText%2A> method provides the entry point to the rendering code for the text of a <xref:System.Windows.Forms.ToolStripItem>. Use this method to draw the item text when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the item text to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the item text is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemText%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -501,11 +501,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the data to draw the background for the label.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStripLabel" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawLabelBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripLabel>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStripLabel> when overriding the <xref:System.Windows.Forms.ToolStripLabel.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStripLabel> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of a <xref:System.Windows.Forms.ToolStripLabel> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderLabelBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawLabelBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripLabel>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStripLabel> when overriding the <xref:System.Windows.Forms.ToolStripLabel.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStripLabel> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of a <xref:System.Windows.Forms.ToolStripLabel> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderLabelBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -539,11 +539,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the data to draw the background for the menu item.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStripMenuItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawMenuItemBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripMenuItem>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStripMenuItem> when overriding the <xref:System.Windows.Forms.ToolStripMenuItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStripMenuItem> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background for a <xref:System.Windows.Forms.ToolStripMenuItem> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderMenuItemBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawMenuItemBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStripMenuItem>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStripMenuItem> when overriding the <xref:System.Windows.Forms.ToolStripMenuItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStripMenuItem> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background for a <xref:System.Windows.Forms.ToolStripMenuItem> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderMenuItemBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -577,11 +577,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Draws the background for an overflow button.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawOverflowButtonBackground%2A> method provides the entry point to the rendering code for the background of an overflow button. Use this method to draw the background of an overflow button when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background for an overflow button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background for an overflow button is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderOverflowButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawOverflowButtonBackground%2A> method provides the entry point to the rendering code for the background of an overflow button. Use this method to draw the background of an overflow button when overriding the <xref:System.Windows.Forms.ToolStripItem.OnPaint%2A?displayProperty=nameWithType> method, or to force the background for an overflow button to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background for an overflow button is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderOverflowButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -615,11 +615,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripSeparatorRenderEventArgs" /> that contains the data to draw the <see cref="T:System.Windows.Forms.ToolStripSeparator" />.</param> <summary>Draws a <see cref="T:System.Windows.Forms.ToolStripSeparator" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawSeparator%2A> method provides the entry point to the rendering code for a <xref:System.Windows.Forms.ToolStripSeparator>. Use this method to draw the <xref:System.Windows.Forms.ToolStripSeparator> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaint%2A?displayProperty=nameWithType> method, or to force a <xref:System.Windows.Forms.ToolStripSeparator> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the <xref:System.Windows.Forms.ToolStripSeparator> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSeparator%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawSeparator%2A> method provides the entry point to the rendering code for a <xref:System.Windows.Forms.ToolStripSeparator>. Use this method to draw the <xref:System.Windows.Forms.ToolStripSeparator> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaint%2A?displayProperty=nameWithType> method, or to force a <xref:System.Windows.Forms.ToolStripSeparator> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the <xref:System.Windows.Forms.ToolStripSeparator> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSeparator%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -653,11 +653,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Draws a <see cref="T:System.Windows.Forms.ToolStripSplitButton" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawSplitButton%2A> method provides the entry point to the rendering code for a <xref:System.Windows.Forms.ToolStripSplitButton>. Use this method to draw a <xref:System.Windows.Forms.ToolStripSplitButton> when overriding the <xref:System.Windows.Forms.ToolStripSplitButton.OnPaint%2A?displayProperty=nameWithType> method, or to force a <xref:System.Windows.Forms.ToolStripSplitButton> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the <xref:System.Windows.Forms.ToolStripSplitButton> is rendered, override the <xref:System.Windows.Forms.ToolStripSystemRenderer.OnRenderSplitButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawSplitButton%2A> method provides the entry point to the rendering code for a <xref:System.Windows.Forms.ToolStripSplitButton>. Use this method to draw a <xref:System.Windows.Forms.ToolStripSplitButton> when overriding the <xref:System.Windows.Forms.ToolStripSplitButton.OnPaint%2A?displayProperty=nameWithType> method, or to force a <xref:System.Windows.Forms.ToolStripSplitButton> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the <xref:System.Windows.Forms.ToolStripSplitButton> is rendered, override the <xref:System.Windows.Forms.ToolStripSystemRenderer.OnRenderSplitButtonBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -722,11 +722,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the data to draw the background for the <see cref="T:System.Windows.Forms.ToolStrip" />.</param> <summary>Draws the background for a <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStrip>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStrip> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaintBackground%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStrip> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of a <xref:System.Windows.Forms.ToolStrip> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground%2A> method provides the entry point to the rendering code for the background of a <xref:System.Windows.Forms.ToolStrip>. Use this method to draw the background of a <xref:System.Windows.Forms.ToolStrip> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaintBackground%2A?displayProperty=nameWithType> method, or to force the background of a <xref:System.Windows.Forms.ToolStrip> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the background of a <xref:System.Windows.Forms.ToolStrip> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -760,11 +760,11 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the data to draw the border for the <see cref="T:System.Windows.Forms.ToolStrip" />.</param> <summary>Draws the border for a <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBorder%2A> method provides the entry point to the rendering code for the border of a <xref:System.Windows.Forms.ToolStrip>. Use this method to draw the border of a <xref:System.Windows.Forms.ToolStrip> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaint%2A?displayProperty=nameWithType> method, or to force the border of a <xref:System.Windows.Forms.ToolStrip> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the border of a <xref:System.Windows.Forms.ToolStrip> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripRenderer.DrawToolStripBorder%2A> method provides the entry point to the rendering code for the border of a <xref:System.Windows.Forms.ToolStrip>. Use this method to draw the border of a <xref:System.Windows.Forms.ToolStrip> when overriding the <xref:System.Windows.Forms.ToolStrip.OnPaint%2A?displayProperty=nameWithType> method, or to force the border of a <xref:System.Windows.Forms.ToolStrip> to be drawn in a custom <xref:System.Windows.Forms.ToolStripRenderer>. To change the way the border of a <xref:System.Windows.Forms.ToolStrip> is rendered, override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method in a class derived from <xref:System.Windows.Forms.ToolStripRenderer>. + ]]></format> </remarks> </Docs> @@ -891,11 +891,11 @@ <param name="toolStrip">The <see cref="T:System.Windows.Forms.ToolStrip" /> to be initialized.</param> <summary>When overridden in a derived class, provides for custom initialization of the given <see cref="T:System.Windows.Forms.ToolStrip" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripRenderer.Initialize%2A> method to set properties, such as the <xref:System.Windows.Forms.ToolStrip.BackColor%2A?displayProperty=nameWithType> or <xref:System.Windows.Forms.ToolStrip.Font%2A?displayProperty=nameWithType>, when a <xref:System.Windows.Forms.ToolStrip> is rendered. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripRenderer.Initialize%2A> method to set properties, such as the <xref:System.Windows.Forms.ToolStrip.BackColor%2A?displayProperty=nameWithType> or <xref:System.Windows.Forms.ToolStrip.Font%2A?displayProperty=nameWithType>, when a <xref:System.Windows.Forms.ToolStrip> is rendered. + ]]></format> </remarks> </Docs> @@ -960,19 +960,19 @@ <param name="item">The <see cref="T:System.Windows.Forms.ToolStripItem" /> to be initialized.</param> <summary>When overridden in a derived class, provides for custom initialization of the given <see cref="T:System.Windows.Forms.ToolStripItem" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripRenderer.InitializeItem%2A> method to set properties, such as the <xref:System.Windows.Forms.ToolStripItem.BackColor%2A?displayProperty=nameWithType> or <xref:System.Windows.Forms.ToolStripItem.Font%2A?displayProperty=nameWithType>, when a <xref:System.Windows.Forms.ToolStripItem> is rendered. - - - -## Examples - The following code example demonstrates how to initialize individual <xref:System.Windows.Forms.ToolStripItem> controls. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripRenderer.InitializeItem%2A> method to set properties, such as the <xref:System.Windows.Forms.ToolStripItem.BackColor%2A?displayProperty=nameWithType> or <xref:System.Windows.Forms.ToolStripItem.Font%2A?displayProperty=nameWithType>, when a <xref:System.Windows.Forms.ToolStripItem> is rendered. + + + +## Examples + The following code example demonstrates how to initialize individual <xref:System.Windows.Forms.ToolStripItem> controls. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet11"::: + ]]></format> </remarks> <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer?view=netframeworkdesktop-4.8">How to: Implement a Custom ToolStripRenderer</related> @@ -1090,13 +1090,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripArrowRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderArrow" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderArrow%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderArrow%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">.NET 5 and later: The <paramref name="e" /> argument is <see langword="null" />.</exception> @@ -1134,19 +1134,19 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderButtonBackground%2A> method to draw a border around a <xref:System.Windows.Forms.ToolStripButton> control's <xref:System.Windows.Forms.ToolStripItem.Image%2A>. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1184,13 +1184,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderDropDownButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderDropDownButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1227,13 +1227,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripGripRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderGrip" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderGrip%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderGrip%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1270,13 +1270,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the event data.</param> <summary>Draws the item background.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1313,13 +1313,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="M:System.Windows.Forms.ToolStripSystemRenderer.OnRenderItemBackground(System.Windows.Forms.ToolStripItemRenderEventArgs)" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1356,13 +1356,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemImageRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderItemCheck" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">.NET 5 and later: The <paramref name="e" /> argument is <see langword="null" />.</exception> @@ -1400,13 +1400,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemImageRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderItemImage" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemImage%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemImage%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">.NET 5 and later: The <paramref name="e" /> argument is <see langword="null" />.</exception> @@ -1444,13 +1444,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemTextRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderItemText" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemText%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderItemText%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">.NET 5 and later: The <paramref name="e" /> argument is <see langword="null" />.</exception> @@ -1488,13 +1488,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1531,13 +1531,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderMenuItemBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderMenuItemBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1574,13 +1574,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderOverflowButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderOverflowButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1617,13 +1617,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripSeparatorRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderSeparator" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSeparator%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSeparator%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1660,13 +1660,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="M:System.Windows.Forms.ToolStripRenderer.OnRenderSplitButtonBackground(System.Windows.Forms.ToolStripItemRenderEventArgs)" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSplitButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderSplitButtonBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1703,13 +1703,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderStatusStripSizingGrip" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderStatusStripSizingGrip%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderStatusStripSizingGrip%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">.NET 5 and later: The <paramref name="e" /> argument is <see langword="null" />.</exception> @@ -1747,21 +1747,21 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method to paint a gradient in the background of a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBackground%2A> method to paint a gradient in the background of a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1799,21 +1799,21 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripBorder" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to override the <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder%2A> method to draw a custom border around a <xref:System.Windows.Forms.ToolStrip> control. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ToolStripRenderer> class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1851,13 +1851,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripContentPanelRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripContentPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripContentPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1894,13 +1894,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripPanelRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripPanelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1937,13 +1937,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.ToolStripItemRenderEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripStatusLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripRenderer.OnRenderToolStripStatusLabelBackground%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1976,21 +1976,21 @@ <Docs> <summary>Occurs when an arrow on a <see cref="T:System.Windows.Forms.ToolStripItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderArrow> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderArrow> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderArrow> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderArrow> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet583"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet583"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet583"::: + ]]></format> </remarks> </Docs> @@ -2020,21 +2020,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripButton" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderButtonBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet588"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet588"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet588"::: + ]]></format> </remarks> </Docs> @@ -2064,21 +2064,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripDropDownButton" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderDropDownButtonBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet589"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet589"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet589"::: + ]]></format> </remarks> </Docs> @@ -2108,21 +2108,21 @@ <Docs> <summary>Occurs when the move handle for a <see cref="T:System.Windows.Forms.ToolStrip" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderGrip> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderGrip> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderGrip> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderGrip> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet591"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet591"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet591"::: + ]]></format> </remarks> </Docs> @@ -2152,21 +2152,21 @@ <Docs> <summary>Draws the margin between an image and its container.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderImageMargin> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderImageMargin> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderImageMargin> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderImageMargin> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet596"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet596"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet596"::: + ]]></format> </remarks> </Docs> @@ -2196,21 +2196,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet592"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet592"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet592"::: + ]]></format> </remarks> </Docs> @@ -2240,21 +2240,21 @@ <Docs> <summary>Occurs when the image for a selected <see cref="T:System.Windows.Forms.ToolStripItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemCheck> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemCheck> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemCheck> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemCheck> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet594"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet594"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet594"::: + ]]></format> </remarks> </Docs> @@ -2284,21 +2284,21 @@ <Docs> <summary>Occurs when the image for a <see cref="T:System.Windows.Forms.ToolStripItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemImage> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemImage> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemImage> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemImage> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet593"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet593"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet593"::: + ]]></format> </remarks> </Docs> @@ -2328,21 +2328,21 @@ <Docs> <summary>Occurs when the text for a <see cref="T:System.Windows.Forms.ToolStripItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemText> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemText> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemText> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderItemText> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet595"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet595"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet595"::: + ]]></format> </remarks> </Docs> @@ -2372,21 +2372,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripLabel" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderLabelBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet597"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet597"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet597"::: + ]]></format> </remarks> </Docs> @@ -2416,21 +2416,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderMenuItemBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet598"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet598"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet598"::: + ]]></format> </remarks> </Docs> @@ -2460,21 +2460,21 @@ <Docs> <summary>Occurs when the background for an overflow button is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderOverflowButtonBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet590"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet590"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet590"::: + ]]></format> </remarks> </Docs> @@ -2504,21 +2504,21 @@ <Docs> <summary>Occurs when a <see cref="T:System.Windows.Forms.ToolStripSeparator" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderSeparator> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderSeparator> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderSeparator> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderSeparator> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet602"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet602"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet602"::: + ]]></format> </remarks> </Docs> @@ -2548,21 +2548,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStripSplitButton" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderSplitButtonBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet601"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet601"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet601"::: + ]]></format> </remarks> </Docs> @@ -2592,21 +2592,21 @@ <Docs> <summary>Occurs when the display style changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderStatusStripSizingGrip> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderStatusStripSizingGrip> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderStatusStripSizingGrip> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderStatusStripSizingGrip> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet600"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet600"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet600"::: + ]]></format> </remarks> </Docs> @@ -2636,21 +2636,21 @@ <Docs> <summary>Occurs when the background for a <see cref="T:System.Windows.Forms.ToolStrip" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]></format> </remarks> </Docs> @@ -2680,21 +2680,21 @@ <Docs> <summary>Occurs when the border for a <see cref="T:System.Windows.Forms.ToolStrip" /> is rendered.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBorder> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBorder> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBorder> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripBorder> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet587"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet587"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet587"::: + ]]></format> </remarks> </Docs> @@ -2724,21 +2724,21 @@ <Docs> <summary>Draws the background of a <see cref="T:System.Windows.Forms.ToolStripContentPanel" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripContentPanelBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet586"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet586"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet586"::: + ]]></format> </remarks> </Docs> @@ -2768,21 +2768,21 @@ <Docs> <summary>Draws the background of a <see cref="T:System.Windows.Forms.ToolStripPanel" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripPanelBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet585"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet585"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet585"::: + ]]></format> </remarks> </Docs> @@ -2812,21 +2812,21 @@ <Docs> <summary>Draws the background of a <see cref="T:System.Windows.Forms.ToolStripStatusLabel" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. - - To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground> event. This report helps you to learn when the event occurs and can assist you in debugging. + + To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.ToolStripRenderer>, such as a <xref:System.Windows.Forms.ToolStripSystemRenderer> or <xref:System.Windows.Forms.ToolStripProfessionalRenderer>. Then name the instance `ToolStripRenderer1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripRenderer.RenderToolStripStatusLabelBackground> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet599"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet599"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet599"::: + ]]></format> </remarks> </Docs> @@ -2886,9 +2886,9 @@ <param name="dpi">The DPI value to use for scaling.</param> <summary>Applies the <see cref="F:System.Windows.Forms.ToolStripRenderer.Offset2X" /> and <see cref="F:System.Windows.Forms.ToolStripRenderer.Offset2Y" /> values to scaling the arrow icon based on the specified DPI value.</summary> <remarks> - <format type="text/markdown"><, targets .NET Framework 4.7.1 or later, and has the `EnableDpiChangedMessageHandling` and `EnableDpiChangedHighDpiImprovements` configuration switches turned on. It informs the <xref:System.Windows.Forms.ToolStripRenderer> about the new DPI and allows the offsets for rendering arrows in the right dimensions to be calculated. +This overload of the `ScaleArrowOffsetsIfNeeded` method should be called in a derived class only when an application opts into [per-monitor version 2](/dotnet/framework/whats-new/whats-new-in-accessibility#accessibility-switches), targets .NET Framework 4.7.1 or later, and has the `EnableDpiChangedMessageHandling` and `EnableDpiChangedHighDpiImprovements` configuration switches turned on. It informs the <xref:System.Windows.Forms.ToolStripRenderer> about the new DPI and allows the offsets for rendering arrows in the right dimensions to be calculated. ]]></format> </remarks> diff --git a/xml/System.Windows.Forms/ToolStripSeparator.xml b/xml/System.Windows.Forms/ToolStripSeparator.xml index 24bc110ea9e..1256c5c3960 100644 --- a/xml/System.Windows.Forms/ToolStripSeparator.xml +++ b/xml/System.Windows.Forms/ToolStripSeparator.xml @@ -33,18 +33,18 @@ <Docs> <summary>Represents a line used to group items of a <see cref="T:System.Windows.Forms.ToolStrip" /> or the drop-down items of a <see cref="T:System.Windows.Forms.MenuStrip" /> or <see cref="T:System.Windows.Forms.ContextMenuStrip" /> or other <see cref="T:System.Windows.Forms.ToolStripDropDown" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use a <xref:System.Windows.Forms.ToolStripSeparator> to group related items on a menu or <xref:System.Windows.Forms.ToolStrip>. The <xref:System.Windows.Forms.ToolStripSeparator> is automatically spaced and oriented horizontally or vertically to accord with its container. - - You can add a <xref:System.Windows.Forms.ToolStripSeparator> at design time by choosing it from a drop-down list. However, you can also automatically create a <xref:System.Windows.Forms.ToolStripSeparator> by typing a hyphen (-) in either the designer template node or in the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use a <xref:System.Windows.Forms.ToolStripSeparator> to group related items on a menu or <xref:System.Windows.Forms.ToolStrip>. The <xref:System.Windows.Forms.ToolStripSeparator> is automatically spaced and oriented horizontally or vertically to accord with its container. + + You can add a <xref:System.Windows.Forms.ToolStripSeparator> at design time by choosing it from a drop-down list. However, you can also automatically create a <xref:System.Windows.Forms.ToolStripSeparator> by typing a hyphen (-) in either the designer template node or in the <xref:System.Windows.Forms.ToolStripItemCollection.Add%2A> method. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-add-enhancements-to-toolstripmenuitems">How to: Add Enhancements to ToolStripMenuItems</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/menustrip-control-windows-forms">MenuStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-add-enhancements-to-toolstripmenuitems">How to: Add Enhancements to ToolStripMenuItems</related> </Docs> <Members> <Member MemberName=".ctor"> @@ -116,11 +116,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -170,11 +170,11 @@ <summary>This property is not relevant to this class.</summary> <value>The image to display in the background of the separator.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -223,11 +223,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -402,11 +402,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripItemDisplayStyle" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -447,11 +447,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -501,11 +501,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -555,11 +555,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -600,11 +600,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -657,11 +657,11 @@ <summary>This property is not relevant to this class.</summary> <value>The <see cref="T:System.Drawing.Font" /> to apply to the text displayed by the <see cref="T:System.Windows.Forms.ToolStripSeparator" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -743,11 +743,11 @@ <summary>This property is not relevant to this class.</summary> <value>The image to be displayed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -796,11 +796,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Drawing.ContentAlignment" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -857,11 +857,11 @@ <summary>This property is not relevant to this class.</summary> <value>The index of the image that is displayed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -914,11 +914,11 @@ <summary>This property is not relevant to this class.</summary> <value>The key for the image that is displayed for the <see cref="T:System.Windows.Forms.ToolStripSeparator" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -967,11 +967,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripItemImageScaling" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1020,11 +1020,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Drawing.Color" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1064,11 +1064,11 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>This method is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1149,11 +1149,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1234,11 +1234,11 @@ <summary>This property is not relevant to this class.</summary> <value>A <see cref="T:System.String" /> representing the item's text.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1287,11 +1287,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Drawing.ContentAlignment" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1332,11 +1332,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1381,11 +1381,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripTextDirection" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1434,11 +1434,11 @@ <summary>This property is not relevant to this class.</summary> <value>One of the <see cref="T:System.Windows.Forms.TextImageRelation" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1488,11 +1488,11 @@ <summary>This property is not relevant to this class.</summary> <value>A string representing the ToolTip text.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolStripSplitButton.xml b/xml/System.Windows.Forms/ToolStripSplitButton.xml index 3953cd50ed1..0969b6f86dc 100644 --- a/xml/System.Windows.Forms/ToolStripSplitButton.xml +++ b/xml/System.Windows.Forms/ToolStripSplitButton.xml @@ -37,18 +37,18 @@ <Docs> <summary>Represents a combination of a standard button on the left and a drop-down button on the right, or the other way around if the value of <see cref="T:System.Windows.Forms.RightToLeft" /> is <see langword="Yes" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripSplitButton> combines button and drop-down button functionality. - - Use the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A> property to synchronize the <xref:System.Windows.Forms.Control.Click> event of the chosen drop-down item with the item shown on the button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripSplitButton> combines button and drop-down button functionality. + + Use the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A> property to synchronize the <xref:System.Windows.Forms.Control.Click> event of the chosen drop-down item with the item shown on the button. + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-overview-windows-forms">ToolStrip Control Overview (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-architecture">ToolStrip Control Architecture</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-technology-summary">ToolStrip Technology Summary</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -318,11 +318,11 @@ <value> <see langword="true" /> if default <see cref="T:System.Windows.Forms.ToolTip" /> text is displayed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set the <xref:System.Windows.Forms.ToolStripSplitButton.AutoToolTip%2A> property to `false` to display custom text on a <xref:System.Windows.Forms.ToolStripSplitButton>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set the <xref:System.Windows.Forms.ToolStripSplitButton.AutoToolTip%2A> property to `false` to display custom text on a <xref:System.Windows.Forms.ToolStripSplitButton>. + ]]></format> </remarks> </Docs> @@ -394,21 +394,21 @@ <Docs> <summary>Occurs when the standard button portion of a <see cref="T:System.Windows.Forms.ToolStripSplitButton" /> is clicked.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonClick> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonClick> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet609"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet609"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet609"::: + ]]></format> </remarks> </Docs> @@ -445,21 +445,21 @@ <Docs> <summary>Occurs when the standard button portion of a <see cref="T:System.Windows.Forms.ToolStripSplitButton" /> is double-clicked.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonDoubleClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonDoubleClick> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonDoubleClick> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.ButtonDoubleClick> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet610"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet610"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet610"::: + ]]></format> </remarks> </Docs> @@ -668,13 +668,13 @@ <summary>Gets or sets the portion of the <see cref="T:System.Windows.Forms.ToolStripSplitButton" /> that is activated when the control is first selected.</summary> <value>A <see langword="Forms.ToolStripItem" /> representing the portion of the <see cref="T:System.Windows.Forms.ToolStripSplitButton" /> that is activated when first selected. The default value is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If a <xref:System.Windows.Forms.ToolStripSplitButton> has a <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A>, the ENTER key activates the button. Otherwise, the ENTER key activates the drop-down. - - Use the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A> property to synchronize the <xref:System.Windows.Forms.Control.Click> event of the chosen drop-down item with the item shown on the button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If a <xref:System.Windows.Forms.ToolStripSplitButton> has a <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A>, the ENTER key activates the button. Otherwise, the ENTER key activates the drop-down. + + Use the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItem%2A> property to synchronize the <xref:System.Windows.Forms.Control.Click> event of the chosen drop-down item with the item shown on the button. + ]]></format> </remarks> </Docs> @@ -711,21 +711,21 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.ToolStripSplitButton.DefaultItem" /> has changed.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItemChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItemChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItemChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripSplitButton> named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripSplitButton.DefaultItemChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet611"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet611"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet611"::: + ]]></format> </remarks> </Docs> @@ -966,13 +966,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripSplitButton.ButtonClick" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnButtonClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnButtonClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1009,13 +1009,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripSplitButton.ButtonDoubleClick" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnButtonDoubleClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnButtonDoubleClick%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1052,13 +1052,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripSplitButton.DefaultItemChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnDefaultItemChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnDefaultItemChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1095,13 +1095,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseDown" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseDown%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1138,13 +1138,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseLeave" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseLeave%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1181,13 +1181,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.MouseUp" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnMouseUp%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1256,13 +1256,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.Control.RightToLeftChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripSplitButton.OnRightToLeftChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripSplitButton.OnRightToLeftChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1329,13 +1329,13 @@ <returns> <see langword="true" /> if the key was processed by the item; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is called during message preprocessing to handle the ENTER and SPACEBAR keys in order to raise the <xref:System.Windows.Forms.ToolStripItem.Click> event. However, if the <xref:System.Windows.Forms.ToolStripSplitButton> is not enabled, this method calls the base class implementation instead. - - This method is called only if the <xref:System.Windows.Forms.Control.IsInputKey%2A> method indicates that the item is not processing the key. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is called during message preprocessing to handle the ENTER and SPACEBAR keys in order to raise the <xref:System.Windows.Forms.ToolStripItem.Click> event. However, if the <xref:System.Windows.Forms.ToolStripSplitButton> is not enabled, this method calls the base class implementation instead. + + This method is called only if the <xref:System.Windows.Forms.Control.IsInputKey%2A> method indicates that the item is not processing the key. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1408,11 +1408,11 @@ <Docs> <summary>This method is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is not relevant to this class. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripSplitButton.DropDownButtonWidth" /> @@ -1454,11 +1454,11 @@ <summary>Gets the boundaries of the separator between the standard and drop-down button portions of a <see cref="T:System.Windows.Forms.ToolStripSplitButton" />.</summary> <value>A <see cref="T:System.Drawing.Rectangle" /> that represents the size and location of the separator.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripSplitButton.SplitterBounds%2A> property to do custom painting. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripSplitButton.SplitterBounds%2A> property to do custom painting. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.SplitContainer.SplitterWidth" /> diff --git a/xml/System.Windows.Forms/ToolStripStatusLabel.xml b/xml/System.Windows.Forms/ToolStripStatusLabel.xml index cc8de7b33cf..c94e116c12d 100644 --- a/xml/System.Windows.Forms/ToolStripStatusLabel.xml +++ b/xml/System.Windows.Forms/ToolStripStatusLabel.xml @@ -42,21 +42,21 @@ <Docs> <summary>Represents a panel in a <see cref="T:System.Windows.Forms.StatusStrip" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripStatusLabel> is a version of <xref:System.Windows.Forms.ToolStripLabel> designed specifically for use in <xref:System.Windows.Forms.StatusStrip>. The special features include <xref:System.Windows.Forms.ToolStripStatusLabel.BorderStyle%2A>, <xref:System.Windows.Forms.ToolStripStatusLabel.BorderSides%2A>, and <xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A>. - - A <xref:System.Windows.Forms.ToolStripStatusLabel> can contain text or an icon that reflects the status of an application. Use the <xref:System.Windows.Forms.ToolStripItemCollection> class to find, add, or remove <xref:System.Windows.Forms.ToolStripStatusLabel> objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripStatusLabel> is a version of <xref:System.Windows.Forms.ToolStripLabel> designed specifically for use in <xref:System.Windows.Forms.StatusStrip>. The special features include <xref:System.Windows.Forms.ToolStripStatusLabel.BorderStyle%2A>, <xref:System.Windows.Forms.ToolStripStatusLabel.BorderSides%2A>, and <xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A>. + + A <xref:System.Windows.Forms.ToolStripStatusLabel> can contain text or an icon that reflects the status of an application. Use the <xref:System.Windows.Forms.ToolStripItemCollection> class to find, add, or remove <xref:System.Windows.Forms.ToolStripStatusLabel> objects. + <xref:System.Windows.Forms.ToolStripStatusLabel> replaces and extends the <xref:System.Windows.Forms.StatusBarPanel> control, which was removed in .NET 5. -## Examples - The following code example demonstrates a <xref:System.Windows.Forms.ToolStripStatusLabel> with various common properties set. - +## Examples + The following code example demonstrates a <xref:System.Windows.Forms.ToolStripStatusLabel> with various common properties set. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> </Docs> @@ -287,17 +287,17 @@ <summary>Gets or sets a value that determines where the <see cref="T:System.Windows.Forms.ToolStripStatusLabel" /> is aligned on the <see cref="T:System.Windows.Forms.StatusStrip" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripItemAlignment" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks The meaning of the <xref:System.Windows.Forms.ToolStripStatusLabel.Alignment%2A> property is affected by the setting of the <xref:System.Windows.Forms.ToolStripItem.RightToLeft%2A> property. -## Examples - The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.Alignment%2A> property. - +## Examples + The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.Alignment%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -338,14 +338,14 @@ <summary>Gets or sets a value that indicates which sides of the <see cref="T:System.Windows.Forms.ToolStripStatusLabel" /> show borders.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolStripStatusLabelBorderSides" /> values. The default is <see cref="F:System.Windows.Forms.ToolStripStatusLabelBorderSides.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.BorderSides%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.BorderSides%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -386,14 +386,14 @@ <summary>Gets or sets the border style of the <see cref="T:System.Windows.Forms.ToolStripStatusLabel" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.Border3DStyle" /> values. The default is <see cref="F:System.Windows.Forms.Border3DStyle.Flat" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.BorderStyle%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.BorderStyle%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value of <see cref="P:System.Windows.Forms.ToolStripStatusLabel.BorderStyle" /> is not one of the <see cref="T:System.Windows.Forms.Border3DStyle" /> values.</exception> @@ -632,20 +632,20 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripStatusLabel" /> automatically fills the available space on the <see cref="T:System.Windows.Forms.StatusStrip" /> as the form is resized; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks + <format type="text/markdown"><![CDATA[ + +## Remarks Set the <xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A> property to `true` to enable the <xref:System.Windows.Forms.ToolStripStatusLabel> to smoothly resize along with its container. -## Examples - The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A> property. - +## Examples + The following code example demonstrates the syntax for various <xref:System.Windows.Forms.ToolStripStatusLabel> common properties, including the <xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-use-the-spring-property-interactively-in-a-statusstrip">How to: Use the Spring Property Interactively in a StatusStrip</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-use-the-spring-property-interactively-in-a-statusstrip">How to: Use the Spring Property Interactively in a StatusStrip</related> </Docs> </Member> </Members> diff --git a/xml/System.Windows.Forms/ToolStripTextBox.xml b/xml/System.Windows.Forms/ToolStripTextBox.xml index 4dcd268475b..15e258cdd68 100644 --- a/xml/System.Windows.Forms/ToolStripTextBox.xml +++ b/xml/System.Windows.Forms/ToolStripTextBox.xml @@ -33,30 +33,30 @@ <Docs> <summary>Represents a text box in a <see cref="T:System.Windows.Forms.ToolStrip" /> that allows the user to enter text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - <xref:System.Windows.Forms.ToolStripTextBox> is the <xref:System.Windows.Forms.TextBox> optimized for hosting in a <xref:System.Windows.Forms.ToolStrip>. A subset of the hosted control's properties and events are exposed at the <xref:System.Windows.Forms.ToolStripTextBox> level, but the underlying <xref:System.Windows.Forms.TextBox> control is fully accessible through the <xref:System.Windows.Forms.ToolStripTextBox.TextBox%2A> property. - - The <xref:System.Windows.Forms.ToolStripTextBox> control allows the user to enter text in an application. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing. - - Typically, a <xref:System.Windows.Forms.ToolStripTextBox> control is used to display a single line of text or accept it as input. You can use the <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> to enable multiple lines of text to be displayed or entered. Set the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AcceptsReturn%2A> properties to `true` to allow greater text manipulation in a multiline <xref:System.Windows.Forms.ToolStripTextBox> control. - - You can limit the amount of text entered into a <xref:System.Windows.Forms.ToolStripTextBox> control by setting the <xref:System.Windows.Forms.ToolStripTextBox.MaxLength%2A> property to a specific number of characters. Use the <xref:System.Windows.Forms.ToolStripTextBox.CharacterCasing%2A> property to allow the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the <xref:System.Windows.Forms.ToolStripTextBox> control. - - To restrict text from being entered in a <xref:System.Windows.Forms.ToolStripTextBox> control, you can create an event handler for the <xref:System.Windows.Forms.Control.KeyDown> event in order to validate each character entered in the control. You can also restrict all entry of data in a <xref:System.Windows.Forms.ToolStripTextBox> control by setting the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnly%2A> property to `true`. - - - -## Examples - The following code example demonstrates a <xref:System.Windows.Forms.ToolStripTextBox> with various common property settings, including automatic completion options. - + <format type="text/markdown"><![CDATA[ + +## Remarks + <xref:System.Windows.Forms.ToolStripTextBox> is the <xref:System.Windows.Forms.TextBox> optimized for hosting in a <xref:System.Windows.Forms.ToolStrip>. A subset of the hosted control's properties and events are exposed at the <xref:System.Windows.Forms.ToolStripTextBox> level, but the underlying <xref:System.Windows.Forms.TextBox> control is fully accessible through the <xref:System.Windows.Forms.ToolStripTextBox.TextBox%2A> property. + + The <xref:System.Windows.Forms.ToolStripTextBox> control allows the user to enter text in an application. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing. + + Typically, a <xref:System.Windows.Forms.ToolStripTextBox> control is used to display a single line of text or accept it as input. You can use the <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> to enable multiple lines of text to be displayed or entered. Set the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AcceptsReturn%2A> properties to `true` to allow greater text manipulation in a multiline <xref:System.Windows.Forms.ToolStripTextBox> control. + + You can limit the amount of text entered into a <xref:System.Windows.Forms.ToolStripTextBox> control by setting the <xref:System.Windows.Forms.ToolStripTextBox.MaxLength%2A> property to a specific number of characters. Use the <xref:System.Windows.Forms.ToolStripTextBox.CharacterCasing%2A> property to allow the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the <xref:System.Windows.Forms.ToolStripTextBox> control. + + To restrict text from being entered in a <xref:System.Windows.Forms.ToolStripTextBox> control, you can create an event handler for the <xref:System.Windows.Forms.Control.KeyDown> event in order to validate each character entered in the control. You can also restrict all entry of data in a <xref:System.Windows.Forms.ToolStripTextBox> control by setting the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnly%2A> property to `true`. + + + +## Examples + The following code example demonstrates a <xref:System.Windows.Forms.ToolStripTextBox> with various common property settings, including automatic completion options. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/toolstrip-control-windows-forms">ToolStrip Control (Windows Forms)</related> <related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2008/ms181005(v=vs.90)">ToolStrip Sample</related> </Docs> <Members> @@ -189,19 +189,19 @@ <value> <see langword="true" /> if the ENTER key creates a new line of text in a multiline version of the control; <see langword="false" /> if the ENTER key activates the default button for the form. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the value of this property is `false`, the user must press CTRL+ENTER to create a new line in a multiline <xref:System.Windows.Forms.ToolStripTextBox> control. If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsReturn%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the value of this property is `false`, the user must press CTRL+ENTER to create a new line in a multiline <xref:System.Windows.Forms.ToolStripTextBox> control. If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsReturn%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -239,19 +239,19 @@ <value> <see langword="true" /> if users can enter tabs in a multiline text box using the TAB key; <see langword="false" /> if pressing the TAB key moves the focus. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> property is set to `true`, the user must press CTRL+TAB to move the focus to the next control in the tab order. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> property is set to `true`, the user must press CTRL+TAB to move the focus to the next control in the tab order. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTab%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.AcceptsReturn" /> @@ -289,21 +289,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.AcceptsTab" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTabChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTabChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTabChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.AcceptsTabChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet612"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet612"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet612"::: + ]]></format> </remarks> </Docs> @@ -398,23 +398,23 @@ <summary>Gets or sets a custom string collection to use when the <see cref="P:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource" /> property is set to <see langword="CustomSource" />.</summary> <value>An <see cref="T:System.Windows.Forms.AutoCompleteStringCollection" /> to use with <see cref="P:System.Windows.Forms.TextBox.AutoCompleteSource" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. - - You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. + + You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource" /> @@ -461,23 +461,23 @@ <summary>Gets or sets an option that controls how automatic completion works for the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</summary> <value>One of the <see cref="T:System.Windows.Forms.AutoCompleteMode" /> values. The default is <see cref="F:System.Windows.Forms.AutoCompleteMode.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. - - You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. + + You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource" /> @@ -524,23 +524,23 @@ <summary>Gets or sets a value specifying the source of complete strings used for automatic completion.</summary> <value>One of the <see cref="T:System.Windows.Forms.AutoCompleteSource" /> values. The default is <see cref="F:System.Windows.Forms.AutoCompleteSource.None" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. - - You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>, <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A>, and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties to create a <xref:System.Windows.Forms.ToolStripTextBox> that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for <xref:System.Windows.Forms.ToolStripTextBox> controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A> property is optional, but you must set the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property to `CustomSource` in order to use <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource%2A>. + + You must use the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteMode%2A> and <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.AutoCompleteSource%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.AutoCompleteCustomSource" /> @@ -596,11 +596,11 @@ <summary>This property is not relevant to this class.</summary> <value>The background image displayed in the control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -649,11 +649,11 @@ <summary>This property is not relevant to this class.</summary> <value>An <see cref="T:System.Windows.Forms.ImageLayout" /> value.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -694,19 +694,19 @@ <summary>Gets or sets the border type of the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyle%2A> property to create borderless and flat style controls, in addition to the default three-dimensional control. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyle%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyle%2A> property to create borderless and flat style controls, in addition to the default three-dimensional control. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyle%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -743,21 +743,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.BorderStyle" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyleChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyleChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.BorderStyleChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet613"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet613"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet613"::: + ]]></format> </remarks> </Docs> @@ -803,11 +803,11 @@ <value> <see langword="true" /> if the user can undo the previous operation performed in a text box control; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this method returns `true`, you can call the <xref:System.Windows.Forms.ToolStripTextBox.Undo%2A> method to undo the last operation in a <xref:System.Windows.Forms.ToolStripTextBox>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this method returns `true`, you can call the <xref:System.Windows.Forms.ToolStripTextBox.Undo%2A> method to undo the last operation in a <xref:System.Windows.Forms.ToolStripTextBox>. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Cut" /> @@ -849,19 +849,19 @@ <summary>Gets or sets whether the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> control modifies the case of characters as they are typed.</summary> <value>One of the <see cref="T:System.Windows.Forms.CharacterCasing" /> values. The default is <see cref="F:System.Windows.Forms.CharacterCasing.Normal" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.TextBox.CharacterCasing%2A> property to change the case of characters as required by your application. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.CharacterCasing%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.TextBox.CharacterCasing%2A> property to change the case of characters as required by your application. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.CharacterCasing%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -925,11 +925,11 @@ <Docs> <summary>Clears information about the most recent operation from the undo buffer of the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to prevent an undo operation from repeating, based on the state of your application. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to prevent an undo operation from repeating, based on the state of your application. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Cut" /> @@ -965,11 +965,11 @@ <Docs> <summary>Copies the current selection in the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method, instead of using the <xref:System.Windows.Forms.Clipboard> class, to copy text in the <xref:System.Windows.Forms.ToolStripTextBox> and place it in the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method, instead of using the <xref:System.Windows.Forms.Clipboard> class, to copy text in the <xref:System.Windows.Forms.ToolStripTextBox> and place it in the Clipboard. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Cut" /> @@ -1033,11 +1033,11 @@ <Docs> <summary>Moves the current selection in the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> to the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method will only cut text from the <xref:System.Windows.Forms.ToolStripTextBox> if text is selected in the control. You can use this method, instead of using the <xref:System.Windows.Forms.Clipboard> class, to copy text in the <xref:System.Windows.Forms.ToolStripTextBox> and move it to the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method will only cut text from the <xref:System.Windows.Forms.ToolStripTextBox> if text is selected in the control. You can use this method, instead of using the <xref:System.Windows.Forms.Clipboard> class, to copy text in the <xref:System.Windows.Forms.ToolStripTextBox> and move it to the Clipboard. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Undo" /> @@ -1101,13 +1101,13 @@ <summary>Gets the default size of the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</summary> <value>The default <see cref="T:System.Drawing.Size" /> of the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> in pixels. The default size is 100 pixels by 25 pixels.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - + <format type="text/markdown"><![CDATA[ + +## Remarks + > [!NOTE] -> In order to maintain better performance, you should not set the <xref:System.Drawing.Size> of a <xref:System.Windows.Forms.ToolStripTextBox> in its constructor. The preferred method is to override the <xref:System.Windows.Forms.ToolStripTextBox.DefaultSize%2A> property. - +> In order to maintain better performance, you should not set the <xref:System.Drawing.Size> of a <xref:System.Windows.Forms.ToolStripTextBox> in its constructor. The preferred method is to override the <xref:System.Windows.Forms.ToolStripTextBox.DefaultSize%2A> property. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1173,14 +1173,14 @@ <summary>Retrieves the character that is closest to the specified location within the control.</summary> <returns>The character at the specified location.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the location specified in the `pt` parameter is outside the client area of the control, the first character of the string closest to the point specified in `pt` is returned. You can use this method to determine which characters are located near a specific point within the control. You can then use this value to perform operations on the text at that location. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the location specified in the `pt` parameter is outside the client area of the control, the first character of the string closest to the point specified in `pt` is returned. You can use this method to determine which characters are located near a specific point within the control. You can then use this value to perform operations on the text at that location. + > [!NOTE] -> If the specified location in the `pt` parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in `pt` is returned. - +> If the specified location in the `pt` parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in `pt` is returned. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.GetCharIndexFromPosition(System.Drawing.Point)" /> @@ -1219,11 +1219,11 @@ <summary>Retrieves the index of the character nearest to the specified location.</summary> <returns>The zero-based character index at the specified location.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method returns the character index that is closest to the position specified in the `pt` parameter. The character index is a zero-based index of text in the control, including spaces. You can use this method to determine where in the text the user has the mouse over by passing the mouse coordinates to this method. This can be useful if you want to perform tasks when the mouse pointer hovers over a word in the text of the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method returns the character index that is closest to the position specified in the `pt` parameter. The character index is a zero-based index of text in the control, including spaces. You can use this method to determine where in the text the user has the mouse over by passing the mouse coordinates to this method. This can be useful if you want to perform tasks when the mouse pointer hovers over a word in the text of the control. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.GetCharFromPosition(System.Drawing.Point)" /> @@ -1262,13 +1262,13 @@ <summary>Retrieves the index of the first character of a given line.</summary> <returns>The zero-based character index in the specified line.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the `lineNum` parameter is negative, <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns 0. If the `lineNum` parameter exceeds the number of lines in the control, <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns the first character index for the last line in the control. - - <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a <xref:System.Windows.Forms.RichTextBox> control and set <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> and <xref:System.Windows.Forms.ToolStripTextBox.WordWrap%2A> to `true`, the two long assigned lines result in four physical (or displayed lines). - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the `lineNum` parameter is negative, <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns 0. If the `lineNum` parameter exceeds the number of lines in the control, <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns the first character index for the last line in the control. + + <xref:System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine%2A> returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a <xref:System.Windows.Forms.RichTextBox> control and set <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> and <xref:System.Windows.Forms.ToolStripTextBox.WordWrap%2A> to `true`, the two long assigned lines result in four physical (or displayed lines). + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.GetCharIndexFromPosition(System.Drawing.Point)" /> @@ -1336,14 +1336,14 @@ <summary>Retrieves the line number from the specified character position within the text of the control.</summary> <returns>The zero-based line number in which the character index is located.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method enables you to determine the line number based on the character index specified in the `index` parameter of the method. The first line of text in the control returns the value zero. The <xref:System.Windows.Forms.ToolStripTextBox.GetLineFromCharIndex%2A> method returns the physical line number where the indexed character is located within the control. For example, if a portion of the first logical line of text in the control wraps to the next line, the <xref:System.Windows.Forms.ToolStripTextBox.GetLineFromCharIndex%2A> method returns 1 if the character at the specified character index has wrapped to the second physical line. If <xref:System.Windows.Forms.ToolStripTextBox.WordWrap%2A> is set to `false`, no portion of the line wraps to the next, and the method returns 0 for the specified character index. You can use this method to determine which line a specific character index is located within. For example, after calling the <xref:System.Windows.Forms.RichTextBox.Find%2A> method to search for text, you can obtain the character index to where the search results are found. You can call this method with the character index returned by the <xref:System.Windows.Forms.RichTextBox.Find%2A> method to determine which line the word was found. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method enables you to determine the line number based on the character index specified in the `index` parameter of the method. The first line of text in the control returns the value zero. The <xref:System.Windows.Forms.ToolStripTextBox.GetLineFromCharIndex%2A> method returns the physical line number where the indexed character is located within the control. For example, if a portion of the first logical line of text in the control wraps to the next line, the <xref:System.Windows.Forms.ToolStripTextBox.GetLineFromCharIndex%2A> method returns 1 if the character at the specified character index has wrapped to the second physical line. If <xref:System.Windows.Forms.ToolStripTextBox.WordWrap%2A> is set to `false`, no portion of the line wraps to the next, and the method returns 0 for the specified character index. You can use this method to determine which line a specific character index is located within. For example, after calling the <xref:System.Windows.Forms.RichTextBox.Find%2A> method to search for text, you can obtain the character index to where the search results are found. You can call this method with the character index returned by the <xref:System.Windows.Forms.RichTextBox.Find%2A> method to determine which line the word was found. + > [!NOTE] -> If the character index specified in the `index` parameter is beyond the available number of lines contained within the control, the last line number is returned. - +> If the character index specified in the `index` parameter is beyond the available number of lines contained within the control, the last line number is returned. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.GetCharIndexFromPosition(System.Drawing.Point)" /> @@ -1382,11 +1382,11 @@ <summary>Retrieves the location within the control at the specified character index.</summary> <returns>The location of the specified character.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method enables you to determine where in the control a specific character index is located. You can use this method for such tasks as displaying shortcut menu items or help information for a word in the control. For example, if you wanted to display a menu of options to the user when the user right clicks on a word in the control, you can use this method to determine the position of the word to properly display a <xref:System.Windows.Forms.ContextMenuStrip> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method enables you to determine where in the control a specific character index is located. You can use this method for such tasks as displaying shortcut menu items or help information for a word in the control. For example, if you wanted to display a menu of options to the user when the user right clicks on a word in the control, you can use this method to determine the position of the word to properly display a <xref:System.Windows.Forms.ContextMenuStrip> control. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.GetCharIndexFromPosition(System.Drawing.Point)" /> @@ -1461,19 +1461,19 @@ <value> <see langword="true" /> if the selected text does not appear highlighted when the text box control loses focus; <see langword="false" />, if the selected text remains highlighted when the text box control loses focus. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to keep text highlighted in a text box control while another form or a dialog box has focus, such as a spelling checker dialog box. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.HideSelection%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to keep text highlighted in a text box control while another form or a dialog box has focus, such as a spelling checker dialog box. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.HideSelection%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1510,21 +1510,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.HideSelection" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.HideSelectionChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.HideSelectionChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.HideSelectionChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.HideSelectionChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet614"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet614"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet614"::: + ]]></format> </remarks> </Docs> @@ -1577,11 +1577,11 @@ <summary>Gets or sets the lines of text in a <see cref="T:System.Windows.Forms.ToolStripTextBox" /> control.</summary> <value>An array of strings that contains the text in a text box control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Each element in the array becomes a line of text in the text box control. If the <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> property of the text box control is set to `true` and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Each element in the array becomes a line of text in the text box control. If the <xref:System.Windows.Forms.ToolStripTextBox.Multiline%2A> property of the text box control is set to `true` and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line. + ]]></format> </remarks> </Docs> @@ -1622,19 +1622,19 @@ <summary>Gets or sets the maximum number of characters the user can type or paste into the text box control.</summary> <value>The number of characters that can be entered into the control. The default is 32767 characters.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers, or to restrict the length of text entered when the data is to be entered in a database. You can limit the text entered into the control to the maximum length of the corresponding field in the database. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.MaxLength%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers, or to restrict the length of text entered when the data is to be entered in a database. You can limit the text entered into the control to the maximum length of the corresponding field in the database. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.MaxLength%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1680,11 +1680,11 @@ <value> <see langword="true" /> if the control's contents have been modified; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to determine if the user has modified the contents of the <xref:System.Windows.Forms.ToolStripTextBox> control. You can also set this property in code to indicate that changes were made to the <xref:System.Windows.Forms.ToolStripTextBox> control by the application. This property can be used by validation and data-saving methods to determine if changes were made in a <xref:System.Windows.Forms.ToolStripTextBox> control so the changed contents can be validated or saved. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to determine if the user has modified the contents of the <xref:System.Windows.Forms.ToolStripTextBox> control. You can also set this property in code to indicate that changes were made to the <xref:System.Windows.Forms.ToolStripTextBox> control by the application. This property can be used by validation and data-saving methods to determine if changes were made in a <xref:System.Windows.Forms.ToolStripTextBox> control so the changed contents can be validated or saved. + ]]></format> </remarks> </Docs> @@ -1721,21 +1721,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.Modified" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.ModifiedChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.ModifiedChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.ModifiedChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.ModifiedChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet615"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet615"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet615"::: + ]]></format> </remarks> </Docs> @@ -1793,11 +1793,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1842,11 +1842,11 @@ <Docs> <summary>This event is not relevant to this class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This event is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This event is not relevant to this class. + ]]></format> </remarks> </Docs> @@ -1880,13 +1880,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.AcceptsTabChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnAcceptsTabChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnAcceptsTabChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1923,13 +1923,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.BorderStyleChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnBorderStyleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnBorderStyleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -1966,13 +1966,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.HideSelectionChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnHideSelectionChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnHideSelectionChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2009,13 +2009,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.ModifiedChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnModifiedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnModifiedChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2052,13 +2052,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.MultilineChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnMultilineChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnMultilineChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2095,13 +2095,13 @@ <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.ToolStripTextBox.ReadOnlyChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.ToolStripTextBox.OnReadOnlyChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.ToolStripTextBox.OnReadOnlyChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2201,11 +2201,11 @@ <Docs> <summary>Replaces the current selection in the text box with the contents of the Clipboard.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolStripTextBox.Paste%2A> method will only paste text into the control if text is currently stored in the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolStripTextBox.Paste%2A> method will only paste text into the control if text is currently stored in the Clipboard. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Cut" /> @@ -2248,11 +2248,11 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolStripTextBox" /> is read-only; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When this property is set to `true`, the contents of the control cannot be changed by the user at runtime, but you can still change the contents in code. You can use this feature instead of disabling the control with the <xref:System.Windows.Forms.Control.Enabled%2A> property to allow the contents to be copied. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When this property is set to `true`, the contents of the control cannot be changed by the user at runtime, but you can still change the contents in code. You can use this feature instead of disabling the control with the <xref:System.Windows.Forms.Control.Enabled%2A> property to allow the contents to be copied. + ]]></format> </remarks> </Docs> @@ -2289,21 +2289,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.ReadOnly" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnlyChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnlyChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnlyChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.ReadOnlyChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet616"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet616"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet616"::: + ]]></format> </remarks> </Docs> @@ -2334,14 +2334,14 @@ <Docs> <summary>Scrolls the contents of the control to the current caret position.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method enables you to scroll the contents of the control until the caret is within the visible region of the control. If the caret is positioned below the visible region of the control, the <xref:System.Windows.Forms.ToolStripTextBox.ScrollToCaret%2A> method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method enables you to scroll the contents of the control until the caret is within the visible region of the control. If the caret is positioned below the visible region of the control, the <xref:System.Windows.Forms.ToolStripTextBox.ScrollToCaret%2A> method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control. + > [!NOTE] -> This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control. - +> This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control. + ]]></format> </remarks> </Docs> @@ -2377,14 +2377,14 @@ <param name="length">The number of characters to select.</param> <summary>Selects a range of text in the text box.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you want to set the start position to the first character in the control's text, set the `start` parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you want to set the start position to the first character in the control's text, set the `start` parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information. + > [!NOTE] -> You can programmatically move the caret within the text box by setting the `start` parameter to the position within the text box where you want the caret to move to and set the `length` parameter to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the `start` parameter to the position within the text box where you want the caret to move to and set the `length` parameter to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]></format> </remarks> </Docs> @@ -2415,11 +2415,11 @@ <Docs> <summary>Selects all text in the text box.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method enables you to select all text within the control. You can use this method with the <xref:System.Windows.Forms.TextBoxBase.Cut%2A> method, which requires text to be selected in the control, to cut the entire contents of the control and paste them into the Clipboard. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method enables you to select all text within the control. You can use this method with the <xref:System.Windows.Forms.TextBoxBase.Cut%2A> method, which requires text to be selected in the control, to cut the entire contents of the control and paste them into the Clipboard. + ]]></format> </remarks> </Docs> @@ -2464,11 +2464,11 @@ <summary>Gets or sets a value indicating the currently selected text in the control.</summary> <value>A string that represents the currently selected text in the text box.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can assign text to this property to change the text currently selected in the <xref:System.Windows.Forms.ToolStripTextBox>. If no text is currently selected in the <xref:System.Windows.Forms.ToolStripTextBox>, this property returns a zero-length string. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can assign text to this property to change the text currently selected in the <xref:System.Windows.Forms.ToolStripTextBox>. If no text is currently selected in the <xref:System.Windows.Forms.ToolStripTextBox>, this property returns a zero-length string. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.SelectionStart" /> @@ -2515,14 +2515,14 @@ <summary>Gets or sets the number of characters selected in the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</summary> <value>The number of characters selected in the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to determine if any characters are currently selected in the text box control before performing operations on the selected text. When the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is set to a value that is larger than the number of characters within the text of the control, the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is set to the entire length of text within the control minus the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property (if any value is specified for the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property). - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to determine if any characters are currently selected in the text box control before performing operations on the selected text. When the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is set to a value that is larger than the number of characters within the text of the control, the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is set to the entire length of text within the control minus the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property (if any value is specified for the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property). + > [!NOTE] -> You can programmatically move the caret within the text box by setting the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> to the position within the text box where you want the caret to move to and set the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> to the position within the text box where you want the caret to move to and set the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolStripTextBox.SelectionStart" /> @@ -2569,14 +2569,14 @@ <summary>Gets or sets the starting point of text selected in the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</summary> <value>The starting position of text selected in the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position will be placed after the last character. When text is selected in the text box control, changing this property might decrease the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property. If the remaining text in the control after the position indicated by the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property is less than the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property, the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is automatically decreased. The value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property never causes an increase in the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position will be placed after the last character. When text is selected in the text box control, changing this property might decrease the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property. If the remaining text in the control after the position indicated by the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property is less than the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property, the value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property is automatically decreased. The value of the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> property never causes an increase in the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property. + > [!NOTE] -> You can programmatically move the caret within the text box by setting the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> to the position within the text box where you want the caret to move to and set the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the <xref:System.Windows.Forms.ToolStripTextBox.SelectionStart%2A> to the position within the text box where you want the caret to move to and set the <xref:System.Windows.Forms.ToolStripTextBox.SelectionLength%2A> property to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]></format> </remarks> </Docs> @@ -2614,31 +2614,31 @@ <value> <see langword="true" /> to enable the shortcuts; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolStripTextBox.ShortcutsEnabled%2A> property to enable or disable the following shortcut key combinations: - -|Shortcut keys|Shortcut keys| -|-------------------|-------------------| -|CTRL+Z|CTRL+E| -|CTRL+C|CTRL+I| -|CTRL+X|CTRL+Y| -|CTRL+V|CTRL+BACKSPACE| -|CTRL+A|CTRL+DELETE| -|CTRL+L|SHIFT+DELETE| -|CTRL+R|SHIFT+INSERT| - - You can override this property to specify other shortcut keys. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.ShortcutsEnabled%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolStripTextBox.ShortcutsEnabled%2A> property to enable or disable the following shortcut key combinations: + +|Shortcut keys|Shortcut keys| +|-------------------|-------------------| +|CTRL+Z|CTRL+E| +|CTRL+C|CTRL+I| +|CTRL+X|CTRL+Y| +|CTRL+V|CTRL+BACKSPACE| +|CTRL+A|CTRL+DELETE| +|CTRL+L|SHIFT+DELETE| +|CTRL+R|SHIFT+INSERT| + + You can override this property to specify other shortcut keys. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.ShortcutsEnabled%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2721,19 +2721,19 @@ <summary>Gets or sets how text is aligned in a <see cref="T:System.Windows.Forms.TextBox" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.HorizontalAlignment" /> enumeration values that specifies how text is aligned in the control. The default is <see cref="F:System.Windows.Forms.HorizontalAlignment.Left" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property to align the text within a <xref:System.Windows.Forms.TextBox> to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlign%2A> property to <xref:System.Windows.Forms.HorizontalAlignment.Right>, and the text will be aligned with the right side of the control instead of the default left alignment. - - - -## Examples - The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlign%2A> property . - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property to align the text within a <xref:System.Windows.Forms.TextBox> to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlign%2A> property to <xref:System.Windows.Forms.HorizontalAlignment.Right>, and the text will be aligned with the right side of the control instead of the default left alignment. + + + +## Examples + The following code example demonstrates the syntax for setting various <xref:System.Windows.Forms.ToolStripTextBox> common property settings, including the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlign%2A> property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -2770,21 +2770,21 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlign" /> property changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlignChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlignChanged> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlignChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolStripTextBox> named `ToolStripTextBox1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolStripTextBox.TextBoxTextAlignChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet617"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet617"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet617"::: + ]]></format> </remarks> </Docs> @@ -2821,11 +2821,11 @@ <summary>Gets the length of text in the control.</summary> <value>The number of characters contained in the text of the <see cref="T:System.Windows.Forms.ToolStripTextBox" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use the <xref:System.Windows.Forms.ToolStripTextBox.TextLength%2A> property to determine the number of characters in a string for tasks such as searching for specific strings of text within the text of the control, where knowledge of the total number of characters is needed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use the <xref:System.Windows.Forms.ToolStripTextBox.TextLength%2A> property to determine the number of characters in a string for tasks such as searching for specific strings of text within the text of the control, where knowledge of the total number of characters is needed. + ]]></format> </remarks> </Docs> @@ -2856,11 +2856,11 @@ <Docs> <summary>Undoes the last edit operation in the text box.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method will undo the last clipboard or text change operation performed in the text box control if the <xref:System.Windows.Forms.TextBoxBase.CanUndo%2A> property returns `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method will undo the last clipboard or text change operation performed in the text box control if the <xref:System.Windows.Forms.TextBoxBase.CanUndo%2A> property returns `true`. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolStripTextBox.Cut" /> @@ -2915,11 +2915,11 @@ <value> <see langword="true" /> if enabled; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property is not relevant to this class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property is not relevant to this class. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows.Forms/ToolTip.xml b/xml/System.Windows.Forms/ToolTip.xml index 12b8663095c..91bd67b5ec8 100644 --- a/xml/System.Windows.Forms/ToolTip.xml +++ b/xml/System.Windows.Forms/ToolTip.xml @@ -50,44 +50,44 @@ <Docs> <summary>Represents a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip> class, you can provide hints to a user when the user places the pointer on a control. The <xref:System.Windows.Forms.ToolTip> class is typically used to alert users to the intended use of a control. For example, you can specify ToolTip text for a <xref:System.Windows.Forms.TextBox> control that accepts a name, specifying the format of the name to be typed into the control. In addition to providing hints, you can also use the <xref:System.Windows.Forms.ToolTip> class to provide run time status information. For example, you can use the <xref:System.Windows.Forms.ToolTip> class to display connection speed and line quality data when the user moves the pointer onto a <xref:System.Windows.Forms.PictureBox> control that displays Internet connection status. - - The <xref:System.Windows.Forms.ToolTip> class can be used in any container. To explicitly specify a container, use the <xref:System.Windows.Forms.ToolTip.%23ctor%28System.ComponentModel.IContainer%29> constructor. A single <xref:System.Windows.Forms.ToolTip> component typically is used to create ToolTips for multiple controls on a single form. After you create a <xref:System.Windows.Forms.ToolTip>, use a separate call to the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method to associate ToolTip display text to an individual control. Then when the user moves the pointer on a control, the ToolTip with its text is displayed. You can call <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> more than once for the same control to change the text that is associated with the control. To get the text that is associated with a control, use the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method. To remove all ToolTip text associations with an instance of the <xref:System.Windows.Forms.ToolTip> class, use the <xref:System.Windows.Forms.ToolTip.RemoveAll%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip> class, you can provide hints to a user when the user places the pointer on a control. The <xref:System.Windows.Forms.ToolTip> class is typically used to alert users to the intended use of a control. For example, you can specify ToolTip text for a <xref:System.Windows.Forms.TextBox> control that accepts a name, specifying the format of the name to be typed into the control. In addition to providing hints, you can also use the <xref:System.Windows.Forms.ToolTip> class to provide run time status information. For example, you can use the <xref:System.Windows.Forms.ToolTip> class to display connection speed and line quality data when the user moves the pointer onto a <xref:System.Windows.Forms.PictureBox> control that displays Internet connection status. + + The <xref:System.Windows.Forms.ToolTip> class can be used in any container. To explicitly specify a container, use the <xref:System.Windows.Forms.ToolTip.%23ctor%28System.ComponentModel.IContainer%29> constructor. A single <xref:System.Windows.Forms.ToolTip> component typically is used to create ToolTips for multiple controls on a single form. After you create a <xref:System.Windows.Forms.ToolTip>, use a separate call to the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method to associate ToolTip display text to an individual control. Then when the user moves the pointer on a control, the ToolTip with its text is displayed. You can call <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> more than once for the same control to change the text that is associated with the control. To get the text that is associated with a control, use the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method. To remove all ToolTip text associations with an instance of the <xref:System.Windows.Forms.ToolTip> class, use the <xref:System.Windows.Forms.ToolTip.RemoveAll%2A> method. + > [!NOTE] -> ToolTip text is not displayed for controls that are disabled. Unless the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property is set to `true`, ToolTips are not displayed when their container is inactive. - - The <xref:System.Windows.Forms.ToolTip> class provides the following properties and methods to modify the default behavior and appearance of a ToolTip. - -|Category|Associated members| -|--------------|------------------------| -|Manual display|<xref:System.Windows.Forms.ToolTip.Active%2A>, <xref:System.Windows.Forms.ToolTip.Show%2A>, <xref:System.Windows.Forms.ToolTip.Hide%2A>, <xref:System.Windows.Forms.ToolTip.ShowAlways%2A>, <xref:System.Windows.Forms.ToolTip.Popup>, <xref:System.Windows.Forms.ToolTip.StopTimer%2A>| -|ToolTip timing|<xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A>, <xref:System.Windows.Forms.ToolTip.StopTimer%2A>| -|Content|<xref:System.Windows.Forms.ToolTip.SetToolTip%2A>, <xref:System.Windows.Forms.ToolTip.GetToolTip%2A>, <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A>, <xref:System.Windows.Forms.ToolTip.ToolTipIcon%2A>, <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A>, <xref:System.Windows.Forms.ToolTip.RemoveAll%2A>| -|Appearance|<xref:System.Windows.Forms.ToolTip.BackColor%2A>, <xref:System.Windows.Forms.ToolTip.ForeColor%2A>, <xref:System.Windows.Forms.ToolTip.IsBalloon%2A>, <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A>, <xref:System.Windows.Forms.ToolTip.UseAnimation%2A>, <xref:System.Windows.Forms.ToolTip.UseFading%2A>| - - If you want to disable all ToolTip text so that it cannot be displayed in your application, you can use the <xref:System.Windows.Forms.ToolTip.Active%2A> property. Usually the ToolTip is drawn by the operating system, but to customize the appearance of the <xref:System.Windows.Forms.ToolTip>, you can set the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handle the <xref:System.Windows.Forms.ToolTip.Draw> event. - - The <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A> class implements the <xref:System.ComponentModel.IExtenderProvider?displayProperty=nameWithType> interface, which has a single method, <xref:System.Windows.Forms.ToolTip.CanExtend%2A>. ToolTips extend controls on the same form at design time, adding a `ToolTip` property. For more information about extender providers, see [Extender Providers](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ms171835(v=vs.120)). - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - +> ToolTip text is not displayed for controls that are disabled. Unless the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property is set to `true`, ToolTips are not displayed when their container is inactive. + + The <xref:System.Windows.Forms.ToolTip> class provides the following properties and methods to modify the default behavior and appearance of a ToolTip. + +|Category|Associated members| +|--------------|------------------------| +|Manual display|<xref:System.Windows.Forms.ToolTip.Active%2A>, <xref:System.Windows.Forms.ToolTip.Show%2A>, <xref:System.Windows.Forms.ToolTip.Hide%2A>, <xref:System.Windows.Forms.ToolTip.ShowAlways%2A>, <xref:System.Windows.Forms.ToolTip.Popup>, <xref:System.Windows.Forms.ToolTip.StopTimer%2A>| +|ToolTip timing|<xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A>, <xref:System.Windows.Forms.ToolTip.StopTimer%2A>| +|Content|<xref:System.Windows.Forms.ToolTip.SetToolTip%2A>, <xref:System.Windows.Forms.ToolTip.GetToolTip%2A>, <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A>, <xref:System.Windows.Forms.ToolTip.ToolTipIcon%2A>, <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A>, <xref:System.Windows.Forms.ToolTip.RemoveAll%2A>| +|Appearance|<xref:System.Windows.Forms.ToolTip.BackColor%2A>, <xref:System.Windows.Forms.ToolTip.ForeColor%2A>, <xref:System.Windows.Forms.ToolTip.IsBalloon%2A>, <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A>, <xref:System.Windows.Forms.ToolTip.UseAnimation%2A>, <xref:System.Windows.Forms.ToolTip.UseFading%2A>| + + If you want to disable all ToolTip text so that it cannot be displayed in your application, you can use the <xref:System.Windows.Forms.ToolTip.Active%2A> property. Usually the ToolTip is drawn by the operating system, but to customize the appearance of the <xref:System.Windows.Forms.ToolTip>, you can set the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handle the <xref:System.Windows.Forms.ToolTip.Draw> event. + + The <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A> class implements the <xref:System.ComponentModel.IExtenderProvider?displayProperty=nameWithType> interface, which has a single method, <xref:System.Windows.Forms.ToolTip.CanExtend%2A>. ToolTips extend controls on the same form at design time, adding a `ToolTip` property. For more information about extender providers, see [Extender Providers](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ms171835(v=vs.120)). + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolTipIcon" /> <altmember cref="T:System.Windows.Forms.HelpProvider" /> <related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ms171835(v=vs.120)">Extender Providers</related> - <related type="Article" href="/dotnet/framework/winforms/controls/tooltip-component-windows-forms">ToolTip Component (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/tooltip-component-windows-forms">ToolTip Component (Windows Forms)</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -122,20 +122,20 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolTip" /> without a specified container.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This constructor creates an instance of a ToolTip not associated with any container. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This constructor creates an instance of a ToolTip not associated with any container. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.Form" /> @@ -169,11 +169,11 @@ <param name="cont">An <see cref="T:System.ComponentModel.IContainer" /> that represents the container of the <see cref="T:System.Windows.Forms.ToolTip" />.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolTip" /> class with a specified container.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip> constructor enables you to associate a <xref:System.Windows.Forms.ToolTip> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ToolTip> in this manner, you hand over control of the lifetime of the ToolTip to the <xref:System.ComponentModel.Container>. This can be useful if you use several components in your application, and want to dispose of all of them at the same time. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the <xref:System.ComponentModel.Container> will also force disposal of all of these components. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip> constructor enables you to associate a <xref:System.Windows.Forms.ToolTip> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ToolTip> in this manner, you hand over control of the lifetime of the ToolTip to the <xref:System.ComponentModel.Container>. This can be useful if you use several components in your application, and want to dispose of all of them at the same time. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the <xref:System.ComponentModel.Container> will also force disposal of all of these components. + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.Container" /> @@ -217,11 +217,11 @@ <value> <see langword="true" /> if the ToolTip is currently active; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip.Active%2A> property, you can enable or disable the display of ToolTip text for all controls that have text specified by this particular <xref:System.Windows.Forms.ToolTip> component. Although more than one <xref:System.Windows.Forms.ToolTip> component can be created and assigned to a form, setting the <xref:System.Windows.Forms.ToolTip.Active%2A> property to `false` only affects the current <xref:System.Windows.Forms.ToolTip>. You can enable users to set the value of this property in a form that provides application options. These options, in turn, provide the user with the ability to enable or disable the display of ToolTips in your application. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip.Active%2A> property, you can enable or disable the display of ToolTip text for all controls that have text specified by this particular <xref:System.Windows.Forms.ToolTip> component. Although more than one <xref:System.Windows.Forms.ToolTip> component can be created and assigned to a form, setting the <xref:System.Windows.Forms.ToolTip.Active%2A> property to `false` only affects the current <xref:System.Windows.Forms.ToolTip>. You can enable users to set the value of this property in a form that provides application options. These options, in turn, provide the user with the ability to enable or disable the display of ToolTips in your application. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.Hide(System.Windows.Forms.IWin32Window)" /> @@ -271,19 +271,19 @@ <summary>Gets or sets the automatic delay for the ToolTip.</summary> <value>The automatic delay, in milliseconds. The default is 500.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property enables you to set a single delay value, which is then used to set the values of the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> properties. Each time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the following values are set by default. - -|Property|Default Value| -|--------------|-------------------| -|<xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>|10 times the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| -|<xref:System.Windows.Forms.ToolTip.InitialDelay%2A>|Equal to the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| -|<xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>|1/5 of the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| - - These properties can also be set independently once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property has been set. For more information, see the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> properties. This property is typically used to provide a consistent delay pattern for your ToolTip windows. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property enables you to set a single delay value, which is then used to set the values of the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> properties. Each time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the following values are set by default. + +|Property|Default Value| +|--------------|-------------------| +|<xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>|10 times the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| +|<xref:System.Windows.Forms.ToolTip.InitialDelay%2A>|Equal to the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| +|<xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>|1/5 of the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value.| + + These properties can also be set independently once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property has been set. For more information, see the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> properties. This property is typically used to provide a consistent delay pattern for your ToolTip windows. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.AutoPopDelay" /> @@ -330,24 +330,24 @@ <summary>Gets or sets the period of time the ToolTip remains visible if the pointer is stationary on a control with specified ToolTip text.</summary> <value>The period of time, in milliseconds, that the <see cref="T:System.Windows.Forms.ToolTip" /> remains visible when the pointer is stationary on a control. The default value is 5000.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property enables you to shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> window is displayed when the pointer is on a control. For example, if you display extensive Help in a ToolTip window, you can increase the value of this property to ensure that the user has sufficient time to read the text. - - If you want to have a consistent delay pattern for your ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property is set to 10 times the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property, overriding the default value. - - The maximum time you can delay a popup is 5000 milliseconds. For longer durations, use the <xref:System.Windows.Forms.ToolTip.Show%2A> method to control the exact moment when the ToolTip is displayed. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property enables you to shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> window is displayed when the pointer is on a control. For example, if you display extensive Help in a ToolTip window, you can increase the value of this property to ensure that the user has sufficient time to read the text. + + If you want to have a consistent delay pattern for your ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property is set to 10 times the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property, overriding the default value. + + The maximum time you can delay a popup is 5000 milliseconds. For longer durations, use the <xref:System.Windows.Forms.ToolTip.Show%2A> method to control the exact moment when the ToolTip is displayed. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.AutomaticDelay" /> @@ -393,13 +393,13 @@ <summary>Gets or sets the background color for the ToolTip.</summary> <value>The background <see cref="T:System.Drawing.Color" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Unless the ToolTip is owner-drawn, this property is ignored. - - The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Unless the ToolTip is owner-drawn, this property is ignored. + + The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.ForeColor" /> @@ -443,11 +443,11 @@ <returns> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolTip" /> class can offer one or more extender properties; otherwise, <see langword="false" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip.CanExtend%2A> method is the only member of the <xref:System.ComponentModel.IExtenderProvider?displayProperty=nameWithType> interface. This method returns `true` if the `target` parameter is of type <xref:System.Windows.Forms.Control>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip.CanExtend%2A> method is the only member of the <xref:System.ComponentModel.IExtenderProvider?displayProperty=nameWithType> interface. This method returns `true` if the `target` parameter is of type <xref:System.Windows.Forms.Control>. + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.IExtenderProvider" /> @@ -479,14 +479,14 @@ <summary>Gets the creation parameters for the ToolTip window.</summary> <value>A <see cref="T:System.Windows.Forms.CreateParams" /> containing the information needed to create the ToolTip.</value> <remarks> - <format type="text/markdown"><, [CreateWindowEx](/windows/win32/api/winuser/nf-winuser-createwindowexa), and [CREATESTRUCT](/windows/win32/api/winuser/ns-winuser-createstructa). - + > [!NOTE] -> When overriding the <xref:System.Windows.Forms.ToolTip.CreateParams%2A> property in a derived class, use the base class's <xref:System.Windows.Forms.ToolTip.CreateParams%2A> property to extend the base implementation. - +> When overriding the <xref:System.Windows.Forms.ToolTip.CreateParams%2A> property in a derived class, use the base class's <xref:System.Windows.Forms.ToolTip.CreateParams%2A> property to extend the base implementation. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.CreateParams" /> @@ -558,24 +558,24 @@ <Docs> <summary>Occurs when the ToolTip is drawn and the <see cref="P:System.Windows.Forms.ToolTip.OwnerDraw" /> property is set to <see langword="true" /> and the <see cref="P:System.Windows.Forms.ToolTip.IsBalloon" /> property is <see langword="false" />.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to custom draw the <xref:System.Windows.Forms.ToolTip>. The example creates a <xref:System.Windows.Forms.ToolTip> and associates it to three <xref:System.Windows.Forms.Button> controls located on the <xref:System.Windows.Forms.Form>. The example sets the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handles the <xref:System.Windows.Forms.ToolTip.Draw> event. In the <xref:System.Windows.Forms.ToolTip.Draw> event handler, the <xref:System.Windows.Forms.ToolTip> is custom drawn differently, depending on what button the <xref:System.Windows.Forms.ToolTip> is being displayed for as indicated by the <xref:System.Windows.Forms.DrawToolTipEventArgs.AssociatedControl%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to custom draw the <xref:System.Windows.Forms.ToolTip>. The example creates a <xref:System.Windows.Forms.ToolTip> and associates it to three <xref:System.Windows.Forms.Button> controls located on the <xref:System.Windows.Forms.Form>. The example sets the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handles the <xref:System.Windows.Forms.ToolTip.Draw> event. In the <xref:System.Windows.Forms.ToolTip.Draw> event handler, the <xref:System.Windows.Forms.ToolTip> is custom drawn differently, depending on what button the <xref:System.Windows.Forms.ToolTip> is being displayed for as indicated by the <xref:System.Windows.Forms.DrawToolTipEventArgs.AssociatedControl%2A?displayProperty=nameWithType> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DrawToolTipEventArgs/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.OwnerDraw" /> @@ -614,11 +614,11 @@ <Docs> <summary>Releases the unmanaged resources and performs other cleanup operations before the <see cref="T:System.Windows.Forms.Cursor" /> is reclaimed by the garbage collector.</summary> <remarks> - <format type="text/markdown"><), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). - + <format type="text/markdown"><), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.Dispose(System.Boolean)" /> @@ -662,11 +662,11 @@ <summary>Gets or sets the foreground color for the ToolTip.</summary> <value>The foreground <see cref="T:System.Drawing.Color" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.ToolTip.BackColor%2A> and <xref:System.Windows.Forms.ToolTip.ForeColor%2A> properties to modify the color scheme used by ToolTips. The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.ToolTip.BackColor%2A> and <xref:System.Windows.Forms.ToolTip.ForeColor%2A> properties to modify the color scheme used by ToolTips. The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.BackColor" /> @@ -729,11 +729,11 @@ <summary>Retrieves the ToolTip text associated with the specified control.</summary> <returns>A <see cref="T:System.String" /> containing the ToolTip text for the specified control.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method, you can retrieve the ToolTip text for any control. If the ToolTip text changes dynamically in an application, you can use this method to find out what text is displayed at any point, depending on the state of the application. To change the text that a control is displaying, use the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method, you can retrieve the ToolTip text for any control. If the ToolTip text changes dynamically in an application, you can use this method to find out what text is displayed at any point, depending on the state of the application. To change the text that a control is displaying, use the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.SetToolTip(System.Windows.Forms.Control,System.String)" /> @@ -772,13 +772,13 @@ <param name="win">The <see cref="T:System.Windows.Forms.IWin32Window" /> of the associated window or control that the ToolTip is associated with.</param> <summary>Hides the specified ToolTip window.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip.Hide%2A> method hides the ToolTip for the specified <xref:System.Windows.Forms.Control> if it is currently being displayed. It does not disable or otherwise prevent the same ToolTip from being displayed in the future. To instead disable all ToolTip windows associated with the current <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A> component, set the <xref:System.Windows.Forms.ToolTip.Active%2A> property to `false`. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Hide%2A> can hide the tip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip.Hide%2A> method hides the ToolTip for the specified <xref:System.Windows.Forms.Control> if it is currently being displayed. It does not disable or otherwise prevent the same ToolTip from being displayed in the future. To instead disable all ToolTip windows associated with the current <xref:System.Windows.Forms.ToolTip.ToolTipTitle%2A> component, set the <xref:System.Windows.Forms.ToolTip.Active%2A> property to `false`. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Hide%2A> can hide the tip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException"> @@ -833,24 +833,24 @@ <summary>Gets or sets the time that passes before the ToolTip appears.</summary> <value>The period of time, in milliseconds, that the pointer must remain stationary on a control before the ToolTip window is displayed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property, you can shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> waits before displaying a ToolTip window. If the value of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is set to a value that is too long in duration, the user of your application might not know that your application provides ToolTip Help. You can use this property to ensure that the user has ToolTips displayed quickly by shortening the time specified. - - The value for this property cannot exceed 32767. - - If you want to have a consistent delay pattern for your ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single time value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is set to the same value as the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property, overriding the default value. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property, you can shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> waits before displaying a ToolTip window. If the value of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is set to a value that is too long in duration, the user of your application might not know that your application provides ToolTip Help. You can use this property to ensure that the user has ToolTips displayed quickly by shortening the time specified. + + The value for this property cannot exceed 32767. + + If you want to have a consistent delay pattern for your ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single time value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is set to the same value as the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property, overriding the default value. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.AutomaticDelay" /> @@ -897,11 +897,11 @@ <value> <see langword="true" /> if a balloon window should be used; otherwise, <see langword="false" /> if a standard rectangular window should be used. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, ToolTips are displayed using bare rectangular windows. By setting the <xref:System.Windows.Forms.ToolTip.IsBalloon%2A> property to `true`, the ToolTip will be displayed using a balloon window. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, ToolTips are displayed using bare rectangular windows. By setting the <xref:System.Windows.Forms.ToolTip.IsBalloon%2A> property to `true`, the ToolTip will be displayed using a balloon window. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.BackColor" /> @@ -955,22 +955,22 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.ToolTip" /> is drawn by code that you provide; <see langword="false" /> if the <see cref="T:System.Windows.Forms.ToolTip" /> is drawn by the operating system. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Usually, a <xref:System.Windows.Forms.ToolTip> is drawn by the operating system, but to customize the appearance of the <xref:System.Windows.Forms.ToolTip> you can set the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handle the <xref:System.Windows.Forms.ToolTip.Draw> event. - - The <xref:System.Windows.Forms.ToolTip.IsBalloon%2A> property takes precedence over the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. If both are set to `true`, the <xref:System.Windows.Forms.ToolTip> will be displayed using a balloon window rather than an owner drawn window. - - - -## Examples - The following code example demonstrates how to owner draw the <xref:System.Windows.Forms.ToolTip>. The example creates a <xref:System.Windows.Forms.ToolTip> and associates it to three <xref:System.Windows.Forms.Button> controls located on the <xref:System.Windows.Forms.Form>. The example sets the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handles the <xref:System.Windows.Forms.ToolTip.Draw> event. In the <xref:System.Windows.Forms.ToolTip.Draw> event handler, the <xref:System.Windows.Forms.ToolTip> is custom drawn differently depending upon what button the <xref:System.Windows.Forms.ToolTip> is being displayed for as indicated by the <xref:System.Windows.Forms.DrawToolTipEventArgs.AssociatedControl%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Usually, a <xref:System.Windows.Forms.ToolTip> is drawn by the operating system, but to customize the appearance of the <xref:System.Windows.Forms.ToolTip> you can set the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handle the <xref:System.Windows.Forms.ToolTip.Draw> event. + + The <xref:System.Windows.Forms.ToolTip.IsBalloon%2A> property takes precedence over the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. If both are set to `true`, the <xref:System.Windows.Forms.ToolTip> will be displayed using a balloon window rather than an owner drawn window. + + + +## Examples + The following code example demonstrates how to owner draw the <xref:System.Windows.Forms.ToolTip>. The example creates a <xref:System.Windows.Forms.ToolTip> and associates it to three <xref:System.Windows.Forms.Button> controls located on the <xref:System.Windows.Forms.Form>. The example sets the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property to `true` and handles the <xref:System.Windows.Forms.ToolTip.Draw> event. In the <xref:System.Windows.Forms.ToolTip.Draw> event handler, the <xref:System.Windows.Forms.ToolTip> is custom drawn differently depending upon what button the <xref:System.Windows.Forms.ToolTip> is being displayed for as indicated by the <xref:System.Windows.Forms.DrawToolTipEventArgs.AssociatedControl%2A?displayProperty=nameWithType> property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DrawToolTipEventArgs/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.BackColor" /> @@ -1013,23 +1013,23 @@ <Docs> <summary>Occurs before a ToolTip is initially displayed. This is the default event for the <see cref="T:System.Windows.Forms.ToolTip" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip.Popup> event is raised whenever a ToolTip is displayed, either through an explicit call to one of the <xref:System.Windows.Forms.ToolTip.Show%2A> methods or when the <xref:System.Windows.Forms.ToolTip> class implicitly displays a ToolTip. This event can be canceled. - - Calling properties in this event that cause the underlying window handle to be recreated, such as <xref:System.Windows.Forms.ToolTip.IsBalloon%2A>, will result in an exception being thrown. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolTip.Popup> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolTip> named `ToolTip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolTip.Popup> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip.Popup> event is raised whenever a ToolTip is displayed, either through an explicit call to one of the <xref:System.Windows.Forms.ToolTip.Show%2A> methods or when the <xref:System.Windows.Forms.ToolTip> class implicitly displays a ToolTip. This event can be canceled. + + Calling properties in this event that cause the underlying window handle to be recreated, such as <xref:System.Windows.Forms.ToolTip.IsBalloon%2A>, will result in an exception being thrown. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ToolTip.Popup> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ToolTip> named `ToolTip1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ToolTip.Popup> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet619"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet619"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet619"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.InitialDelay" /> @@ -1067,11 +1067,11 @@ <Docs> <summary>Removes all ToolTip text currently associated with the ToolTip component.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to remove all ToolTip text that is associated with the <xref:System.Windows.Forms.ToolTip> component for all associated controls. To disable the display of text instead, use the <xref:System.Windows.Forms.ToolTip.Active%2A> property. To change the text for a single associated control, use the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to remove all ToolTip text that is associated with the <xref:System.Windows.Forms.ToolTip> component for all associated controls. To disable the display of text instead, use the <xref:System.Windows.Forms.ToolTip.Active%2A> property. To change the text for a single associated control, use the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.Hide(System.Windows.Forms.IWin32Window)" /> @@ -1120,22 +1120,22 @@ <summary>Gets or sets the length of time that must transpire before subsequent ToolTip windows appear as the pointer moves from one control to another.</summary> <value>The length of time, in milliseconds, that it takes subsequent ToolTip windows to appear.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property, you can shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> waits before displaying a ToolTip window after a previous ToolTip window is displayed. The first time a ToolTip window is displayed, the value of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is used to determine the delay to apply before initially showing the ToolTip window. When a ToolTip window is currently being displayed and the user moves the pointer to another control that displays a ToolTip window, the value of the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property is used before showing the ToolTip for the new control. The ToolTip window from the previous control must still be displayed in order for the delay specified in the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property to be used; otherwise the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property value is used. - - If you want to have a consistent delay pattern for ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single time value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property is set to 1/5 of the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property, overriding the default value. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property, you can shorten or lengthen the time that the <xref:System.Windows.Forms.ToolTip> waits before displaying a ToolTip window after a previous ToolTip window is displayed. The first time a ToolTip window is displayed, the value of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property is used to determine the delay to apply before initially showing the ToolTip window. When a ToolTip window is currently being displayed and the user moves the pointer to another control that displays a ToolTip window, the value of the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property is used before showing the ToolTip for the new control. The ToolTip window from the previous control must still be displayed in order for the delay specified in the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property to be used; otherwise the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> property value is used. + + If you want to have a consistent delay pattern for ToolTip windows, you can set the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property sets the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>, and <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> properties to initial values based on a single time value. Every time the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property is set to 1/5 of the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property value. Once the <xref:System.Windows.Forms.ToolTip.AutomaticDelay%2A> property is set, you can independently set the <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A> property, overriding the default value. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1,` and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.AutomaticDelay" /> @@ -1185,22 +1185,22 @@ <param name="caption">The ToolTip text to display when the pointer is on the control.</param> <summary>Associates ToolTip text with the specified control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - In addition to specifying the ToolTip text to display for a control, you can also use this method to modify the ToolTip text for a control. Calling the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method more than once for a given control does not specify multiple ToolTip text to display for a control, but instead changes the current ToolTip text for the control. To determine the ToolTip text that is associated with a control at run time, use the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method. - - As a general rule the text used should be short; however, you can insert line breaks by using the `\r\n` escape character sequence. Ampersands (&) in the text are handled as described by the <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A> property. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. This example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + In addition to specifying the ToolTip text to display for a control, you can also use this method to modify the ToolTip text for a control. Calling the <xref:System.Windows.Forms.ToolTip.SetToolTip%2A> method more than once for a given control does not specify multiple ToolTip text to display for a control, but instead changes the current ToolTip text for the control. To determine the ToolTip text that is associated with a control at run time, use the <xref:System.Windows.Forms.ToolTip.GetToolTip%2A> method. + + As a general rule the text used should be short; however, you can insert line breaks by using the `\r\n` escape character sequence. Ampersands (&) in the text are handled as described by the <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A> property. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. This example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.GetToolTip(System.Windows.Forms.Control)" /> @@ -1258,13 +1258,13 @@ <param name="window">The <see cref="T:System.Windows.Forms.Control" /> to display the ToolTip for.</param> <summary>Sets the ToolTip text associated with the specified control, and displays the ToolTip modally.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The version of the <xref:System.Windows.Forms.ToolTip.Show%2A> method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called, or until the parent form is minimized, hidden, or closed. The ToolTip is positioned in the center of the associated control. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The version of the <xref:System.Windows.Forms.ToolTip.Show%2A> method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called, or until the parent form is minimized, hidden, or closed. The ToolTip is positioned in the center of the associated control. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">The <paramref name="window" /> parameter is <see langword="null" />.</exception> @@ -1320,13 +1320,13 @@ <param name="point">A <see cref="T:System.Drawing.Point" /> containing the offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.</param> <summary>Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `pt` parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. The version of the <xref:System.Windows.Forms.ToolTip.Show%2A> method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called, or until the parent form is minimized, hidden, or dismissed. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `pt` parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. The version of the <xref:System.Windows.Forms.ToolTip.Show%2A> method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called, or until the parent form is minimized, hidden, or dismissed. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">The <paramref name="window" /> parameter is <see langword="null" />.</exception> @@ -1382,13 +1382,13 @@ <param name="duration">An <see cref="T:System.Int32" /> containing the duration, in milliseconds, to display the ToolTip.</param> <summary>Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The ToolTip is positioned in the center of the associated control represented by the `win` parameter. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%29> overloaded version of this method instead. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The ToolTip is positioned in the center of the associated control represented by the `win` parameter. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%29> overloaded version of this method instead. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">The <paramref name="window" /> parameter is <see langword="null" />.</exception> @@ -1448,13 +1448,13 @@ <param name="duration">An <see cref="T:System.Int32" /> containing the duration, in milliseconds, to display the ToolTip.</param> <summary>Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `pt` parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. The ToolTip is positioned in the center of the associated control. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%29> overloaded version of this method instead. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `pt` parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. The ToolTip is positioned in the center of the associated control. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%29> overloaded version of this method instead. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">The <paramref name="window" /> parameter is <see langword="null" />.</exception> @@ -1514,13 +1514,13 @@ <param name="y">The vertical offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.</param> <summary>Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the overloaded <xref:System.Windows.Forms.ToolTip.Show%2A> method operates identically to the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%29> version, except that the offset is specified as separate x- and y-coordinates instead of a <xref:System.Drawing.Point>. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the overloaded <xref:System.Windows.Forms.ToolTip.Show%2A> method operates identically to the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%29> version, except that the offset is specified as separate x- and y-coordinates instead of a <xref:System.Drawing.Point>. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.Hide(System.Windows.Forms.IWin32Window)" /> @@ -1579,13 +1579,13 @@ <param name="duration">An <see cref="T:System.Int32" /> containing the duration, in milliseconds, to display the ToolTip.</param> <summary>Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This version of the overloaded <xref:System.Windows.Forms.ToolTip.Show%2A> method operates identically to the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%2CSystem.Int32%29> version, except that the offset is specified as separate x and y coordinates instead of a <xref:System.Drawing.Point>. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Int32%2CSystem.Int32%29> overloaded version of this method instead. - - Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This version of the overloaded <xref:System.Windows.Forms.ToolTip.Show%2A> method operates identically to the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Drawing.Point%2CSystem.Int32%29> version, except that the offset is specified as separate x and y coordinates instead of a <xref:System.Drawing.Point>. To display the ToolTip modally, call the <xref:System.Windows.Forms.ToolTip.Show%28System.String%2CSystem.Windows.Forms.IWin32Window%2CSystem.Int32%2CSystem.Int32%29> overloaded version of this method instead. + + Applications running in partial trust must assert the <xref:System.Security.Permissions.UIPermissionWindow.AllWindows> permission to use this method, as <xref:System.Windows.Forms.ToolTip.Show%2A> can control the display and location of a ToolTip independent of user action. + ]]></format> </remarks> <exception cref="T:System.ArgumentNullException">The <paramref name="window" /> parameter is <see langword="null" />.</exception> @@ -1644,20 +1644,20 @@ <value> <see langword="true" /> if the ToolTip is always displayed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - With the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property, you can display a ToolTip window even when the container of the <xref:System.Windows.Forms.ToolTip> is not active. You can use this feature in a modeless window application to enable ToolTip windows to be displayed regardless of which modeless window is active. This feature is also useful when you want to create a control by using the <xref:System.Windows.Forms.UserControl>, which contains a number of controls within it that display ToolTip windows. Because the <xref:System.Windows.Forms.UserControl> is often not the active window on a form, setting this property to `true` enables the controls within the <xref:System.Windows.Forms.UserControl> to display ToolTip windows at any time. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + With the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property, you can display a ToolTip window even when the container of the <xref:System.Windows.Forms.ToolTip> is not active. You can use this feature in a modeless window application to enable ToolTip windows to be displayed regardless of which modeless window is active. This feature is also useful when you want to create a control by using the <xref:System.Windows.Forms.UserControl>, which contains a number of controls within it that display ToolTip windows. Because the <xref:System.Windows.Forms.UserControl> is often not the active window on a form, setting this property to `true` enables the controls within the <xref:System.Windows.Forms.UserControl> to display ToolTip windows at any time. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.ToolTip> class and associates the instance with the <xref:System.Windows.Forms.Form> that the instance is created within. The code then initializes the delay properties <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A>, <xref:System.Windows.Forms.ToolTip.InitialDelay%2A>, and <xref:System.Windows.Forms.ToolTip.ReshowDelay%2A>. In addition the instance of the <xref:System.Windows.Forms.ToolTip> class sets the <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a <xref:System.Windows.Forms.Button> and a <xref:System.Windows.Forms.CheckBox>. The code example requires that the method defined in the example is located within a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.Button> control named `button1` and a <xref:System.Windows.Forms.CheckBox> control named `checkBox1`, and that the method is called from the constructor of the <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.UserControl" /> @@ -1691,11 +1691,11 @@ <Docs> <summary>Stops the timer that hides displayed ToolTips.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.ToolTip> class has an internal timer that it uses to set the display duration for ToolTips. Set the duration of the timer through the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.StopTimer%2A> method stops this internal timer, causing any displayed ToolTip to be shown modally until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called or the parent form is minimized, hidden, or closed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.ToolTip> class has an internal timer that it uses to set the display duration for ToolTips. Set the duration of the timer through the <xref:System.Windows.Forms.ToolTip.AutoPopDelay%2A> property. The <xref:System.Windows.Forms.ToolTip.StopTimer%2A> method stops this internal timer, causing any displayed ToolTip to be shown modally until the <xref:System.Windows.Forms.ToolTip.Hide%2A> method is called or the parent form is minimized, hidden, or closed. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.AutoPopDelay" /> @@ -1745,11 +1745,11 @@ <value> <see langword="true" /> if ampersand characters are stripped from the ToolTip text; otherwise, <see langword="false" />. The default is false.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - An application commonly uses the same string resource for multiple purposes, such as a menu item and a ToolTip. However, menus often enable accelerators, denoted by an ampersand character, in the menu item string. ToolTips do not support this capability, so by default, ampersands are just displayed as normal characters. Setting the <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A> property to `true` removes all ampersands from the ToolTip text. - + <format type="text/markdown"><![CDATA[ + +## Remarks + An application commonly uses the same string resource for multiple purposes, such as a menu item and a ToolTip. However, menus often enable accelerators, denoted by an ampersand character, in the menu item string. ToolTips do not support this capability, so by default, ampersands are just displayed as normal characters. Setting the <xref:System.Windows.Forms.ToolTip.StripAmpersands%2A> property to `true` removes all ampersands from the ToolTip text. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.GetToolTip(System.Windows.Forms.Control)" /> @@ -1817,11 +1817,11 @@ <summary>Gets or sets the object that contains programmer-supplied data associated with the <see cref="T:System.Windows.Forms.ToolTip" />.</summary> <value>An <see cref="T:System.Object" /> that contains data about the <see cref="T:System.Windows.Forms.ToolTip" />. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Typically, you use the <xref:System.Windows.Forms.ToolTip.Tag%2A> property to store data that is closely associated with the <xref:System.Windows.Forms.ToolTip>. For example, if you are displaying a <xref:System.Windows.Forms.ToolTip> for a control that displays customer information, you might store the <xref:System.Data.DataSet> that contains the customer's information in the <xref:System.Windows.Forms.ToolTip.Tag%2A> property so the data can be accessed quickly. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Typically, you use the <xref:System.Windows.Forms.ToolTip.Tag%2A> property to store data that is closely associated with the <xref:System.Windows.Forms.ToolTip>. For example, if you are displaying a <xref:System.Windows.Forms.ToolTip> for a control that displays customer information, you might store the <xref:System.Data.DataSet> that contains the customer's information in the <xref:System.Windows.Forms.ToolTip.Tag%2A> property so the data can be accessed quickly. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.ToString" /> @@ -1867,11 +1867,11 @@ <summary>Gets or sets a value that defines the type of icon to be displayed alongside the ToolTip text.</summary> <value>One of the <see cref="T:System.Windows.Forms.ToolTipIcon" /> enumerated values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If you want to use a graphic that is not defined by the <xref:System.Windows.Forms.ToolTipIcon?displayProperty=nameWithType> enumeration, you must owner-draw the entire ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If you want to use a graphic that is not defined by the <xref:System.Windows.Forms.ToolTipIcon?displayProperty=nameWithType> enumeration, you must owner-draw the entire ToolTip. For more information, see the <xref:System.Windows.Forms.ToolTip.OwnerDraw%2A> property. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ToolTipIcon" /> @@ -1923,13 +1923,13 @@ <summary>Gets or sets a title for the ToolTip window.</summary> <value>A <see cref="T:System.String" /> containing the window title.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The title is displayed within the window as a line of bold text above the standard text of a ToolTip control description. Typically, titles are only used either to differentiate different categories of controls on a form or as an introduction to a fairly long control description. - - The maximum length of a title is 99 characters. If this property contains a string longer then 99 characters, no title will be displayed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The title is displayed within the window as a line of bold text above the standard text of a ToolTip control description. Typically, titles are only used either to differentiate different categories of controls on a form or as an introduction to a fairly long control description. + + The maximum length of a title is 99 characters. If this property contains a string longer then 99 characters, no title will be displayed. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.ToolTip.BackColor" /> @@ -1967,11 +1967,11 @@ <summary>Returns a string representation for this control.</summary> <returns>A <see cref="T:System.String" /> containing a description of the <see cref="T:System.Windows.Forms.ToolTip" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This overridden version of the <xref:System.Windows.Forms.ToolTip.ToString%2A> method displays the class name, followed by the values of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> and <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> properties. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This overridden version of the <xref:System.Windows.Forms.ToolTip.ToString%2A> method displays the class name, followed by the values of the <xref:System.Windows.Forms.ToolTip.InitialDelay%2A> and <xref:System.Windows.Forms.ToolTip.ShowAlways%2A> properties. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.ToolTip.GetToolTip(System.Windows.Forms.Control)" /> diff --git a/xml/System.Windows.Forms/TrackBarRenderer.xml b/xml/System.Windows.Forms/TrackBarRenderer.xml index ce20cf90dbd..9c333e9714f 100644 --- a/xml/System.Windows.Forms/TrackBarRenderer.xml +++ b/xml/System.Windows.Forms/TrackBarRenderer.xml @@ -33,24 +33,24 @@ <Docs> <summary>Provides methods used to render a track bar control with visual styles. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TrackBarRenderer> methods to draw a horizontal track bar that responds to mouse clicks. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to create a custom control that uses the <xref:System.Windows.Forms.TrackBarRenderer> methods to draw a horizontal track bar that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.VisualStyles.VisualStyleRenderer" /> @@ -90,21 +90,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws a downward-pointing track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -141,21 +141,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws a horizontal track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -194,23 +194,23 @@ <param name="edgeStyle">One of the <see cref="T:System.Windows.Forms.VisualStyles.EdgeStyle" /> values.</param> <summary>Draws the specified number of horizontal track bar ticks with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - - If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, <xref:System.Windows.Forms.TrackBarRenderer.DrawHorizontalTicks%2A> returns without rendering. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + + If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, <xref:System.Windows.Forms.TrackBarRenderer.DrawHorizontalTicks%2A> returns without rendering. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -245,30 +245,30 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds of the track.</param> <summary>Draws the track for a horizontal track bar with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.DrawHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a track bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.DrawHorizontalTrack%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw a track bar. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -305,21 +305,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws a left-pointing track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -356,21 +356,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws a right-pointing track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -407,30 +407,30 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws an upward-pointing track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.DrawTopPointingThumb%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an upward-pointing track bar slider. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.DrawTopPointingThumb%2A> method in a custom control's <xref:System.Windows.Forms.Control.OnPaint%2A> method to draw an upward-pointing track bar slider. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -467,21 +467,21 @@ <param name="state">One of the <see cref="T:System.Windows.Forms.VisualStyles.TrackBarThumbState" /> values that specifies the visual state of the track bar slider.</param> <summary>Draws a vertical track bar slider (also known as the thumb) with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -520,23 +520,23 @@ <param name="edgeStyle">One of the <see cref="T:System.Windows.Forms.VisualStyles.EdgeStyle" /> values.</param> <summary>Draws the specified number of vertical track bar ticks with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, <xref:System.Windows.Forms.TrackBarRenderer.DrawVerticalTicks%2A> returns without rendering. - - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, <xref:System.Windows.Forms.TrackBarRenderer.DrawVerticalTicks%2A> returns without rendering. + + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -571,21 +571,21 @@ <param name="bounds">The <see cref="T:System.Drawing.Rectangle" /> that specifies the bounds of the track.</param> <summary>Draws the track for a vertical track bar with visual styles.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -621,23 +621,23 @@ <summary>Returns the size, in pixels, of the track bar slider (also known as the thumb) that points down.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size, in pixels, of the slider.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the slider is determined by the current visual style of the operating system. - - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the slider is determined by the current visual style of the operating system. + + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -673,23 +673,23 @@ <summary>Returns the size, in pixels, of the track bar slider (also known as the thumb) that points to the left.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size, in pixels, of the slider.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the slider is determined by the current visual style of the operating system. - - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the slider is determined by the current visual style of the operating system. + + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -725,23 +725,23 @@ <summary>Returns the size, in pixels, of the track bar slider (also known as the thumb) that points to the right.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size, in pixels, of the slider.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the slider is determined by the current visual style of the operating system. - - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the slider is determined by the current visual style of the operating system. + + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -777,32 +777,32 @@ <summary>Returns the size, in pixels, of the track bar slider (also known as the thumb) that points up.</summary> <returns>A <see cref="T:System.Drawing.Size" /> that specifies the size, in pixels, of the slider.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The size of the slider is determined by the current visual style of the operating system. - - Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.GetTopPointingThumbSize%2A> method to determine the size of the rectangle used by the <xref:System.Windows.Forms.TrackBarRenderer.DrawTopPointingThumb%2A> method to draw the slider. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The size of the slider is determined by the current visual style of the operating system. + + Before calling this method, you should verify that the value of the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property is `true`. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.GetTopPointingThumbSize%2A> method to determine the size of the rectangle used by the <xref:System.Windows.Forms.TrackBarRenderer.DrawTopPointingThumb%2A> method to draw the slider. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> - <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + <exception cref="T:System.InvalidOperationException">The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.</exception> </Docs> </Member> @@ -833,20 +833,20 @@ <value> <see langword="true" /> if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `false`, the methods of this class will throw an <xref:System.InvalidOperationException>. - - - -## Examples - The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TrackBarRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `false`, the methods of this class will throw an <xref:System.InvalidOperationException>. + + + +## Examples + The following code example uses the <xref:System.Windows.Forms.TrackBarRenderer.IsSupported%2A> property to determine whether to use the <xref:System.Windows.Forms.TrackBarRenderer> methods. This code example is part of a larger example provided for the <xref:System.Windows.Forms.TrackBarRenderer> class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Application.VisualStyleState" /> diff --git a/xml/System.Windows.Forms/TreeNode.xml b/xml/System.Windows.Forms/TreeNode.xml index f79134c6b9b..63c9183e174 100644 --- a/xml/System.Windows.Forms/TreeNode.xml +++ b/xml/System.Windows.Forms/TreeNode.xml @@ -53,35 +53,35 @@ <Docs> <summary>Represents a node of a <see cref="T:System.Windows.Forms.TreeView" />.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection holds all the child <xref:System.Windows.Forms.TreeNode> objects assigned to the current <xref:System.Windows.Forms.TreeNode>. You can add, remove, or clone a <xref:System.Windows.Forms.TreeNode>; when you do this, all child tree nodes are added, removed, or cloned. Each <xref:System.Windows.Forms.TreeNode> can contain a collection of other <xref:System.Windows.Forms.TreeNode> objects. This can make it difficult to determine where you are in the <xref:System.Windows.Forms.TreeView> when iterating through the collection. To determine your location in a tree structure, use the <xref:System.Windows.Forms.TreeNode.FullPath%2A> property. The <xref:System.Windows.Forms.TreeNode.FullPath%2A> string can be parsed using the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> string value to determine where a <xref:System.Windows.Forms.TreeNode> label begins and ends. - - The <xref:System.Windows.Forms.TreeNode> label is set by setting the <xref:System.Windows.Forms.TreeNode.Text%2A> property explicitly. The alternative is to create the tree node using one of the <xref:System.Windows.Forms.TreeNode.%23ctor%2A> constructors that has a string parameter that represents the <xref:System.Windows.Forms.TreeNode.Text%2A> property. The label is displayed next to the <xref:System.Windows.Forms.TreeNode> image, if one is displayed. - - To display images next to the tree nodes, assign an <xref:System.Windows.Forms.ImageList> to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control and assign an <xref:System.Drawing.Image> by referencing its index value in the <xref:System.Windows.Forms.ImageList> property. Set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> you want to display when the <xref:System.Windows.Forms.TreeNode> is in an unselected state. Likewise, set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> you want to display when the <xref:System.Windows.Forms.TreeNode> is selected. - - Selecting specific tree nodes and iterating through the <xref:System.Windows.Forms.TreeView.Nodes%2A> collection can be achieved by using the following property values: <xref:System.Windows.Forms.TreeNode.FirstNode%2A>, <xref:System.Windows.Forms.TreeNode.LastNode%2A>, <xref:System.Windows.Forms.TreeNode.NextNode%2A>, <xref:System.Windows.Forms.TreeNode.PrevNode%2A>, <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A>, <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A>. Assign the <xref:System.Windows.Forms.TreeNode> returned by one of aforementioned properties to the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType> property to select that tree node in the <xref:System.Windows.Forms.TreeView> control. - - Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the <xref:System.Windows.Forms.TreeNode> by pressing the plus (+) button next to the <xref:System.Windows.Forms.TreeNode>, if one is displayed, or you can expand the <xref:System.Windows.Forms.TreeNode> by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method. To expand all child tree node levels in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection, call the <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method. You can collapse the child <xref:System.Windows.Forms.TreeNode> level by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method, or the user can press the minus (-) button next to the <xref:System.Windows.Forms.TreeNode>, if one is displayed. You can also call the <xref:System.Windows.Forms.TreeNode.Toggle%2A> method to alternate the <xref:System.Windows.Forms.TreeNode> between the expanded and collapsed states. - - Tree nodes can optionally display a check box. To display the check boxes, set the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.TreeView> to `true`. The <xref:System.Windows.Forms.TreeNode.Checked%2A> property is set to `true` for tree nodes that are in a checked state. - - - -## Examples - The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection holds all the child <xref:System.Windows.Forms.TreeNode> objects assigned to the current <xref:System.Windows.Forms.TreeNode>. You can add, remove, or clone a <xref:System.Windows.Forms.TreeNode>; when you do this, all child tree nodes are added, removed, or cloned. Each <xref:System.Windows.Forms.TreeNode> can contain a collection of other <xref:System.Windows.Forms.TreeNode> objects. This can make it difficult to determine where you are in the <xref:System.Windows.Forms.TreeView> when iterating through the collection. To determine your location in a tree structure, use the <xref:System.Windows.Forms.TreeNode.FullPath%2A> property. The <xref:System.Windows.Forms.TreeNode.FullPath%2A> string can be parsed using the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> string value to determine where a <xref:System.Windows.Forms.TreeNode> label begins and ends. + + The <xref:System.Windows.Forms.TreeNode> label is set by setting the <xref:System.Windows.Forms.TreeNode.Text%2A> property explicitly. The alternative is to create the tree node using one of the <xref:System.Windows.Forms.TreeNode.%23ctor%2A> constructors that has a string parameter that represents the <xref:System.Windows.Forms.TreeNode.Text%2A> property. The label is displayed next to the <xref:System.Windows.Forms.TreeNode> image, if one is displayed. + + To display images next to the tree nodes, assign an <xref:System.Windows.Forms.ImageList> to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control and assign an <xref:System.Drawing.Image> by referencing its index value in the <xref:System.Windows.Forms.ImageList> property. Set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> you want to display when the <xref:System.Windows.Forms.TreeNode> is in an unselected state. Likewise, set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> you want to display when the <xref:System.Windows.Forms.TreeNode> is selected. + + Selecting specific tree nodes and iterating through the <xref:System.Windows.Forms.TreeView.Nodes%2A> collection can be achieved by using the following property values: <xref:System.Windows.Forms.TreeNode.FirstNode%2A>, <xref:System.Windows.Forms.TreeNode.LastNode%2A>, <xref:System.Windows.Forms.TreeNode.NextNode%2A>, <xref:System.Windows.Forms.TreeNode.PrevNode%2A>, <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A>, <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A>. Assign the <xref:System.Windows.Forms.TreeNode> returned by one of aforementioned properties to the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType> property to select that tree node in the <xref:System.Windows.Forms.TreeView> control. + + Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the <xref:System.Windows.Forms.TreeNode> by pressing the plus (+) button next to the <xref:System.Windows.Forms.TreeNode>, if one is displayed, or you can expand the <xref:System.Windows.Forms.TreeNode> by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method. To expand all child tree node levels in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection, call the <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method. You can collapse the child <xref:System.Windows.Forms.TreeNode> level by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method, or the user can press the minus (-) button next to the <xref:System.Windows.Forms.TreeNode>, if one is displayed. You can also call the <xref:System.Windows.Forms.TreeNode.Toggle%2A> method to alternate the <xref:System.Windows.Forms.TreeNode> between the expanded and collapsed states. + + Tree nodes can optionally display a check box. To display the check boxes, set the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.TreeView> to `true`. The <xref:System.Windows.Forms.TreeNode.Checked%2A> property is set to `true` for tree nodes that are in a checked state. + + + +## Examples + The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Cursor/Overview/treeview.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> <altmember cref="T:System.Windows.Forms.TreeNodeCollection" /> - <related type="Article" href="/dotnet/framework/winforms/controls/how-to-add-and-remove-nodes-with-the-windows-forms-treeview-control">How to: Add and Remove Nodes with the Windows Forms TreeView Control</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/how-to-add-and-remove-nodes-with-the-windows-forms-treeview-control">How to: Add and Remove Nodes with the Windows Forms TreeView Control</related> </Docs> <Members> <MemberGroup MemberName=".ctor"> @@ -116,15 +116,15 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> @@ -165,20 +165,20 @@ <param name="text">The label <see cref="P:System.Windows.Forms.TreeNode.Text" /> of the new tree node.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode" /> class with the specified label text.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. - - - -## Examples - The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. + + + +## Examples + The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Cursor/Overview/treeview.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> @@ -252,20 +252,20 @@ <param name="children">An array of child <see cref="T:System.Windows.Forms.TreeNode" /> objects.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode" /> class with the specified label text and child tree nodes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The tree nodes that are contained in the `children` array are added to the <xref:System.Windows.Forms.TreeNodeCollection> that is stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The tree nodes that are contained in the `children` array are added to the <xref:System.Windows.Forms.TreeNodeCollection> that is stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> @@ -304,20 +304,20 @@ <param name="selectedImageIndex">The index value of <see cref="T:System.Drawing.Image" /> to display when the tree node is selected.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode" /> class with the specified label text and images to display when the tree node is in a selected and unselected state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. The image referenced in the `imageIndex` property is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` property is displayed when the tree node is in a selected state. - - - -## Examples - The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. The image referenced in the `imageIndex` property is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` property is displayed when the tree node is in a selected state. + + + +## Examples + The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> @@ -365,20 +365,20 @@ <param name="children">An array of child <see cref="T:System.Windows.Forms.TreeNode" /> objects.</param> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeNode" /> class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. The image referenced in the `imageIndex` parameter is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` parameter is displayed when the tree node is in a selected state. The tree nodes that are contained in the `children` array are added to the <xref:System.Windows.Forms.TreeNodeCollection> that is stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property. - - - -## Examples - The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The `text` parameter value is assigned to the node's <xref:System.Windows.Forms.TreeNode.Text%2A> property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. The image referenced in the `imageIndex` parameter is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` parameter is displayed when the tree node is in a selected state. The tree nodes that are contained in the `children` array are added to the <xref:System.Windows.Forms.TreeNodeCollection> that is stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property. + + + +## Examples + The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> @@ -412,20 +412,20 @@ <summary>Gets or sets the background color of the tree node.</summary> <value>The background <see cref="T:System.Drawing.Color" /> of the tree node. The default is <see cref="F:System.Drawing.Color.Empty" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the <xref:System.Windows.Forms.TreeNode.BackColor%2A> property is set to <xref:System.Drawing.Color.Empty?displayProperty=nameWithType>, the <xref:System.Drawing.Color> used is the <xref:System.Windows.Forms.Control.BackColor%2A> property value of the <xref:System.Windows.Forms.TreeView> control that the tree node is assigned to. - - - -## Examples - The following code example highlights any <xref:System.Windows.Forms.TreeNode> objects a <xref:System.Windows.Forms.TreeView> control that has its <xref:System.Windows.Forms.TreeNode.Checked%2A> property set to `true` by setting its <xref:System.Windows.Forms.TreeNode.BackColor%2A> property to <xref:System.Drawing.Color.Yellow%2A>. This code requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> with a collection of <xref:System.Windows.Forms.TreeNode> objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the <xref:System.Windows.Forms.TreeNode.BackColor%2A> property is set to <xref:System.Drawing.Color.Empty?displayProperty=nameWithType>, the <xref:System.Drawing.Color> used is the <xref:System.Windows.Forms.Control.BackColor%2A> property value of the <xref:System.Windows.Forms.TreeView> control that the tree node is assigned to. + + + +## Examples + The following code example highlights any <xref:System.Windows.Forms.TreeNode> objects a <xref:System.Windows.Forms.TreeView> control that has its <xref:System.Windows.Forms.TreeNode.Checked%2A> property set to `true` by setting its <xref:System.Windows.Forms.TreeNode.BackColor%2A> property to <xref:System.Drawing.Color.Yellow%2A>. This code requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> with a collection of <xref:System.Windows.Forms.TreeNode> objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Checked/CPP/treenode_checked.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/BackColor/treenode_checked.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.ForeColor" /> @@ -458,23 +458,23 @@ <Docs> <summary>Initiates the editing of the tree node label.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - A typical scenario to use this method is to call it on the <xref:System.Windows.Forms.MenuItem.Click> event of a <xref:System.Windows.Forms.MenuItem> or <xref:System.Windows.Forms.ContextMenu>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + A typical scenario to use this method is to call it on the <xref:System.Windows.Forms.MenuItem.Click> event of a <xref:System.Windows.Forms.MenuItem> or <xref:System.Windows.Forms.ContextMenu>. + > [!NOTE] -> This method only works if the <xref:System.Windows.Forms.TreeView.LabelEdit%2A> property of the <xref:System.Windows.Forms.TreeView> is set to `true`. If <xref:System.Windows.Forms.TreeView.LabelEdit%2A> is set to `false`, an exception is thrown and the tree node will not be put into an editable state. - - - -## Examples - The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right-clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - +> This method only works if the <xref:System.Windows.Forms.TreeView.LabelEdit%2A> property of the <xref:System.Windows.Forms.TreeView> is set to `true`. If <xref:System.Windows.Forms.TreeView.LabelEdit%2A> is set to `false`, an exception is thrown and the tree node will not be put into an editable state. + + + +## Examples + The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right-clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException"> @@ -516,20 +516,20 @@ <summary>Gets the bounds of the tree node.</summary> <value>The <see cref="T:System.Drawing.Rectangle" /> that represents the bounds of the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The coordinates are relative to the upper-left corner of the <xref:System.Windows.Forms.TreeView> control. - - - -## Examples - The following code example changes the size <xref:System.Windows.Forms.TreeNode.NodeFont%2A> to the specified size and adjusts the <xref:System.Windows.Forms.TreeView.ItemHeight%2A> of the tree node's parent <xref:System.Windows.Forms.TreeView> control. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView> control with a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.ComboBox> that contains font sizes. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The coordinates are relative to the upper-left corner of the <xref:System.Windows.Forms.TreeView> control. + + + +## Examples + The following code example changes the size <xref:System.Windows.Forms.TreeNode.NodeFont%2A> to the specified size and adjusts the <xref:System.Windows.Forms.TreeView.ItemHeight%2A> of the tree node's parent <xref:System.Windows.Forms.TreeView> control. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView> control with a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.ComboBox> that contains font sizes. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -572,15 +572,15 @@ <value> <see langword="true" /> if the tree node is in a checked state; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example highlights any <xref:System.Windows.Forms.TreeNode> objects a <xref:System.Windows.Forms.TreeView> control that has its <xref:System.Windows.Forms.TreeNode.Checked%2A> property set to `true` by setting its <xref:System.Windows.Forms.TreeNode.BackColor%2A> property to <xref:System.Drawing.Color.Yellow%2A>. This code requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> with a collection of <xref:System.Windows.Forms.TreeNode> objects. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example highlights any <xref:System.Windows.Forms.TreeNode> objects a <xref:System.Windows.Forms.TreeView> control that has its <xref:System.Windows.Forms.TreeNode.Checked%2A> property set to `true` by setting its <xref:System.Windows.Forms.TreeNode.BackColor%2A> property to <xref:System.Drawing.Color.Yellow%2A>. This code requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> with a collection of <xref:System.Windows.Forms.TreeNode> objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Checked/CPP/treenode_checked.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/BackColor/treenode_checked.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeView.CheckBoxes" /> @@ -617,22 +617,22 @@ <summary>Copies the tree node and the entire subtree rooted at this tree node.</summary> <returns>The <see cref="T:System.Object" /> that represents the cloned <see cref="T:System.Windows.Forms.TreeNode" />.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The tree structure from the tree node being cloned and below is copied. Any child tree nodes assigned to the <xref:System.Windows.Forms.TreeNode> being cloned are included in the new tree node and subtree. - - The <xref:System.Windows.Forms.TreeNode.Clone%2A> method performs a shallow copy of the node. If the value of the <xref:System.Windows.Forms.TreeNode.Tag%2A> property is a reference type, both the original and cloned copy will point to the same single instance of the <xref:System.Windows.Forms.TreeNode.Tag%2A> value. - - - -## Examples - The following code example clones the last child tree node of the last root tree node and inserts the clone as the first root tree node in the `TreeNodeCollection`. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects and a <xref:System.Windows.Forms.Button>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The tree structure from the tree node being cloned and below is copied. Any child tree nodes assigned to the <xref:System.Windows.Forms.TreeNode> being cloned are included in the new tree node and subtree. + + The <xref:System.Windows.Forms.TreeNode.Clone%2A> method performs a shallow copy of the node. If the value of the <xref:System.Windows.Forms.TreeNode.Tag%2A> property is a reference type, both the original and cloned copy will point to the same single instance of the <xref:System.Windows.Forms.TreeNode.Tag%2A> value. + + + +## Examples + The following code example clones the last child tree node of the last root tree node and inserts the clone as the first root tree node in the `TreeNodeCollection`. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects and a <xref:System.Windows.Forms.Button>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.Remove" /> @@ -680,23 +680,23 @@ <Docs> <summary>Collapses the tree node.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.Collapse%2A> method collapses the current <xref:System.Windows.Forms.TreeNode> and its child nodes. If you want to collapse only the current <xref:System.Windows.Forms.TreeNode>, use the <xref:System.Windows.Forms.TreeNode.Collapse%28System.Boolean%29?displayProperty=nameWithType> overload, passing `true` to ignore its child nodes. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.Collapse%2A> method collapses the current <xref:System.Windows.Forms.TreeNode> and its child nodes. If you want to collapse only the current <xref:System.Windows.Forms.TreeNode>, use the <xref:System.Windows.Forms.TreeNode.Collapse%28System.Boolean%29?displayProperty=nameWithType> overload, passing `true` to ignore its child nodes. + > [!NOTE] -> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. - +> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.Expand" /> @@ -741,11 +741,11 @@ <see langword="true" /> to leave the child nodes in their current state; <see langword="false" /> to collapse the child nodes.</param> <summary>Collapses the <see cref="T:System.Windows.Forms.TreeNode" /> and optionally collapses its children.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method, passing `true`, when you want to collapse a node but leave its child nodes in their expanded state. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method, passing `true`, when you want to collapse a node but leave its child nodes in their expanded state. + ]]></format> </remarks> </Docs> @@ -784,11 +784,11 @@ <summary>Gets the shortcut menu that is associated with this tree node.</summary> <value>The <see cref="T:System.Windows.Forms.ContextMenu" /> that is associated with the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The preferred way to associate a shortcut menu with a tree node is with the <xref:System.Windows.Forms.TreeNode.ContextMenuStrip%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The preferred way to associate a shortcut menu with a tree node is with the <xref:System.Windows.Forms.TreeNode.ContextMenuStrip%2A> property. + ]]></format> </remarks> </Docs> @@ -838,11 +838,11 @@ <summary>Gets or sets the shortcut menu associated with this tree node.</summary> <value>The <see cref="T:System.Windows.Forms.ContextMenuStrip" /> associated with the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The shortcut menu is shown when the user right-clicks the tree node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The shortcut menu is shown when the user right-clicks the tree node. + ]]></format> </remarks> </Docs> @@ -911,15 +911,15 @@ <see langword="true" /> if the editing of the tree node label text was canceled without being saved; otherwise, <see langword="false" />.</param> <summary>Ends the editing of the tree node label.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.BeginEdit" /> @@ -953,23 +953,23 @@ <Docs> <summary>Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.TreeNode.EnsureVisible%2A> method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the <xref:System.Windows.Forms.TreeView>. This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.TreeNode.EnsureVisible%2A> method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the <xref:System.Windows.Forms.TreeView>. This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node. + > [!NOTE] -> If the <xref:System.Windows.Forms.TreeView.ItemHeight%2A?displayProperty=nameWithType> property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results. - - - -## Examples - The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.Button>. There should be enough tree nodes so that they are not all visible in the tree view control. - +> If the <xref:System.Windows.Forms.TreeView.ItemHeight%2A?displayProperty=nameWithType> property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results. + + + +## Examples + The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.Button>. There should be enough tree nodes so that they are not all visible in the tree view control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.IsVisible" /> @@ -1004,23 +1004,23 @@ <Docs> <summary>Expands the tree node.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.Expand%2A> method expands the current <xref:System.Windows.Forms.TreeNode> down to the next level of nodes. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.Expand%2A> method expands the current <xref:System.Windows.Forms.TreeNode> down to the next level of nodes. + > [!NOTE] -> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. - +> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.ExpandAll" /> @@ -1056,23 +1056,23 @@ <Docs> <summary>Expands all the child tree nodes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method expands all the child tree nodes assigned to the <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method expands all the child tree nodes assigned to the <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection. + > [!NOTE] -> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example expands all the tree nodes in a <xref:System.Windows.Forms.TreeView> control when a <xref:System.Windows.Forms.CheckBox> is checked, and collapses the <xref:System.Windows.Forms.TreeNode.FirstNode%2A> when the <xref:System.Windows.Forms.CheckBox> is cleared. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.CheckBox>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). - +> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example expands all the tree nodes in a <xref:System.Windows.Forms.TreeView> control when a <xref:System.Windows.Forms.CheckBox> is checked, and collapses the <xref:System.Windows.Forms.TreeNode.FirstNode%2A> when the <xref:System.Windows.Forms.CheckBox> is cleared. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.CheckBox>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.Expand" /> @@ -1119,20 +1119,20 @@ <summary>Gets the first child tree node in the tree node collection.</summary> <value>The first child <see cref="T:System.Windows.Forms.TreeNode" /> in the <see cref="P:System.Windows.Forms.TreeNode.Nodes" /> collection.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.FirstNode%2A> is the first child <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the current tree node. If the <xref:System.Windows.Forms.TreeNode> has no child tree node, the <xref:System.Windows.Forms.TreeNode.FirstNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.FirstNode%2A> is the first child <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the current tree node. If the <xref:System.Windows.Forms.TreeNode> has no child tree node, the <xref:System.Windows.Forms.TreeNode.FirstNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -1164,20 +1164,20 @@ <summary>Gets or sets the foreground color of the tree node.</summary> <value>The foreground <see cref="T:System.Drawing.Color" /> of the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If `null`, the <xref:System.Drawing.Color> used is the <xref:System.Windows.Forms.Control.ForeColor%2A> property value of the <xref:System.Windows.Forms.TreeView> control that the tree node is assigned to. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If `null`, the <xref:System.Drawing.Color> used is the <xref:System.Windows.Forms.Control.ForeColor%2A> property value of the <xref:System.Windows.Forms.TreeView> control that the tree node is assigned to. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.BackColor" /> @@ -1217,20 +1217,20 @@ <summary>Returns the tree node with the specified handle and assigned to the specified tree view control.</summary> <returns>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the tree node assigned to the specified <see cref="T:System.Windows.Forms.TreeView" /> control with the specified handle.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When a node is added to the <xref:System.Windows.Forms.TreeView.Nodes%2A?displayProperty=nameWithType> collection, the <xref:System.Windows.Forms.TreeView> control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the <xref:System.Windows.Forms.Control.WndProc%2A> method of the <xref:System.Windows.Forms.TreeView> to provide custom drawing in response to this notification, you should always check the return value of this method for `null` before you attempt to access the node. - - - -## Examples - The following code example gets the <xref:System.Windows.Forms.TreeNode> that was collapsed and creates a copy of it using its <xref:System.Windows.Forms.TreeNode.Handle%2A> property. The original <xref:System.Windows.Forms.TreeNode> is removed from the <xref:System.Windows.Forms.TreeNodeCollection>, and the copy is added to the collection. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> control should have two or more root nodes, each having at least one child node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When a node is added to the <xref:System.Windows.Forms.TreeView.Nodes%2A?displayProperty=nameWithType> collection, the <xref:System.Windows.Forms.TreeView> control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the <xref:System.Windows.Forms.Control.WndProc%2A> method of the <xref:System.Windows.Forms.TreeView> to provide custom drawing in response to this notification, you should always check the return value of this method for `null` before you attempt to access the node. + + + +## Examples + The following code example gets the <xref:System.Windows.Forms.TreeNode> that was collapsed and creates a copy of it using its <xref:System.Windows.Forms.TreeNode.Handle%2A> property. The original <xref:System.Windows.Forms.TreeNode> is removed from the <xref:System.Windows.Forms.TreeNodeCollection>, and the copy is added to the collection. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> control should have two or more root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.TreeView" /> @@ -1270,20 +1270,20 @@ <summary>Gets the path from the root tree node to the current tree node.</summary> <value>The path from the root tree node to the current tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The path consists of the labels of all the tree nodes that must be navigated to reach this tree node, starting at the root tree node. The node labels are separated by the delimiter character specified in the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of the <xref:System.Windows.Forms.TreeView> control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\\), the <xref:System.Windows.Forms.TreeNode.FullPath%2A> property value is "Country\Region\State". - - - -## Examples - The following code example sets the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of a <xref:System.Windows.Forms.TreeView> and displays the number of child tree nodes that are contained in the <xref:System.Windows.Forms.TreeNodeCollection> of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A>. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.Button>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). - + <format type="text/markdown"><![CDATA[ + +## Remarks + The path consists of the labels of all the tree nodes that must be navigated to reach this tree node, starting at the root tree node. The node labels are separated by the delimiter character specified in the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of the <xref:System.Windows.Forms.TreeView> control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\\), the <xref:System.Windows.Forms.TreeNode.FullPath%2A> property value is "Country\Region\State". + + + +## Examples + The following code example sets the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of a <xref:System.Windows.Forms.TreeView> and displays the number of child tree nodes that are contained in the <xref:System.Windows.Forms.TreeNodeCollection> of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A>. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.Button>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: + ]]></format> </remarks> <exception cref="T:System.InvalidOperationException">The node is not contained in a <see cref="T:System.Windows.Forms.TreeView" />.</exception> @@ -1322,15 +1322,15 @@ <summary>Returns the number of child tree nodes.</summary> <returns>The number of child tree nodes assigned to the <see cref="P:System.Windows.Forms.TreeNode.Nodes" /> collection.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example sets the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of a <xref:System.Windows.Forms.TreeView> and displays the number of child tree nodes that are contained in the <xref:System.Windows.Forms.TreeNodeCollection> of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A>. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.Button>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example sets the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of a <xref:System.Windows.Forms.TreeView> and displays the number of child tree nodes that are contained in the <xref:System.Windows.Forms.TreeNodeCollection> of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A>. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.Button>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.Nodes" /> @@ -1370,20 +1370,20 @@ <summary>Gets the handle of the tree node.</summary> <value>The tree node handle.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If a handle is not already created when the <xref:System.Windows.Forms.TreeNode.Handle%2A> property is referenced, it is created. - - - -## Examples - The following code example gets the <xref:System.Windows.Forms.TreeNode> that was collapsed and creates a copy of it using its <xref:System.Windows.Forms.TreeNode.Handle%2A> property. The original <xref:System.Windows.Forms.TreeNode> is removed from the <xref:System.Windows.Forms.TreeNodeCollection>, and the copy is added to the collection. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> control should have two or more root nodes, each having at least one child node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If a handle is not already created when the <xref:System.Windows.Forms.TreeNode.Handle%2A> property is referenced, it is created. + + + +## Examples + The following code example gets the <xref:System.Windows.Forms.TreeNode> that was collapsed and creates a copy of it using its <xref:System.Windows.Forms.TreeNode.Handle%2A> property. The original <xref:System.Windows.Forms.TreeNode> is removed from the <xref:System.Windows.Forms.TreeNodeCollection>, and the copy is added to the collection. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> control should have two or more root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: + ]]></format> </remarks> </Docs> @@ -1449,27 +1449,27 @@ <summary>Gets or sets the image list index value of the image displayed when the tree node is in the unselected state.</summary> <value>A zero-based index value that represents the image position in the assigned <see cref="T:System.Windows.Forms.ImageList" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> value is the index value of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> value is the index value of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. + > [!NOTE] -> The default value of the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is the same as the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property of the <xref:System.Windows.Forms.TreeView> control that the <xref:System.Windows.Forms.TreeNode> is assigned to. - +> The default value of the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is the same as the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property of the <xref:System.Windows.Forms.TreeView> control that the <xref:System.Windows.Forms.TreeNode> is assigned to. + <xref:System.Windows.Forms.TreeNode.ImageKey%2A> and <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is automatically set to an empty string (""). - +If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is automatically set to an empty string (""). + **.NET 5 and later versions:** If the associated <xref:System.Windows.Forms.TreeView.ImageList%2A> property value is changed to `null`, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property returns its default value, -1. However, the assigned <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> value is retained internally and used when another <xref:System.Windows.Forms.ImageList> object is assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property. If the new <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property has an <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A?displayProperty=nameWithType> property value that is less than or equal to the value assigned to the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property minus one (to account for the collection being a zero-based index), the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property value is adjusted to one less than the <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A> property value. -For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> value changes to 1. - -## Examples - The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - +For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> value changes to 1. + +## Examples + The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">.NET 5 and later: <paramref name="value" /> is less than -2.</exception> @@ -1538,16 +1538,16 @@ For example, consider a button control whose <xref:System.Windows.Forms.ImageLis <summary>Gets or sets the key for the image associated with this tree node when the node is in an unselected state.</summary> <value>The key for the image associated with this tree node when the node is in an unselected state.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The image key returned by this property is contained in the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the containing <xref:System.Windows.Forms.TreeView> control. - - The <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is case-insensitive. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The image key returned by this property is contained in the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the containing <xref:System.Windows.Forms.TreeView> control. + + The <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is case-insensitive. + <xref:System.Windows.Forms.TreeNode.ImageKey%2A> and <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is automatically set to an empty string (""). - +If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> is automatically set to an empty string (""). + ]]></format> </remarks> </Docs> @@ -1585,15 +1585,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the position of the tree node in the tree node collection.</summary> <value>A zero-based index value that represents the position of the tree node in the <see cref="P:System.Windows.Forms.TreeNode.Nodes" /> collection.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example displays the <xref:System.Windows.Forms.TreeNode.Text%2A> and <xref:System.Windows.Forms.TreeNode.Index%2A> property values of the <xref:System.Windows.Forms.TreeNode> represented by the <xref:System.Windows.Forms.TreeNode.Parent%2A> property of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType>. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have at least two root nodes, each having at least one child node. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example displays the <xref:System.Windows.Forms.TreeNode.Text%2A> and <xref:System.Windows.Forms.TreeNode.Index%2A> property values of the <xref:System.Windows.Forms.TreeNode> represented by the <xref:System.Windows.Forms.TreeNode.Parent%2A> property of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType>. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have at least two root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -1632,15 +1632,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <value> <see langword="true" /> if the tree node is in editable state; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, letting the user edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, letting the user edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.BeginEdit" /> @@ -1681,15 +1681,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <value> <see langword="true" /> if the tree node is in the expanded state; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A> method, it is collapsed by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A> method. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has at least one <xref:System.Windows.Forms.TreeNode> with at least one child <xref:System.Windows.Forms.TreeNode>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.Expand" /> @@ -1730,15 +1730,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <value> <see langword="true" /> if the tree node is in the selected state; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> containing several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> containing several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeView.SelectedNode" /> @@ -1778,15 +1778,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <value> <see langword="true" /> if the tree node is visible or partially visible; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.Button>. There should be enough tree nodes so that they are not all visible in the tree view control. - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form> that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.Button>. There should be enough tree nodes so that they are not all visible in the tree view control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.NextVisibleNode" /> @@ -1831,20 +1831,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the last child tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the last child tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.LastNode%2A> is the last child <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the current tree node. If the <xref:System.Windows.Forms.TreeNode> has no child tree node, the <xref:System.Windows.Forms.TreeNode.LastNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.LastNode%2A> is the last child <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the current tree node. If the <xref:System.Windows.Forms.TreeNode> has no child tree node, the <xref:System.Windows.Forms.TreeNode.LastNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.FirstNode" /> @@ -1884,11 +1884,11 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the zero-based depth of the tree node in the <see cref="T:System.Windows.Forms.TreeView" /> control.</summary> <value>The zero-based depth of the tree node in the <see cref="T:System.Windows.Forms.TreeView" /> control.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - For the <xref:System.Windows.Forms.TreeNode.Level%2A> property, the root node is considered the first level of nesting and returns 0. - + <format type="text/markdown"><![CDATA[ + +## Remarks + For the <xref:System.Windows.Forms.TreeNode.Level%2A> property, the root node is considered the first level of nesting and returns 0. + ]]></format> </remarks> </Docs> @@ -1925,11 +1925,11 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets or sets the name of the tree node.</summary> <value>A <see cref="T:System.String" /> that represents the name of the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.Name%2A> of a <xref:System.Windows.Forms.TreeNode> is also the node's key, when the node is part of a <xref:System.Windows.Forms.TreeNodeCollection>. If the node does not have a name, <xref:System.Windows.Forms.TreeNode.Name%2A> returns an empty string (""). - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.Name%2A> of a <xref:System.Windows.Forms.TreeNode> is also the node's key, when the node is part of a <xref:System.Windows.Forms.TreeNodeCollection>. If the node does not have a name, <xref:System.Windows.Forms.TreeNode.Name%2A> returns an empty string (""). + ]]></format> </remarks> </Docs> @@ -1972,20 +1972,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the next sibling tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the next sibling tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.NextNode%2A> is the next sibling <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the tree node's parent <xref:System.Windows.Forms.TreeNode>. If there is no next tree node, the <xref:System.Windows.Forms.TreeNode.NextNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.NextNode%2A> is the next sibling <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the tree node's parent <xref:System.Windows.Forms.TreeNode>. If there is no next tree node, the <xref:System.Windows.Forms.TreeNode.NextNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.PrevNode" /> @@ -2031,20 +2031,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the next visible tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the next visible tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A> can be a child, sibling, or a tree node from another branch. If there is no next tree node, the <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A> can be a child, sibling, or a tree node from another branch. If there is no next tree node, the <xref:System.Windows.Forms.TreeNode.NextVisibleNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.IsVisible" /> @@ -2093,23 +2093,23 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets or sets the font that is used to display the text on the tree node label.</summary> <value>The <see cref="T:System.Drawing.Font" /> that is used to display the text on the tree node label.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If `null`, the <xref:System.Drawing.Font> used is the <xref:System.Windows.Forms.Control.Font%2A> property value of the <xref:System.Windows.Forms.TreeView> control that this node is attached to. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If `null`, the <xref:System.Drawing.Font> used is the <xref:System.Windows.Forms.Control.Font%2A> property value of the <xref:System.Windows.Forms.TreeView> control that this node is attached to. + > [!NOTE] -> If the node font is larger than the <xref:System.Windows.Forms.Control.Font%2A> property value that is set in the <xref:System.Windows.Forms.TreeView> control, the tree node label text is clipped. - - - -## Examples - The following code example changes the size of <xref:System.Windows.Forms.TreeNode.NodeFont%2A> to the specified size and adjusts the <xref:System.Windows.Forms.TreeView.ItemHeight%2A> of the tree node's parent <xref:System.Windows.Forms.TreeView> control. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.ComboBox> that contains font sizes. - +> If the node font is larger than the <xref:System.Windows.Forms.Control.Font%2A> property value that is set in the <xref:System.Windows.Forms.TreeView> control, the tree node label text is clipped. + + + +## Examples + The following code example changes the size of <xref:System.Windows.Forms.TreeNode.NodeFont%2A> to the specified size and adjusts the <xref:System.Windows.Forms.TreeView.ItemHeight%2A> of the tree node's parent <xref:System.Windows.Forms.TreeView> control. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that contains a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.ComboBox> that contains font sizes. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.Control.Font" /> @@ -2153,20 +2153,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the collection of <see cref="T:System.Windows.Forms.TreeNode" /> objects assigned to the current tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNodeCollection" /> that represents the tree nodes assigned to the current tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.Nodes%2A> property can hold a collection of other <xref:System.Windows.Forms.TreeNode> objects. Each of the tree node in the collection has a <xref:System.Windows.Forms.TreeNode.Nodes%2A> property that can contain its own <xref:System.Windows.Forms.TreeNodeCollection>. This nesting of tree nodes can make it difficult to navigate a tree structure. The <xref:System.Windows.Forms.TreeNode.FullPath%2A> property makes it easier to determine your location in a tree. - - - -## Examples - The following code example removes the selected tree node from one <xref:System.Windows.Forms.TreeView> and adds it to another if both tree node collections are not read-only. When a <xref:System.Windows.Forms.Button> is clicked, the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType> is deleted from one <xref:System.Windows.Forms.TreeView> using the <xref:System.Windows.Forms.TreeNodeCollection.Remove%2A> method and added to the other <xref:System.Windows.Forms.TreeView> using the <xref:System.Windows.Forms.TreeNodeCollection.Insert%2A> method. This example requires that you have two <xref:System.Windows.Forms.TreeView> controls named `treeView1` and `treeView2`, and a <xref:System.Windows.Forms.Button> on a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.Nodes%2A> property can hold a collection of other <xref:System.Windows.Forms.TreeNode> objects. Each of the tree node in the collection has a <xref:System.Windows.Forms.TreeNode.Nodes%2A> property that can contain its own <xref:System.Windows.Forms.TreeNodeCollection>. This nesting of tree nodes can make it difficult to navigate a tree structure. The <xref:System.Windows.Forms.TreeNode.FullPath%2A> property makes it easier to determine your location in a tree. + + + +## Examples + The following code example removes the selected tree node from one <xref:System.Windows.Forms.TreeView> and adds it to another if both tree node collections are not read-only. When a <xref:System.Windows.Forms.Button> is clicked, the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType> is deleted from one <xref:System.Windows.Forms.TreeView> using the <xref:System.Windows.Forms.TreeNodeCollection.Remove%2A> method and added to the other <xref:System.Windows.Forms.TreeView> using the <xref:System.Windows.Forms.TreeNodeCollection.Insert%2A> method. This example requires that you have two <xref:System.Windows.Forms.TreeView> controls named `treeView1` and `treeView2`, and a <xref:System.Windows.Forms.Button> on a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNodeCollection/CPP/treenodecollection.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Nodes/treenodecollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNodeCollection/VB/treenodecollection.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNodeCollection/VB/treenodecollection.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeNodeCollection" /> @@ -2211,20 +2211,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the parent tree node of the current tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the parent of the current tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the tree node is at the root level, the <xref:System.Windows.Forms.TreeNode.Parent%2A> property returns `null`. - - - -## Examples - The following code example displays the <xref:System.Windows.Forms.TreeNode.Text%2A> and <xref:System.Windows.Forms.TreeNode.Index%2A> property values of the <xref:System.Windows.Forms.TreeNode> represented by the <xref:System.Windows.Forms.TreeNode.Parent%2A> property of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType>. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have at least two root nodes, each having at least one child node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the tree node is at the root level, the <xref:System.Windows.Forms.TreeNode.Parent%2A> property returns `null`. + + + +## Examples + The following code example displays the <xref:System.Windows.Forms.TreeNode.Text%2A> and <xref:System.Windows.Forms.TreeNode.Index%2A> property values of the <xref:System.Windows.Forms.TreeNode> represented by the <xref:System.Windows.Forms.TreeNode.Parent%2A> property of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A?displayProperty=nameWithType>. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have at least two root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: + ]]></format> </remarks> </Docs> @@ -2267,20 +2267,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the previous sibling tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the previous sibling tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.PrevNode%2A> is the previous sibling <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the tree node's parent <xref:System.Windows.Forms.TreeNode>. If there is no previous tree node, the <xref:System.Windows.Forms.TreeNode.PrevNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.PrevNode%2A> is the previous sibling <xref:System.Windows.Forms.TreeNode> in the <xref:System.Windows.Forms.TreeNodeCollection> stored in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> property of the tree node's parent <xref:System.Windows.Forms.TreeNode>. If there is no previous tree node, the <xref:System.Windows.Forms.TreeNode.PrevNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.NextNode" /> @@ -2326,20 +2326,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets the previous visible tree node.</summary> <value>A <see cref="T:System.Windows.Forms.TreeNode" /> that represents the previous visible tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A> can be a child, sibling, or a tree node from another branch. If there is no previous tree node, the <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A> property returns `null`. - - - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A> can be a child, sibling, or a tree node from another branch. If there is no previous tree node, the <xref:System.Windows.Forms.TreeNode.PrevVisibleNode%2A> property returns `null`. + + + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.NextVisibleNode" /> @@ -2379,20 +2379,20 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <Docs> <summary>Removes the current tree node from the tree view control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.TreeNode.Remove%2A> method is called, the tree node, and any child tree nodes that are assigned to the <xref:System.Windows.Forms.TreeNode>, are removed from the <xref:System.Windows.Forms.TreeView>. The removed child nodes are removed from the <xref:System.Windows.Forms.TreeView> but are still attached to this tree node. - - - -## Examples - The following code example removes a <xref:System.Windows.Forms.TreeNode> when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have two or more root tree nodes, each having at least one child node. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.TreeNode.Remove%2A> method is called, the tree node, and any child tree nodes that are assigned to the <xref:System.Windows.Forms.TreeNode>, are removed from the <xref:System.Windows.Forms.TreeView>. The removed child nodes are removed from the <xref:System.Windows.Forms.TreeView> but are still attached to this tree node. + + + +## Examples + The following code example removes a <xref:System.Windows.Forms.TreeNode> when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have two or more root tree nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNodeCollection.Add(System.String)" /> @@ -2460,27 +2460,27 @@ If you set the <xref:System.Windows.Forms.TreeNode.ImageKey%2A> property, the <x <summary>Gets or sets the image list index value of the image that is displayed when the tree node is in the selected state.</summary> <value>A zero-based index value that represents the image position in an <see cref="T:System.Windows.Forms.ImageList" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> value is the index value of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> value is the index value of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A?displayProperty=nameWithType> property. + <xref:System.Windows.Forms.TreeNode.SelectedImageKey%2A> and <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageKey%2A> is automatically set to an empty string (""). - +If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageKey%2A> is automatically set to an empty string (""). + **.NET 5 and later versions:** If the associated <xref:System.Windows.Forms.TreeView.ImageList%2A> property value is changed to `null`, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property returns its default value, -1. However, the assigned <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> value is retained internally and used when another <xref:System.Windows.Forms.ImageList> object is assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property. If the new <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property has an <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A?displayProperty=nameWithType> property value that is less than or equal to the value assigned to the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property minus one (to account for the collection being a zero-based index), the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property value is adjusted to one less than the <xref:System.Windows.Forms.ImageList.ImageCollection.Count%2A> property value. -For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> value changes to 1. - +For example, consider a button control whose <xref:System.Windows.Forms.ImageList> has three images and whose <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property is set to 2. If a new <xref:System.Windows.Forms.ImageList> that has only two images is assigned to the button, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> value changes to 1. + > [!NOTE] > The default value of the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> property is the same as the <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> property of the <xref:System.Windows.Forms.TreeView> control that the <xref:System.Windows.Forms.TreeNode> is assigned to. - -## Examples - The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> containing a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> containing `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + +## Examples + The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that is displayed when the tree node is in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> containing a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> containing `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">.NET 5 and later: <paramref name="value" /> is less than -2.</exception> @@ -2547,13 +2547,13 @@ For example, consider a button control whose <xref:System.Windows.Forms.ImageLis <summary>Gets or sets the key of the image displayed in the tree node when it is in a selected state.</summary> <value>The key of the image displayed when the tree node is in a selected state.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The image key returned by this property is contained in the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The image key returned by this property is contained in the <xref:System.Windows.Forms.TreeView.ImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. + <xref:System.Windows.Forms.TreeNode.SelectedImageKey> and <xref:System.Windows.Forms.TreeNode.SelectedImageIndex> are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex> property, <xref:System.Windows.Forms.TreeNode.SelectedImageKey> is automatically set to an empty string (""). +If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeNode.SelectedImageIndex> property, <xref:System.Windows.Forms.TreeNode.SelectedImageKey> is automatically set to an empty string (""). ]]></format> </remarks> @@ -2652,15 +2652,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets or sets the index of the image that is used to indicate the state of the <see cref="T:System.Windows.Forms.TreeNode" /> when the parent <see cref="T:System.Windows.Forms.TreeView" /> has its <see cref="P:System.Windows.Forms.TreeView.CheckBoxes" /> property set to <see langword="false" />.</summary> <value>The index of the image that is used to indicate the state of the <see cref="T:System.Windows.Forms.TreeNode" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The image index that is returned by this property is contained in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. - - If the parent <xref:System.Windows.Forms.TreeView> has check boxes enabled, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> is ignored and the node will display the first or second image in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> set on the parent <xref:System.Windows.Forms.TreeView> to indicate an unchecked or checked state, respectively. Toggling the <xref:System.Windows.Forms.TreeNode.Checked%2A> property does not affect the value of the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>. - - The <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> returns -1 when not set. The <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> and <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> property is automatically set to -1. Alternatively, if you set <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>, <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is automatically set to an empty string (""). - + <format type="text/markdown"><![CDATA[ + +## Remarks + The image index that is returned by this property is contained in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. + + If the parent <xref:System.Windows.Forms.TreeView> has check boxes enabled, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> is ignored and the node will display the first or second image in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> set on the parent <xref:System.Windows.Forms.TreeView> to indicate an unchecked or checked state, respectively. Toggling the <xref:System.Windows.Forms.TreeNode.Checked%2A> property does not affect the value of the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>. + + The <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> returns -1 when not set. The <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> and <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> property is automatically set to -1. Alternatively, if you set <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>, <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is automatically set to an empty string (""). + ]]></format> </remarks> <exception cref="T:System.ArgumentOutOfRangeException">The specified index is less than -1 or greater than 14.</exception> @@ -2727,15 +2727,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets or sets the key of the image that is used to indicate the state of the <see cref="T:System.Windows.Forms.TreeNode" /> when the parent <see cref="T:System.Windows.Forms.TreeView" /> has its <see cref="P:System.Windows.Forms.TreeView.CheckBoxes" /> property set to <see langword="false" />.</summary> <value>The key of the image that is used to indicate the state of the <see cref="T:System.Windows.Forms.TreeNode" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The image key that is returned by this property is contained in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. - - If the parent <xref:System.Windows.Forms.TreeView> has check boxes enabled, the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is ignored and the node will display the first or second image in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> set on the parent <xref:System.Windows.Forms.TreeView> to indicate an unchecked or checked state, respectively. Toggling the <xref:System.Windows.Forms.TreeNode.Checked%2A> property does not affect the value of the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A>. - - The <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> and <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> property is automatically set to -1. Alternatively, if you set <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>, <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is automatically set to an empty string (""). You should set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> to an image with a corresponding index between 0 and 14. You can set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed - + <format type="text/markdown"><![CDATA[ + +## Remarks + The image key that is returned by this property is contained in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> property of the parent <xref:System.Windows.Forms.TreeView> control. + + If the parent <xref:System.Windows.Forms.TreeView> has check boxes enabled, the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is ignored and the node will display the first or second image in the <xref:System.Windows.Forms.TreeView.StateImageList%2A> set on the parent <xref:System.Windows.Forms.TreeView> to indicate an unchecked or checked state, respectively. Toggling the <xref:System.Windows.Forms.TreeNode.Checked%2A> property does not affect the value of the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A>. + + The <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> and <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> property, the <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A> property is automatically set to -1. Alternatively, if you set <xref:System.Windows.Forms.TreeNode.StateImageIndex%2A>, <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> is automatically set to an empty string (""). You should set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> to an image with a corresponding index between 0 and 14. You can set the <xref:System.Windows.Forms.TreeNode.StateImageKey%2A> to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeNode.StateImageIndex" /> @@ -2842,23 +2842,23 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets or sets the object that contains data about the tree node.</summary> <value>An <see cref="T:System.Object" /> that contains data about the tree node. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Any <xref:System.Object> derived type can be assigned to this property. If this property is being set through the Windows Forms designer, only text can be assigned. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Any <xref:System.Object> derived type can be assigned to this property. If this property is being set through the Windows Forms designer, only text can be assigned. + > [!CAUTION] -> The <xref:System.Windows.Forms.TreeNode.Clone%2A> method performs a shallow copy of the node. If the value of the <xref:System.Windows.Forms.TreeNode.Tag%2A> property is a reference type, both the original and cloned copy will point to the same single instance of the <xref:System.Windows.Forms.TreeNode.Tag%2A> value. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. - +> The <xref:System.Windows.Forms.TreeNode.Clone%2A> method performs a shallow copy of the node. If the value of the <xref:System.Windows.Forms.TreeNode.Tag%2A> property is a reference type, both the original and cloned copy will point to the same single instance of the <xref:System.Windows.Forms.TreeNode.Tag%2A> value. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Object" /> @@ -2897,22 +2897,22 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets or sets the text displayed in the label of the tree node.</summary> <value>The text displayed in the label of the tree node.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The maximum number of characters that a <xref:System.Windows.Forms.TreeNode> can display is 259. If a <xref:System.String> that has more than 259 characters is assigned to this property, only the first 259 characters are displayed. - - This property cannot be set by the user if the <xref:System.Windows.Forms.TreeView.LabelEdit%2A> property of the parent <xref:System.Windows.Forms.TreeView> is set to `false`. The alternative to explicitly setting this property is to create the tree node by using one of the <xref:System.Windows.Forms.TreeNode.%23ctor%2A> constructors that has a string parameter that represents the <xref:System.Windows.Forms.TreeNode.Text%2A> property. The label is displayed next to the <xref:System.Windows.Forms.TreeNode> image, if one is displayed. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The maximum number of characters that a <xref:System.Windows.Forms.TreeNode> can display is 259. If a <xref:System.String> that has more than 259 characters is assigned to this property, only the first 259 characters are displayed. + + This property cannot be set by the user if the <xref:System.Windows.Forms.TreeView.LabelEdit%2A> property of the parent <xref:System.Windows.Forms.TreeView> is set to `false`. The alternative to explicitly setting this property is to create the tree node by using one of the <xref:System.Windows.Forms.TreeNode.%23ctor%2A> constructors that has a string parameter that represents the <xref:System.Windows.Forms.TreeNode.Text%2A> property. The label is displayed next to the <xref:System.Windows.Forms.TreeNode> image, if one is displayed. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an <xref:System.Collections.ArrayList> is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the <xref:System.Windows.Forms.TreeNode.Tag%2A> property, and the tree nodes representing `Customer` objects are displayed with <xref:System.Drawing.Color.Orange%2A> text. This example requires that you have a `Customer` and `Order` object defined, a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>, and an <xref:System.Collections.ArrayList> named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.TreeView.LabelEdit" /> @@ -2947,23 +2947,23 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <Docs> <summary>Toggles the tree node to either the expanded or collapsed state.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The tree node is toggled to the state opposite its current state, either expanded or collapsed. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The tree node is toggled to the state opposite its current state, either expanded or collapsed. + > [!NOTE] -> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example removes a <xref:System.Windows.Forms.TreeNode> when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have two or more root tree nodes, each having at least one child node. - +> The state of a <xref:System.Windows.Forms.TreeNode> is persisted. For example, if the next level of child nodes was not collapsed previously, when the <xref:System.Windows.Forms.TreeNode.Expand%2A> method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example removes a <xref:System.Windows.Forms.TreeNode> when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control on it. The <xref:System.Windows.Forms.TreeView> should have two or more root tree nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.TreeNode.Expand" /> @@ -3016,21 +3016,21 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets or sets the text that appears when the mouse pointer hovers over a <see cref="T:System.Windows.Forms.TreeNode" />.</summary> <value>Gets the text that appears when the mouse pointer hovers over a <see cref="T:System.Windows.Forms.TreeNode" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You must set the <xref:System.Windows.Forms.TreeView.ShowNodeToolTips%2A> property of the parent <xref:System.Windows.Forms.TreeView> to `true` for the <xref:System.Windows.Forms.TreeNode.ToolTipText%2A> to be visible at run time. - - If the <xref:System.Windows.Forms.TreeView> control has a ToolTip and also contains a <xref:System.Windows.Forms.TreeNode> that has a <xref:System.Windows.Forms.ToolTip>, only the <xref:System.Windows.Forms.ToolTip> for the node will be shown. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.TreeNode.ToolTipText%2A> and <xref:System.Windows.Forms.TreeView.ShowNodeToolTips%2A> properties. To run this example, paste the following code into a Windows Form and call `InitializeTreeViewWithToolTips` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You must set the <xref:System.Windows.Forms.TreeView.ShowNodeToolTips%2A> property of the parent <xref:System.Windows.Forms.TreeView> to `true` for the <xref:System.Windows.Forms.TreeNode.ToolTipText%2A> to be visible at run time. + + If the <xref:System.Windows.Forms.TreeView> control has a ToolTip and also contains a <xref:System.Windows.Forms.TreeNode> that has a <xref:System.Windows.Forms.ToolTip>, only the <xref:System.Windows.Forms.ToolTip> for the node will be shown. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.TreeNode.ToolTipText%2A> and <xref:System.Windows.Forms.TreeView.ShowNodeToolTips%2A> properties. To run this example, paste the following code into a Windows Form and call `InitializeTreeViewWithToolTips` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ToolTipText/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb" id="Snippet7"::: + ]]></format> </remarks> </Docs> @@ -3104,15 +3104,15 @@ If you set the <xref:System.Windows.Forms.TreeNode.SelectedImageKey> property, t <summary>Gets the parent tree view that the tree node is assigned to.</summary> <value>A <see cref="T:System.Windows.Forms.TreeView" /> that represents the parent tree view that the tree node is assigned to, or <see langword="null" /> if the node has not been assigned to a tree view.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + <format type="text/markdown"><![CDATA[ + +## Examples + The following code example selects the appropriate <xref:System.Windows.Forms.TreeNode> after determining if the <xref:System.Windows.Forms.TreeNode> passed in is selected and which <xref:System.Windows.Forms.TreeNode> to select. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control that has a <xref:System.Windows.Forms.TreeNodeCollection> that contains several <xref:System.Windows.Forms.TreeNode> objects. It also requires that you have a <xref:System.Windows.Forms.ComboBox> with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.TreeView" /> diff --git a/xml/System.Windows.Forms/UserControl.xml b/xml/System.Windows.Forms/UserControl.xml index 39ba458d679..a3fad041166 100644 --- a/xml/System.Windows.Forms/UserControl.xml +++ b/xml/System.Windows.Forms/UserControl.xml @@ -70,28 +70,28 @@ <Docs> <summary>Provides an empty control that can be used to create other controls.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + > [!NOTE] -> You might consider creating a namespace that contains several classes of user controls and compiling it into one DLL. This DLL can be referenced and distributed with the application or all applications within an organization. This gives you the ability to reference the user control in many applications and save time laying out and coding the contained elements of the user control. A user control also gives you consistency within or across applications; for example, all address information input blocks will all have the same appearance and behavior. Consistency gives your application a more polished and professional appearance. -> -> You can host Windows Forms <xref:System.Windows.Forms.UserControl>-derived classes inside of a form, on another <xref:System.Windows.Forms.UserControl>, inside of Internet Explorer on a web page, or inside a <xref:System.Windows.Forms.WebBrowser> control hosted on a form. - +> You might consider creating a namespace that contains several classes of user controls and compiling it into one DLL. This DLL can be referenced and distributed with the application or all applications within an organization. This gives you the ability to reference the user control in many applications and save time laying out and coding the contained elements of the user control. A user control also gives you consistency within or across applications; for example, all address information input blocks will all have the same appearance and behavior. Consistency gives your application a more polished and professional appearance. +> +> You can host Windows Forms <xref:System.Windows.Forms.UserControl>-derived classes inside of a form, on another <xref:System.Windows.Forms.UserControl>, inside of Internet Explorer on a web page, or inside a <xref:System.Windows.Forms.WebBrowser> control hosted on a form. + > [!NOTE] -> When hosting a <xref:System.Windows.Forms.UserControl> inside of the <xref:System.Windows.Forms.WebBrowser> control, you cannot turn off Visual Styles using the `META` tag value `MSThemeCompatible`. For more information about Visual Styles, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - -## Examples - The following code example creates a <xref:System.Windows.Forms.UserControl> that can be reused in multiple applications to get user information. This example adds several <xref:System.Windows.Forms.Label> controls, <xref:System.Windows.Forms.TextBox> controls and an <xref:System.Windows.Forms.ErrorProvider> to the <xref:System.Windows.Forms.UserControl> to gather the user's information. Additionally, the user's email address is validated in the <xref:System.Windows.Forms.Control.Validating> event of the <xref:System.Windows.Forms.TextBox> and the <xref:System.Windows.Forms.ErrorProvider> object is used to give the user feedback if the data fails validation. The code is intended to be compiled into a DLL for reference in other applications. - +> When hosting a <xref:System.Windows.Forms.UserControl> inside of the <xref:System.Windows.Forms.WebBrowser> control, you cannot turn off Visual Styles using the `META` tag value `MSThemeCompatible`. For more information about Visual Styles, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + +## Examples + The following code example creates a <xref:System.Windows.Forms.UserControl> that can be reused in multiple applications to get user information. This example adds several <xref:System.Windows.Forms.Label> controls, <xref:System.Windows.Forms.TextBox> controls and an <xref:System.Windows.Forms.ErrorProvider> to the <xref:System.Windows.Forms.UserControl> to gather the user's information. Additionally, the user's email address is validated in the <xref:System.Windows.Forms.Control.Validating> event of the <xref:System.Windows.Forms.TextBox> and the <xref:System.Windows.Forms.ErrorProvider> object is used to give the user feedback if the data fails validation. The code is intended to be compiled into a DLL for reference in other applications. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic UserControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/UserControl/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.ContainerControl" /> @@ -121,20 +121,20 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.UserControl" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You do not typically create an instance of <xref:System.Windows.Forms.UserControl>. To create your own user control class, inherit from the <xref:System.Windows.Forms.UserControl> class. - - - -## Examples - The following code example creates an instance of the <xref:System.Windows.Forms.UserControl> derived class, `MyCustomerInfoUserControl`, which was created in the example section of the <xref:System.Windows.Forms.UserControl> class overview. The user control is added to a <xref:System.Windows.Forms.Panel> control and has its <xref:System.Windows.Forms.Control.Dock%2A> property set to <xref:System.Windows.Forms.DockStyle.Fill?displayProperty=nameWithType>. The <xref:System.Windows.Forms.Panel> is then added to a <xref:System.Windows.Forms.Form>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You do not typically create an instance of <xref:System.Windows.Forms.UserControl>. To create your own user control class, inherit from the <xref:System.Windows.Forms.UserControl> class. + + + +## Examples + The following code example creates an instance of the <xref:System.Windows.Forms.UserControl> derived class, `MyCustomerInfoUserControl`, which was created in the example section of the <xref:System.Windows.Forms.UserControl> class overview. The user control is added to a <xref:System.Windows.Forms.Panel> control and has its <xref:System.Windows.Forms.Control.Dock%2A> property set to <xref:System.Windows.Forms.DockStyle.Fill?displayProperty=nameWithType>. The <xref:System.Windows.Forms.Panel> is then added to a <xref:System.Windows.Forms.Form>. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic UserControl.UserControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/UserControl/.ctor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl.UserControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl.UserControl Example/VB/source.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -265,11 +265,11 @@ <summary>Gets or sets how the control will resize itself.</summary> <value>A value from the <see cref="T:System.Windows.Forms.AutoSizeMode" /> enumeration. The default is <see cref="F:System.Windows.Forms.AutoSizeMode.GrowOnly" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Controls that do not recognize the <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> property will function as though <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> was set to <xref:System.Windows.Forms.AutoSizeMode.GrowAndShrink>. All controls that recognize the <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> property will, by default, grow to fit available space, but will not shrink below the value specified by the <xref:System.Windows.Forms.Control.Size%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Controls that do not recognize the <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> property will function as though <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> was set to <xref:System.Windows.Forms.AutoSizeMode.GrowAndShrink>. All controls that recognize the <xref:System.Windows.Forms.UserControl.AutoSizeMode%2A> property will, by default, grow to fit available space, but will not shrink below the value specified by the <xref:System.Windows.Forms.Control.Size%2A> property. + ]]></format> </remarks> </Docs> @@ -348,21 +348,21 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.UserControl.AutoValidate" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If your custom control performs any of its own validation, you will need to know when a developer using your control has changed the <xref:System.Windows.Forms.UserControl.AutoValidate%2A> property so that you can change your control's validation behavior accordingly. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.UserControl.AutoValidateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.UserControl> named `UserControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.UserControl.AutoValidateChanged> event. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If your custom control performs any of its own validation, you will need to know when a developer using your control has changed the <xref:System.Windows.Forms.UserControl.AutoValidate%2A> property so that you can change your control's validation behavior accordingly. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.UserControl.AutoValidateChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.UserControl> named `UserControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.UserControl.AutoValidateChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet641"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet641"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet641"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.UserControl.AutoValidate" /> @@ -413,11 +413,11 @@ <summary>Gets or sets the border style of the user control.</summary> <value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - When the <xref:System.Windows.Forms.UserControl.BorderStyle%2A> property is set to <xref:System.Windows.Forms.BorderStyle.Fixed3D>, the control has a sunken, three-dimensional appearance. To display a flat, thin border, set the <xref:System.Windows.Forms.BorderStyle> property to <xref:System.Windows.Forms.BorderStyle.FixedSingle>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + When the <xref:System.Windows.Forms.UserControl.BorderStyle%2A> property is set to <xref:System.Windows.Forms.BorderStyle.Fixed3D>, the control has a sunken, three-dimensional appearance. To display a flat, thin border, set the <xref:System.Windows.Forms.BorderStyle> property to <xref:System.Windows.Forms.BorderStyle.FixedSingle>. + ]]></format> </remarks> <exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The assigned value is not one of the <see cref="T:System.Windows.Forms.BorderStyle" /> values.</exception> @@ -516,29 +516,29 @@ <Docs> <summary>Occurs before the control becomes visible for the first time.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this event to perform tasks such as allocating resources used by the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this event to perform tasks such as allocating resources used by the control. + > [!NOTE] -> If the <xref:System.Windows.Forms.UserControl> is part of an MDI child form, the <xref:System.Windows.Forms.UserControl.Load> event will occur each time the child form is shown. In this case, you should put any one-time initialization code in the <xref:System.Windows.Forms.UserControl.%23ctor%2A> instead of a <xref:System.Windows.Forms.UserControl.Load> event handler. - +> If the <xref:System.Windows.Forms.UserControl> is part of an MDI child form, the <xref:System.Windows.Forms.UserControl.Load> event will occur each time the child form is shown. In this case, you should put any one-time initialization code in the <xref:System.Windows.Forms.UserControl.%23ctor%2A> instead of a <xref:System.Windows.Forms.UserControl.Load> event handler. + > [!CAUTION] -> The <xref:System.Windows.Forms.UserControl.Load> event occurs when the handle for the <xref:System.Windows.Forms.UserControl> is created. In some circumstances, this can cause the <xref:System.Windows.Forms.UserControl.Load> event to occur more than one time. For example, the <xref:System.Windows.Forms.UserControl.Load> event occurs when the <xref:System.Windows.Forms.UserControl> is loaded, and again if the handle is recreated. (One way that a handle is recreated is by calling the <xref:System.Windows.Forms.Control.RecreateHandle%2A> method.) To account for the <xref:System.Windows.Forms.UserControl.Load> event occurring more than one time, you should put any one time initialization code in the <xref:System.Windows.Forms.UserControl.%23ctor%2A> constructor instead of a <xref:System.Windows.Forms.UserControl.Load> event handler. In addition, you should not add data bindings to the <xref:System.Windows.Forms.UserControl> in a <xref:System.Windows.Forms.UserControl.Load> event handler. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.UserControl.Load> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.UserControl> named `UserControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.UserControl.Load> event. - +> The <xref:System.Windows.Forms.UserControl.Load> event occurs when the handle for the <xref:System.Windows.Forms.UserControl> is created. In some circumstances, this can cause the <xref:System.Windows.Forms.UserControl.Load> event to occur more than one time. For example, the <xref:System.Windows.Forms.UserControl.Load> event occurs when the <xref:System.Windows.Forms.UserControl> is loaded, and again if the handle is recreated. (One way that a handle is recreated is by calling the <xref:System.Windows.Forms.Control.RecreateHandle%2A> method.) To account for the <xref:System.Windows.Forms.UserControl.Load> event occurring more than one time, you should put any one time initialization code in the <xref:System.Windows.Forms.UserControl.%23ctor%2A> constructor instead of a <xref:System.Windows.Forms.UserControl.Load> event handler. In addition, you should not add data bindings to the <xref:System.Windows.Forms.UserControl> in a <xref:System.Windows.Forms.UserControl.Load> event handler. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.UserControl.Load> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.UserControl> named `UserControl1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.UserControl.Load> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet642"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet642"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet642"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.UserControl.OnLoad(System.EventArgs)" /> @@ -578,13 +578,13 @@ <Docs> <summary>Raises the <see langword="CreateControl" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.UserControl.OnCreateControl%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.UserControl.OnCreateControl%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -628,15 +628,15 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.UserControl.Load" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.UserControl.OnLoad%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.UserControl.OnLoad%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> diff --git a/xml/System.Windows.Forms/WebBrowser.xml b/xml/System.Windows.Forms/WebBrowser.xml index b149eb82ab7..da7c0890794 100644 --- a/xml/System.Windows.Forms/WebBrowser.xml +++ b/xml/System.Windows.Forms/WebBrowser.xml @@ -57,57 +57,57 @@ <Docs> <summary>Enables a user to navigate Web pages inside a form.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - + <format type="text/markdown"><![CDATA[ + ## Remarks > [!NOTE] > For new Windows Forms projects, we recommend using the Microsoft Edge [WebView2 control](/microsoft-edge/webview2/) instead of the <xref:System.Windows.Forms.WebBrowser> control. - The <xref:System.Windows.Forms.WebBrowser> control lets you host Web pages and other browser-enabled documents in your Windows Forms applications. You can use the <xref:System.Windows.Forms.WebBrowser> control, for example, to provide integrated HTML-based user assistance or Web browsing capabilities in your application. Additionally, you can use the <xref:System.Windows.Forms.WebBrowser> control to add your existing Web-based controls to your Windows Forms client applications. - + The <xref:System.Windows.Forms.WebBrowser> control lets you host Web pages and other browser-enabled documents in your Windows Forms applications. You can use the <xref:System.Windows.Forms.WebBrowser> control, for example, to provide integrated HTML-based user assistance or Web browsing capabilities in your application. Additionally, you can use the <xref:System.Windows.Forms.WebBrowser> control to add your existing Web-based controls to your Windows Forms client applications. + > [!IMPORTANT] -> The <xref:System.Windows.Forms.WebBrowser> control is resource-intensive. To ensure that all resources are released in a timely fashion, call the <xref:System.ComponentModel.Component.Dispose> method when you're finished using the control. You must call the <xref:System.ComponentModel.Component.Dispose> method on the same thread that attached the events, which should always be the message or user-interface (UI) thread. - - The <xref:System.Windows.Forms.WebBrowser> control cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - The <xref:System.Windows.Forms.WebBrowser> control has several properties, methods, and events related to navigation. The following members let you navigate the control to a specific URL, move backward and forward through the navigation history list, and load the home page and search page of the current user: - -- <xref:System.Windows.Forms.WebBrowser.Url%2A> -- <xref:System.Windows.Forms.WebBrowser.Navigate%2A> -- <xref:System.Windows.Forms.WebBrowser.GoBack%2A> -- <xref:System.Windows.Forms.WebBrowser.GoForward%2A> -- <xref:System.Windows.Forms.WebBrowser.GoHome%2A> +> The <xref:System.Windows.Forms.WebBrowser> control is resource-intensive. To ensure that all resources are released in a timely fashion, call the <xref:System.ComponentModel.Component.Dispose> method when you're finished using the control. You must call the <xref:System.ComponentModel.Component.Dispose> method on the same thread that attached the events, which should always be the message or user-interface (UI) thread. + + The <xref:System.Windows.Forms.WebBrowser> control cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + The <xref:System.Windows.Forms.WebBrowser> control has several properties, methods, and events related to navigation. The following members let you navigate the control to a specific URL, move backward and forward through the navigation history list, and load the home page and search page of the current user: + +- <xref:System.Windows.Forms.WebBrowser.Url%2A> +- <xref:System.Windows.Forms.WebBrowser.Navigate%2A> +- <xref:System.Windows.Forms.WebBrowser.GoBack%2A> +- <xref:System.Windows.Forms.WebBrowser.GoForward%2A> +- <xref:System.Windows.Forms.WebBrowser.GoHome%2A> - <xref:System.Windows.Forms.WebBrowser.GoSearch%2A> - - If the navigation is unsuccessful, a page indicating the problem is displayed. Navigation with any of these members causes the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events to occur at different stages of navigation. - - These and other members, such as the <xref:System.Windows.Forms.WebBrowser.Stop%2A> and <xref:System.Windows.Forms.WebBrowser.Refresh%2A> methods, let you implement user interface controls in your application similar to those in Internet Explorer. Some members are useful even when you don't want to display the <xref:System.Windows.Forms.WebBrowser> control on your form. For example, you can use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method to print the latest version of a Web page without displaying the page to the user. - - The <xref:System.Windows.Forms.WebBrowser> control also lets you display content that you create in your application or you retrieve from a database or resource file. Use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property to get or set the contents of the current document as a string or data stream. - - You can also manipulate the contents of a Web page through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property, which contains an <xref:System.Windows.Forms.HtmlDocument> object that provides managed access to the HTML document object model (DOM) for the current page. This property is useful, when used in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between your application code and dynamic HTML (DHTML) code in a Web page, letting you combine Web-based controls and Windows Forms controls in a single user interface. You can use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property to call scripting code methods from your application. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to the object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. - - The <xref:System.Windows.Forms.WebBrowser> control is a managed wrapper for the ActiveX [WebBrowser control](/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752040(v=vs.85)), and uses whichever version of the control is installed on the user's computer. - + + If the navigation is unsuccessful, a page indicating the problem is displayed. Navigation with any of these members causes the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events to occur at different stages of navigation. + + These and other members, such as the <xref:System.Windows.Forms.WebBrowser.Stop%2A> and <xref:System.Windows.Forms.WebBrowser.Refresh%2A> methods, let you implement user interface controls in your application similar to those in Internet Explorer. Some members are useful even when you don't want to display the <xref:System.Windows.Forms.WebBrowser> control on your form. For example, you can use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method to print the latest version of a Web page without displaying the page to the user. + + The <xref:System.Windows.Forms.WebBrowser> control also lets you display content that you create in your application or you retrieve from a database or resource file. Use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property to get or set the contents of the current document as a string or data stream. + + You can also manipulate the contents of a Web page through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property, which contains an <xref:System.Windows.Forms.HtmlDocument> object that provides managed access to the HTML document object model (DOM) for the current page. This property is useful, when used in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between your application code and dynamic HTML (DHTML) code in a Web page, letting you combine Web-based controls and Windows Forms controls in a single user interface. You can use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property to call scripting code methods from your application. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to the object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. + + The <xref:System.Windows.Forms.WebBrowser> control is a managed wrapper for the ActiveX [WebBrowser control](/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752040(v=vs.85)), and uses whichever version of the control is installed on the user's computer. + > [!NOTE] > > - This class makes security demands at the class level. A <xref:System.Security.SecurityException> is thrown when a derived class or any caller in the call stack does not have full trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). -> - The <xref:System.Windows.Forms.WebBrowser> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. +> - The <xref:System.Windows.Forms.WebBrowser> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute. > - For accessibility purposes, the <xref:System.Windows.Forms.Control.TabStop> property should be set to `false` when there is no content to display in the <xref:System.Windows.Forms.WebBrowser> control. Change the value to `true` to enable users to navigate via keyboard into the contents of the control. - -## Examples - The following code example demonstrates how to implement an address bar for use with the <xref:System.Windows.Forms.WebBrowser> control. This example requires that you have a form that contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press <kbd>Enter</kbd> or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + +## Examples + The following code example demonstrates how to implement an address bar for use with the <xref:System.Windows.Forms.WebBrowser> control. This example requires that you have a form that contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press <kbd>Enter</kbd> or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/webbrowser-control-windows-forms">WebBrowser Control (Windows Forms)</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/webbrowser-control-windows-forms">WebBrowser Control (Windows Forms)</related> <related type="Article" href="/dotnet/framework/misc/using-libraries-from-partially-trusted-code">Using Libraries from Partially Trusted Code</related> <related type="Article" href="https://learn.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752040(v=vs.85)">WebBrowser Control</related> </Docs> @@ -134,17 +134,17 @@ <Docs> <summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.WebBrowser" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.WebBrowser> control is empty. To navigate it to an initial document, set the <xref:System.Windows.Forms.WebBrowser.Url%2A> property. - -## Examples - The following code example demonstrates the use of this member. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.WebBrowser> control is empty. To navigate it to an initial document, set the <xref:System.Windows.Forms.WebBrowser.Url%2A> property. + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: + ]]></format> </remarks> <exception cref="T:System.NotSupportedException">The <see cref="T:System.Windows.Forms.WebBrowser" /> control is hosted inside Internet Explorer.</exception> @@ -183,11 +183,11 @@ <value> <see langword="true" /> if the control can navigate to another page; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This property does not prevent you from loading an initial page by setting the <xref:System.Windows.Forms.WebBrowser.Url%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property, but will prevent all subsequent navigation. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This property does not prevent you from loading an initial page by setting the <xref:System.Windows.Forms.WebBrowser.Url%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property, but will prevent all subsequent navigation. + ]]></format> </remarks> </Docs> @@ -225,24 +225,24 @@ <value> <see langword="true" /> if the control accepts documents that are dropped onto it; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to documents that are dropped onto it. This behavior is useful when you use the control as a generic browser. If you use the control to display content designed specifically for your application, such as HTML-based user assistance, set the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property to `false` to prevent the display of other content. This is particularly useful when you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls. - - You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> and <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> properties to `false`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to documents that are dropped onto it. This behavior is useful when you use the control as a generic browser. If you use the control to display content designed specifically for your application, such as HTML-based user assistance, set the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property to `false` to prevent the display of other content. This is particularly useful when you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls. + + You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> and <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> properties to `false`. + > [!NOTE] -> This property is not related to the <xref:System.Windows.Forms.Control.AllowDrop%2A?displayProperty=nameWithType> property and does not cause drag-and-drop events such as the <xref:System.Windows.Forms.Control.DragDrop?displayProperty=nameWithType> event to occur for the control. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property. - +> This property is not related to the <xref:System.Windows.Forms.Control.AllowDrop%2A?displayProperty=nameWithType> property and does not cause drag-and-drop events such as the <xref:System.Windows.Forms.Control.DragDrop?displayProperty=nameWithType> event to occur for the control. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -332,24 +332,24 @@ <value> <see langword="true" /> if the control can navigate backward; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" /> @@ -389,24 +389,24 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.CanGoBack" /> property value changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to implement a **Back** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `backButton`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to implement a **Back** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `backButton`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.CanGoBack" /> @@ -460,26 +460,26 @@ <value> <see langword="true" /> if the control can navigate forward; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" /> @@ -519,24 +519,24 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.CanGoForward" /> property value changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to implement a **Forward** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonForward`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to implement a **Forward** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonForward`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.CanGoForward" /> @@ -596,19 +596,19 @@ <Docs> <summary>Associates the underlying ActiveX control with a client that can handle control events.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. - - - -## Examples - The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the normal <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. + + + +## Examples + The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the normal <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/CreateSink/WB2.cs" id="Snippet00"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet00"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet00"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.DetachSink" /> @@ -643,16 +643,16 @@ <summary>Returns a reference to the unmanaged <see langword="WebBrowser" /> ActiveX control site, which you can extend to customize the managed <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <returns>A <see cref="T:System.Windows.Forms.WebBrowser.WebBrowserSite" /> that represents the <see langword="WebBrowser" /> ActiveX control site.</returns> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents. - - To use this feature, implement classes that inherit from the <xref:System.Windows.Forms.WebBrowser> and <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> classes. The unmanaged `WebBrowser` ActiveX control uses the protected <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to retrieve extensibility interfaces implemented by the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. Override the <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to return an instance of your own class that inherits from the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. The <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class provides default implementations of the OLE `IDocHostUIHandler` interface. You can provide your own implementation of this interface or implement any other `WebBrowser` ActiveX control interface in order to customize the behavior of the control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents. + + To use this feature, implement classes that inherit from the <xref:System.Windows.Forms.WebBrowser> and <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> classes. The unmanaged `WebBrowser` ActiveX control uses the protected <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to retrieve extensibility interfaces implemented by the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. Override the <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to return an instance of your own class that inherits from the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. The <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class provides default implementations of the OLE `IDocHostUIHandler` interface. You can provide your own implementation of this interface or implement any other `WebBrowser` ActiveX control interface in order to customize the behavior of the control. + > [!NOTE] -> If you provide your own implementation for any `IDocHostUIHandler` members, you must implement all the members of that interface. - +> If you provide your own implementation for any `IDocHostUIHandler` members, you must implement all the members of that interface. + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.WebBrowser.WebBrowserSite" /> @@ -745,21 +745,21 @@ <Docs> <summary>Releases the event-handling client attached in the <see cref="M:System.Windows.Forms.WebBrowser.CreateSink" /> method from the underlying ActiveX control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. - - - -## Examples - The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the standard <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. - - For the complete code example, see <xref:System.Windows.Forms.WebBrowser.CreateSink%2A>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. + + + +## Examples + The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the standard <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. + + For the complete code example, see <xref:System.Windows.Forms.WebBrowser.CreateSink%2A>. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/CreateSink/WB2.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.CreateSink" /> @@ -840,25 +840,25 @@ <summary>Gets an <see cref="T:System.Windows.Forms.HtmlDocument" /> representing the Web page currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>An <see cref="T:System.Windows.Forms.HtmlDocument" /> representing the current page, or <see langword="null" /> if no page is loaded.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property when you want to access the contents of a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control through the HTML document object model (DOM). This is useful, for example, when you want to use Web-based controls in your Windows Forms application. - - You can use this property, in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control and your application. Use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method to call script methods implemented in a Web page from your client application code. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to an object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. - - To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property in a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to determine whether a Web page form has been filled in. If the input field does not contain a value, the navigation is canceled. - - This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property when you want to access the contents of a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control through the HTML document object model (DOM). This is useful, for example, when you want to use Web-based controls in your Windows Forms application. + + You can use this property, in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control and your application. Use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method to call script methods implemented in a Web page from your client application code. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to an object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. + + To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property in a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to determine whether a Web page form has been filled in. If the input field does not contain a value, the navigation is canceled. + + This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -899,41 +899,41 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control finishes loading a document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this event to print a document after it has fully loaded. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this event to print a document after it has fully loaded. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" /> @@ -991,16 +991,16 @@ <summary>Gets or sets a stream containing the contents of the Web page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>A <see cref="T:System.IO.Stream" /> containing the contents of the current Web page, or <see langword="null" /> if no page is loaded. The default is <see langword="null" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to load a Web page into the <xref:System.Windows.Forms.WebBrowser> control from a <xref:System.IO.Stream> object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to load a Web page into the <xref:System.Windows.Forms.WebBrowser> control from a <xref:System.IO.Stream> object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful. + > [!NOTE] -> This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. - - To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. - +> This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. + + To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1056,24 +1056,24 @@ <summary>Gets or sets the HTML contents of the page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>The HTML text of the displayed page, or the empty string ("") if no document is loaded.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property when you want to manipulate the contents of an HTML page displayed in the <xref:System.Windows.Forms.WebBrowser> control using string processing tools. You can use this property, for example, to load pages from a database or to analyze pages using regular expressions. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property when you want to manipulate the contents of an HTML page displayed in the <xref:System.Windows.Forms.WebBrowser> control using string processing tools. You can use this property, for example, to load pages from a database or to analyze pages using regular expressions. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful. + > [!NOTE] -> This property contains the text of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. Alternatively, you can block the thread until the document is loaded by calling the <xref:System.Threading.Thread.Sleep%2A?displayProperty=nameWithType> method in a loop until the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property returns the value that you originally set it to. - - To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property to programmatically display document content of your choosing. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. - +> This property contains the text of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. Alternatively, you can block the thread until the document is loaded by calling the <xref:System.Threading.Thread.Sleep%2A?displayProperty=nameWithType> method in a loop until the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property returns the value that you originally set it to. + + To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property to programmatically display document content of your choosing. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1129,24 +1129,24 @@ <summary>Gets the title of the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>The title of the current document, or the empty string ("") if no document is loaded.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1189,24 +1189,24 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" /> property value changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.DocumentTitleChanged> event to update the form title bar with the title of the current document. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.DocumentTitleChanged> event to update the form title bar with the title of the current document. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" /> @@ -1258,11 +1258,11 @@ <summary>Gets the type of the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>The type of the current document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The value of this property corresponds to the Multipurpose Internet Mail Extensions (MIME) type of the document. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The value of this property corresponds to the Multipurpose Internet Mail Extensions (MIME) type of the document. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1311,11 +1311,11 @@ <summary>Gets a value indicating the encryption method used by the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.WebBrowserEncryptionLevel" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this property with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. When the current document is not encrypted, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Insecure?displayProperty=nameWithType>. When the <xref:System.Windows.Forms.WebBrowser> control displays a Web page containing multiple frames with content of different encryption levels, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Mixed?displayProperty=nameWithType>. When the encryption level is unknown, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Unknown?displayProperty=nameWithType>. Other values indicate the type of encryption present. To mimic the behavior of the lock icon in Internet Explorer, display the encryption type in a ToolTip that appears when the mouse pointer hovers over the indicator. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this property with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. When the current document is not encrypted, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Insecure?displayProperty=nameWithType>. When the <xref:System.Windows.Forms.WebBrowser> control displays a Web page containing multiple frames with content of different encryption levels, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Mixed?displayProperty=nameWithType>. When the encryption level is unknown, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Unknown?displayProperty=nameWithType>. Other values indicate the type of encryption present. To mimic the behavior of the lock icon in Internet Explorer, display the encryption type in a ToolTip that appears when the mouse pointer hovers over the indicator. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1359,21 +1359,21 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control navigates to or away from a Web site that uses encryption.</summary> <remarks> - <format type="text/markdown"><. - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event. - + <format type="text/markdown"><. + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet647"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet647"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet647"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.EncryptionLevel" /> @@ -1408,21 +1408,21 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control downloads a file.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.FileDownload> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.FileDownload> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.FileDownload> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.FileDownload> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet648"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet648"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet648"::: + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.CancelEventArgs" /> @@ -1489,22 +1489,22 @@ <returns> <see langword="true" /> if the navigation succeeds; <see langword="false" /> if a previous page in the navigation history is not available.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.CanGoBack" /> @@ -1544,24 +1544,24 @@ <returns> <see langword="true" /> if the navigation succeeds; <see langword="false" /> if a subsequent page in the navigation history is not available.</returns> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.CanGoForward" /> @@ -1599,20 +1599,20 @@ <Docs> <summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the home page of the current user.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet11"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet11"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1652,22 +1652,22 @@ <Docs> <summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the default search page of the current user.</summary> <remarks> - <format type="text/markdown"><. - + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoSearch%2A> method to implement a **Search** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonSearch`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet12"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet12"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1724,11 +1724,11 @@ <value> <see langword="true" /> if the control is busy loading a document; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If this property is `true`, you can use the <xref:System.Windows.Forms.WebBrowser.Stop%2A> method to halt the current navigation before the new document is fully loaded. Use the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property to determine the exact navigation state of the <xref:System.Windows.Forms.WebBrowser> control. The <xref:System.Windows.Forms.WebBrowser.IsBusy%2A> property value is false when the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property value is <xref:System.Windows.Forms.WebBrowserReadyState.Complete?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If this property is `true`, you can use the <xref:System.Windows.Forms.WebBrowser.Stop%2A> method to halt the current navigation before the new document is fully loaded. Use the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property to determine the exact navigation state of the <xref:System.Windows.Forms.WebBrowser> control. The <xref:System.Windows.Forms.WebBrowser.IsBusy%2A> property value is false when the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property value is <xref:System.Windows.Forms.WebBrowserReadyState.Complete?displayProperty=nameWithType>. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1780,11 +1780,11 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.WebBrowser" /> control is in offline mode; otherwise, <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - In offline mode, the <xref:System.Windows.Forms.WebBrowser> control is forced to load Web pages from the local cache rather than downloading them. - + <format type="text/markdown"><![CDATA[ + +## Remarks + In offline mode, the <xref:System.Windows.Forms.WebBrowser> control is forced to load Web pages from the local cache rather than downloading them. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1826,21 +1826,21 @@ <value> <see langword="true" /> if the <see cref="T:System.Windows.Forms.WebBrowser" /> control shortcut menu is enabled; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - By default, the <xref:System.Windows.Forms.WebBrowser> control displays a shortcut menu when a user right-clicks it. This behavior is useful when you use the control as a generic browser. If you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls, set the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property to false. - - You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> and <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> properties to false. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + By default, the <xref:System.Windows.Forms.WebBrowser> control displays a shortcut menu when a user right-clicks it. This behavior is useful when you use the control as a generic browser. If you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls, set the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property to false. + + You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> and <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> properties to false. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" /> @@ -1885,15 +1885,15 @@ <param name="urlString">The URL of the document to load.</param> <summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the previous document.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URI and adds it to the end of the history list. Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - - You can use the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method to implement an address bar similar to the one in Internet Explorer. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URI and adds it to the end of the history list. Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + + You can use the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method to implement an address bar similar to the one in Internet Explorer. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -1941,24 +1941,24 @@ <param name="url">A <see cref="T:System.Uri" /> representing the URL of the document to load.</param> <summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the previous document.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2003,13 +2003,13 @@ <see langword="true" /> to load the document into a new browser window; <see langword="false" /> to load the document into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</param> <summary>Loads the document at the specified Uniform Resource Locator (URL) into a new browser window or into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2059,15 +2059,15 @@ <param name="targetFrameName">The name of the frame in which to load the document.</param> <summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the contents of the Web page frame with the specified name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2112,13 +2112,13 @@ <see langword="true" /> to load the document into a new browser window; <see langword="false" /> to load the document into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</param> <summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into a new browser window or into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2164,15 +2164,15 @@ <param name="targetFrameName">The name of the frame in which to load the document.</param> <summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the contents of the Web page frame with the specified name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2228,15 +2228,15 @@ <param name="additionalHeaders">HTTP headers to add to the default headers.</param> <summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2284,15 +2284,15 @@ <param name="additionalHeaders">HTTP headers to add to the default headers.</param> <summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2332,35 +2332,35 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control has navigated to a new document and has begun loading it.</summary> <remarks> - <format type="text/markdown"><. - -## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigated> event to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + + Handle the <xref:System.Windows.Forms.WebBrowser.Navigated> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control has navigated to a new document. When the <xref:System.Windows.Forms.WebBrowser.Navigated> event occurs, the new document has begun loading, which means you can access the loaded content through the <xref:System.Windows.Forms.WebBrowser.Document%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>, and <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> properties. Handle the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control finishes loading the new document. + + You can also receive notification before navigation begins by handling the <xref:System.Windows.Forms.WebBrowser.Navigating> event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, the user has not completely filled out a form. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + +## Examples + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigated> event to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" /> @@ -2404,45 +2404,45 @@ <Docs> <summary>Occurs before the <see cref="T:System.Windows.Forms.WebBrowser" /> control navigates to a new document.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to cancel navigation when a Web page form has not been filled in. The <xref:System.Windows.Forms.WebBrowser.Document%2A> property is used to determine whether the form input field contains a value. - - This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and that your form class has a <xref:System.Runtime.InteropServices.ComVisibleAttribute> making it accessible to COM. - - For a complete code example that you can paste the following code into, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to cancel navigation when a Web page form has not been filled in. The <xref:System.Windows.Forms.WebBrowser.Document%2A> property is used to determine whether the form input field contains a value. + + This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and that your form class has a <xref:System.Runtime.InteropServices.ComVisibleAttribute> making it accessible to COM. + + For a complete code example that you can paste the following code into, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]></format> </remarks> <altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" /> @@ -2486,25 +2486,25 @@ <Docs> <summary>Occurs before a new browser window is opened.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.NewWindow> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.NewWindow> event. - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.NewWindow> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.NewWindow> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet651"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet651"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet651"::: + ]]></format> </remarks> <altmember cref="T:System.ComponentModel.CancelEventArgs" /> @@ -2558,29 +2558,29 @@ <summary>Gets or sets an object that can be accessed by scripting code that is contained within a Web page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>The object being made available to the scripting code.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use this property to enable communication between a Web page hosted by the <xref:System.Windows.Forms.WebBrowser> control and the application that contains the <xref:System.Windows.Forms.WebBrowser> control. This property lets you integrate dynamic HTML (DHTML) code with your client application code. The object specified for this property is available to Web page script as the `window.external` object, which is a built-in DOM object provided for host access. - - You can set this property to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the <xref:System.Runtime.InteropServices.ComVisibleAttribute>. - - To call functions defined in your Web page from your client application code, use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method of the <xref:System.Windows.Forms.HtmlDocument> object you can retrieve from the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. - - - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. In the example, the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property is set to the current form. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use this property to enable communication between a Web page hosted by the <xref:System.Windows.Forms.WebBrowser> control and the application that contains the <xref:System.Windows.Forms.WebBrowser> control. This property lets you integrate dynamic HTML (DHTML) code with your client application code. The object specified for this property is available to Web page script as the `window.external` object, which is a built-in DOM object provided for host access. + + You can set this property to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the <xref:System.Runtime.InteropServices.ComVisibleAttribute>. + + To call functions defined in your Web page from your client application code, use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method of the <xref:System.Windows.Forms.HtmlDocument> object you can retrieve from the <xref:System.Windows.Forms.WebBrowser.Document%2A> property. + + + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. In the example, the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property is set to the current form. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet0"::: + ]]></format> </remarks> - <exception cref="T:System.ArgumentException">The specified value when setting this property is an instance of a non-public type. - - -or- - + <exception cref="T:System.ArgumentException">The specified value when setting this property is an instance of a non-public type. + + -or- + The specified value when setting this property is an instance of a type that is not COM-visible. For more information, see <see cref="M:System.Runtime.InteropServices.Marshal.IsTypeVisibleFromCom(System.Type)" />.</exception> <altmember cref="P:System.Windows.Forms.WebBrowser.Document" /> <altmember cref="M:System.Windows.Forms.HtmlDocument.InvokeScript(System.String,System.Object[])" /> @@ -2615,13 +2615,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnCanGoBackChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnCanGoBackChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2660,13 +2660,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2705,13 +2705,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.WebBrowserDocumentCompletedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnDocumentCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnDocumentCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -2754,13 +2754,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.DocumentTitleChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2799,13 +2799,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.EncryptionLevelChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2844,13 +2844,13 @@ <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.FileDownload" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnFileDownload%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnFileDownload%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2888,13 +2888,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.WebBrowserNavigatedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.Navigated" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnNavigated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnNavigated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2933,13 +2933,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.WebBrowserNavigatingEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.Navigating" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnNavigating%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnNavigating%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -2978,13 +2978,13 @@ <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.NewWindow" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnNewWindow%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnNewWindow%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3022,13 +3022,13 @@ <param name="e">A <see cref="T:System.Windows.Forms.WebBrowserProgressChangedEventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.ProgressChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnProgressChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnProgressChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3067,13 +3067,13 @@ <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param> <summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.StatusTextChanged" /> event.</summary> <remarks> - <format type="text/markdown"><. - - The <xref:System.Windows.Forms.WebBrowser.OnStatusTextChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + <format type="text/markdown"><. + + The <xref:System.Windows.Forms.WebBrowser.OnStatusTextChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]></format> </remarks> <block subset="none" type="overrides"> @@ -3175,11 +3175,11 @@ <Docs> <summary>Occurs when the value of the <see cref="P:System.Windows.Forms.WebBrowser.Padding" /> property changes.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Although you can get or set the value of the <xref:System.Windows.Forms.WebBrowser.Padding%2A> property and respond to changes by handling this event, the Padding property is not meaningful for this control. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Although you can get or set the value of the <xref:System.Windows.Forms.WebBrowser.Padding%2A> property and respond to changes by handling this event, the Padding property is not meaningful for this control. + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.Padding" /> @@ -3211,18 +3211,18 @@ <Docs> <summary>Prints the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control using the current print and page settings.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to implement a **Print** button similar to the one in Internet Explorer. This method prints the current document without requiring further user input. To display the **Print** dialog box prior to printing, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method. To display the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings, use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method to implement a **Print** button for the <xref:System.Windows.Forms.WebBrowser> control that's similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonPrint`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to implement a **Print** button similar to the one in Internet Explorer. This method prints the current document without requiring further user input. To display the **Print** dialog box prior to printing, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method. To display the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings, use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method to implement a **Print** button for the <xref:System.Windows.Forms.WebBrowser> control that's similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonPrint`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet13"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet13"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.ShowPageSetupDialog" /> @@ -3257,21 +3257,21 @@ <Docs> <summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control has updated information on the download progress of a document it is navigating to.</summary> <remarks> - <format type="text/markdown"><. - -## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.ProgressChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. - - To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.ProgressChanged> event. - + <format type="text/markdown"><. + +## Examples + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.ProgressChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>. + + To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.ProgressChanged> event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet652"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet652"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet652"::: + ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.WebBrowserProgressChangedEventArgs" /> @@ -3318,13 +3318,13 @@ <summary>Gets a value indicating the current state of the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>One of the <see cref="T:System.Windows.Forms.WebBrowserReadyState" /> values.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property to retrieve the specific state of the <xref:System.Windows.Forms.WebBrowser> control when you need more information than the <xref:System.Windows.Forms.WebBrowser.IsBusy%2A> property provides. - - When the <xref:System.Windows.Forms.WebBrowser> control does not contain a document, the value of this property is <xref:System.Windows.Forms.WebBrowserReadyState.Uninitialized?displayProperty=nameWithType>. Other values indicate the control state when it navigates to a new document. These values include <xref:System.Windows.Forms.WebBrowserReadyState.Loading?displayProperty=nameWithType>, <xref:System.Windows.Forms.WebBrowserReadyState.Loaded?displayProperty=nameWithType>, <xref:System.Windows.Forms.WebBrowserReadyState.Interactive?displayProperty=nameWithType>, and <xref:System.Windows.Forms.WebBrowserReadyState.Complete?displayProperty=nameWithType>. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property to retrieve the specific state of the <xref:System.Windows.Forms.WebBrowser> control when you need more information than the <xref:System.Windows.Forms.WebBrowser.IsBusy%2A> property provides. + + When the <xref:System.Windows.Forms.WebBrowser> control does not contain a document, the value of this property is <xref:System.Windows.Forms.WebBrowserReadyState.Uninitialized?displayProperty=nameWithType>. Other values indicate the control state when it navigates to a new document. These values include <xref:System.Windows.Forms.WebBrowserReadyState.Loading?displayProperty=nameWithType>, <xref:System.Windows.Forms.WebBrowserReadyState.Loaded?displayProperty=nameWithType>, <xref:System.Windows.Forms.WebBrowserReadyState.Interactive?displayProperty=nameWithType>, and <xref:System.Windows.Forms.WebBrowserReadyState.Complete?displayProperty=nameWithType>. + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -3370,23 +3370,23 @@ <Docs> <summary>Reloads the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control by checking the server for an updated version.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method forces the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. You can use this method to implement a **Refresh** button similar to the one in Internet Explorer. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method forces the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. You can use this method to implement a **Refresh** button similar to the one in Internet Explorer. + > [!NOTE] -> A document refresh simply reloads the current page, so the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events do not occur when you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to implement a **Refresh** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonRefresh`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - +> A document refresh simply reloads the current page, so the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events do not occur when you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to implement a **Refresh** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonRefresh`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet10"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" /> @@ -3425,14 +3425,14 @@ <param name="opt">One of the <see cref="T:System.Windows.Forms.WebBrowserRefreshOption" /> values.</param> <summary>Reloads the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control using the specified refresh options.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control stores recently visited Web pages in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method forces the <xref:System.Windows.Forms.WebBrowser> control to reload the current page. The type of reload depends on the <xref:System.Windows.Forms.WebBrowserRefreshOption> value specified. If you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method with the <xref:System.Windows.Forms.WebBrowserRefreshOption.Completely?displayProperty=nameWithType> value, the latest version of the document is downloaded. If you use the <xref:System.Windows.Forms.WebBrowserRefreshOption.IfExpired?displayProperty=nameWithType> value, the latest version is downloaded only if the current document has expired. If you use the <xref:System.Windows.Forms.WebBrowserRefreshOption.Normal?displayProperty=nameWithType> value, the server sends a copy of the document stored in its own cache. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control stores recently visited Web pages in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method forces the <xref:System.Windows.Forms.WebBrowser> control to reload the current page. The type of reload depends on the <xref:System.Windows.Forms.WebBrowserRefreshOption> value specified. If you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method with the <xref:System.Windows.Forms.WebBrowserRefreshOption.Completely?displayProperty=nameWithType> value, the latest version of the document is downloaded. If you use the <xref:System.Windows.Forms.WebBrowserRefreshOption.IfExpired?displayProperty=nameWithType> value, the latest version is downloaded only if the current document has expired. If you use the <xref:System.Windows.Forms.WebBrowserRefreshOption.Normal?displayProperty=nameWithType> value, the server sends a copy of the document stored in its own cache. + > [!NOTE] -> A document refresh simply reloads the current page, so the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events do not occur when you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method. - +> A document refresh simply reloads the current page, so the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events do not occur when you call the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method. + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" /> @@ -3475,22 +3475,22 @@ <value> <see langword="true" /> if the control does not display its dialog boxes; otherwise, <see langword="false" />. The default is <see langword="false" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set this property to `false` to debug Web pages that you display in the <xref:System.Windows.Forms.WebBrowser> control. This is useful when you use the control to add Web-based controls and scripting code to your application. It is less useful when you use the control as a generic browser. When you have finished debugging your application, set this property to `true` to suppress script errors. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set this property to `false` to debug Web pages that you display in the <xref:System.Windows.Forms.WebBrowser> control. This is useful when you use the control to add Web-based controls and scripting code to your application. It is less useful when you use the control as a generic browser. When you have finished debugging your application, set this property to `true` to suppress script errors. + > [!NOTE] -> When <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> is set to `true`, the <xref:System.Windows.Forms.WebBrowser> control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> to `false` and suppress script errors in a handler for the <xref:System.Windows.Forms.HtmlWindow.Error?displayProperty=nameWithType> event. For more information, see the code example in this topic. - - - -## Examples - The following code example demonstrates how to suppress script errors without suppressing other dialog boxes. In the example, the <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> property is set to `false` to ensure that dialog boxes are displayed. A handler for the <xref:System.Windows.Forms.HtmlWindow.Error?displayProperty=nameWithType> event suppresses the error. This event is only accessible when a document is finished loading, so the handler is attached in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. - +> When <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> is set to `true`, the <xref:System.Windows.Forms.WebBrowser> control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> to `false` and suppress script errors in a handler for the <xref:System.Windows.Forms.HtmlWindow.Error?displayProperty=nameWithType> event. For more information, see the code example in this topic. + + + +## Examples + The following code example demonstrates how to suppress script errors without suppressing other dialog boxes. In the example, the <xref:System.Windows.Forms.WebBrowser.ScriptErrorsSuppressed%2A> property is set to `false` to ensure that dialog boxes are displayed. A handler for the <xref:System.Windows.Forms.HtmlWindow.Error?displayProperty=nameWithType> event suppresses the error. This event is only accessible when a document is finished loading, so the handler is attached in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet40"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -3532,11 +3532,11 @@ <value> <see langword="true" /> if scroll bars are displayed in the control; otherwise, <see langword="false" />. The default is true.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - If the value of this property is `true`, scroll bars are displayed only when the page content is larger than the browser window. - + <format type="text/markdown"><![CDATA[ + +## Remarks + If the value of this property is `true`, scroll bars are displayed only when the page content is larger than the browser window. + ]]></format> </remarks> </Docs> @@ -3567,18 +3567,18 @@ <Docs> <summary>Opens the Internet Explorer **Page Setup** dialog box.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to implement a **Page Setup** menu item that is similar to the one on the Internet Explorer **File** menu. This method displays the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings prior to printing. To print the current document, use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method or the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method to implement a **Page Setup** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePageSetup` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to implement a **Page Setup** menu item that is similar to the one on the Internet Explorer **File** menu. This method displays the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings prior to printing. To print the current document, use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method or the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method to implement a **Page Setup** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePageSetup` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet2"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.ShowPrintDialog" /> @@ -3611,18 +3611,18 @@ <Docs> <summary>Opens the Internet Explorer **Print** dialog box without setting header and footer values.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to implement a **Print** menu item that is similar to the one on the Internet Explorer **File** menu. This method displays the **Print** dialog box, which lets your users modify print settings prior to printing. To let your users specify page settings prior to printing, use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method to implement a **Print** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrint` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1.` - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to implement a **Print** menu item that is similar to the one on the Internet Explorer **File** menu. This method displays the **Print** dialog box, which lets your users modify print settings prior to printing. To let your users specify page settings prior to printing, use the <xref:System.Windows.Forms.WebBrowser.ShowPageSetupDialog%2A> method. To display the **Print Preview** dialog box, use the <xref:System.Windows.Forms.WebBrowser.ShowPrintPreviewDialog%2A> method. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPrintDialog%2A> method to implement a **Print** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrint` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1.` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.ShowPageSetupDialog" /> @@ -3655,20 +3655,20 @@ <Docs> <summary>Opens the Internet Explorer **Print Preview** dialog box.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet4"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.ShowPageSetupDialog" /> @@ -3701,18 +3701,18 @@ <Docs> <summary>Opens the Internet Explorer **Properties** dialog box for the current document.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to implement a **Properties** menu option similar to the one on the Internet Explorer **File** menu. This method displays the **Properties** dialog box, which contains information about the current document such as its type, URL, size, and dates of creation and modification. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPropertiesDialog%2A> method to implement a **Properties** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileProperties` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1.` - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to implement a **Properties** menu option similar to the one on the Internet Explorer **File** menu. This method displays the **Properties** dialog box, which contains information about the current document such as its type, URL, size, and dates of creation and modification. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowPropertiesDialog%2A> method to implement a **Properties** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileProperties` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1.` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet5"::: + ]]></format> </remarks> </Docs> @@ -3743,21 +3743,21 @@ <Docs> <summary>Opens the Internet Explorer **Save Web Page** dialog box or the **Save** dialog box of the hosted document if it is not an HTML page.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - You can use this method to implement a **Save As** menu item similar to the one on the Internet Explorer **File** menu. The dialog box that appears when this method is called depends on the document type currently loaded. - + <format type="text/markdown"><![CDATA[ + +## Remarks + You can use this method to implement a **Save As** menu item similar to the one on the Internet Explorer **File** menu. The dialog box that appears when this method is called depends on the document type currently loaded. + > [!NOTE] -> This method allows users to save only the contents of the document as it was originally loaded. Any modifications made to the document at run time through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property are not persisted. For information on retrieving the run-time modifications, see [How to: Access the HTML Source in the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/how-to-access-the-html-source-in-the-managed-html-document-object-model). - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowSaveAsDialog%2A> method to implement a **Save As** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileSaveAs` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. - +> This method allows users to save only the contents of the document as it was originally loaded. Any modifications made to the document at run time through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property are not persisted. For information on retrieving the run-time modifications, see [How to: Access the HTML Source in the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/how-to-access-the-html-source-in-the-managed-html-document-object-model). + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ShowSaveAsDialog%2A> method to implement a **Save As** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileSaveAs` and a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet1"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.Document" /> @@ -3807,22 +3807,22 @@ <summary>Gets the status text of the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary> <value>The status text.</value> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet14"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -3865,24 +3865,24 @@ <Docs> <summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.StatusText" /> property value changes.</summary> <remarks> - <format type="text/markdown"><. - - - -## Examples - The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.StatusTextChanged> event to implement a status bar for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.StatusBar> control called `StatusBar1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + <format type="text/markdown"><. + + + +## Examples + The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.StatusTextChanged> event to implement a status bar for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.StatusBar> control called `StatusBar1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet14"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: + ]]></format> </remarks> <altmember cref="T:System.EventArgs" /> @@ -3916,20 +3916,20 @@ <Docs> <summary>Cancels any pending navigation and stops any dynamic page elements, such as background sounds and animations.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet9"::: + ]]></format> </remarks> <altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" /> @@ -3980,25 +3980,25 @@ <summary>Gets or sets the URL of the current document.</summary> <value>A <see cref="T:System.Uri" /> representing the URL of the current document.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Setting this property is equivalent to calling the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method and passing it the specified URL. - - The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you set the <xref:System.Windows.Forms.WebBrowser.Url%2A> property, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URL and adds it to the end of the history list. - - The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Setting this property is equivalent to calling the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method and passing it the specified URL. + + The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you set the <xref:System.Windows.Forms.WebBrowser.Url%2A> property, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URL and adds it to the end of the history list. + + The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. + > [!NOTE] -> This property contains the URL of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new document. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Url%2A> property to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - +> This property contains the URL of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new document. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Url%2A> property to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]></format> </remarks> <exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception> @@ -4054,11 +4054,11 @@ <summary>Gets the version of Internet Explorer installed.</summary> <value>The version of Internet Explorer installed.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Windows.Forms.WebBrowser> control is a managed wrapper around a component installed with Internet Explorer. Use this property to determine which version of Internet Explorer is installed. This is useful when your application uses a feature of Internet Explorer that is present only in certain versions. If the required version is not present on the local machine, you can provide alternative functionality or prompt the user to upgrade. - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Windows.Forms.WebBrowser> control is a managed wrapper around a component installed with Internet Explorer. Use this property to determine which version of Internet Explorer is installed. This is useful when your application uses a feature of Internet Explorer that is present only in certain versions. If the required version is not present on the local machine, you can provide alternative functionality or prompt the user to upgrade. + ]]></format> </remarks> <altmember cref="T:System.Version" /> @@ -4097,19 +4097,19 @@ <value> <see langword="true" /> if keyboard shortcuts are enabled within the control; otherwise, <see langword="false" />. The default is <see langword="true" />.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Set this property to false to prevent your users from using Internet Explorer keyboard shortcuts with the <xref:System.Windows.Forms.WebBrowser> control. This is useful when you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines DHTML-based controls with Windows Forms controls. - - You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> and <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> properties to `false`. - -## Examples - The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> property. - + <format type="text/markdown"><![CDATA[ + +## Remarks + Set this property to false to prevent your users from using Internet Explorer keyboard shortcuts with the <xref:System.Windows.Forms.WebBrowser> control. This is useful when you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines DHTML-based controls with Windows Forms controls. + + You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> and <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> properties to `false`. + +## Examples + The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet3"::: + ]]></format> </remarks> <altmember cref="P:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" /> diff --git a/xml/System.Windows.Forms/WindowsFormsSection.xml b/xml/System.Windows.Forms/WindowsFormsSection.xml index d94f5caf2d7..5ae74da7a81 100644 --- a/xml/System.Windows.Forms/WindowsFormsSection.xml +++ b/xml/System.Windows.Forms/WindowsFormsSection.xml @@ -29,11 +29,11 @@ <Docs> <summary>Defines a new <see cref="T:System.Configuration.ConfigurationSection" /> for parsing application settings. This class cannot be inherited.</summary> <remarks> - <format type="text/markdown"><. - + <format type="text/markdown"><. + ]]></format> </remarks> </Docs> diff --git a/xml/System.Windows/ContentElement.xml b/xml/System.Windows/ContentElement.xml index 3f4f7fcc577..157730e3d0a 100644 --- a/xml/System.Windows/ContentElement.xml +++ b/xml/System.Windows/ContentElement.xml @@ -11915,7 +11915,7 @@ Note that by default a <xref:System.Windows.ContentElement.Focusable> is not foc This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement.CommandBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> @@ -11962,7 +11962,7 @@ Note that by default a <xref:System.Windows.ContentElement.Focusable> is not foc This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement.InputBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> diff --git a/xml/System.Windows/UIElement.xml b/xml/System.Windows/UIElement.xml index 71dad0d6ccc..fc96c04f42a 100644 --- a/xml/System.Windows/UIElement.xml +++ b/xml/System.Windows/UIElement.xml @@ -14886,7 +14886,7 @@ For this call to be successful, some other element in the application needed to This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement.CommandBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> @@ -14933,7 +14933,7 @@ For this call to be successful, some other element in the application needed to This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement.InputBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> diff --git a/xml/System.Windows/UIElement3D.xml b/xml/System.Windows/UIElement3D.xml index 3ad04cadfbc..d97a238936e 100644 --- a/xml/System.Windows/UIElement3D.xml +++ b/xml/System.Windows/UIElement3D.xml @@ -12075,7 +12075,7 @@ This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement3D.CommandBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement3D>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> @@ -12122,7 +12122,7 @@ This `ShouldSerialize` method is provided because the <xref:System.Windows.UIElement3D.InputBindings%2A> property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a <xref:System.Windows.UIElement3D>. - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]></format> </remarks> diff --git a/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml b/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml index edefd9b2aee..3b4fd26282a 100644 --- a/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml +++ b/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml @@ -50,37 +50,37 @@ <Docs> <summary>Provides data for the known, but unreferenced, object found in an encoded SOAP XML stream during deserialization.</summary> <remarks> - <format type="text/markdown">< - - - -## Examples - The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` -<wrapper> - <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> - </Group> -<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> - </Vehicle> -<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> - </Vehicle> -</wrapper> -``` - + <format type="text/markdown">< + + + +## Examples + The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` +<wrapper> + <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> + </Group> +<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> + </Vehicle> +<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> + </Vehicle> +</wrapper> +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -133,28 +133,28 @@ <param name="id">A unique string used to identify the unreferenced object.</param> <summary>Initializes a new instance of the <see cref="T:System.Xml.Serialization.UnreferencedObjectEventArgs" /> class.</summary> <remarks> - <format type="text/markdown"><![CDATA[ - -## Examples - The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` -<wrapper> - <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> - </Group> -<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> - </Vehicle> -<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> - </Vehicle> -</wrapper> -``` - + <format type="text/markdown"><![CDATA[ + +## Examples + The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` +<wrapper> + <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> + </Group> +<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> + </Vehicle> +<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> + </Vehicle> +</wrapper> +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -205,35 +205,35 @@ <summary>Gets the ID of the object.</summary> <value>The ID of the object.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - Use the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedId%2A> property when you need to know when more than one object raises the event. The property allows you to distinguish between multiple instances of unreferenced objects. - - For more information about the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedId%2A> property, see the <xref:System.Xml.Serialization.XmlSerializer.UnreferencedObject> event. - - - -## Examples - The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` -<wrapper> - <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> - </Group> -<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> - </Vehicle> -<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> - </Vehicle> -</wrapper> -``` - + <format type="text/markdown"><![CDATA[ + +## Remarks + Use the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedId%2A> property when you need to know when more than one object raises the event. The property allows you to distinguish between multiple instances of unreferenced objects. + + For more information about the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedId%2A> property, see the <xref:System.Xml.Serialization.XmlSerializer.UnreferencedObject> event. + + + +## Examples + The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` +<wrapper> + <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> + </Group> +<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> + </Vehicle> +<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> + </Vehicle> +</wrapper> +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> @@ -284,35 +284,35 @@ <summary>Gets the deserialized, but unreferenced, object.</summary> <value>The deserialized, but unreferenced, object.</value> <remarks> - <format type="text/markdown"><![CDATA[ - -## Remarks - The <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedObject%2A> can be cast to the known type if examining its properties is required. - - See the <xref:System.Xml.Serialization.XmlSerializer.UnreferencedObject> event for more information about the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedObject%2A> property. - - - -## Examples - The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` -<wrapper> - <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> - </Group> -<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> - </Vehicle> -<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> - <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> - </Vehicle> -</wrapper> -``` - + <format type="text/markdown"><![CDATA[ + +## Remarks + The <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedObject%2A> can be cast to the known type if examining its properties is required. + + See the <xref:System.Xml.Serialization.XmlSerializer.UnreferencedObject> event for more information about the <xref:System.Xml.Serialization.UnreferencedObjectEventArgs.UnreferencedObject%2A> property. + + + +## Examples + The following example adds an <xref:System.Xml.Serialization.UnreferencedObjectEventHandler> to an <xref:System.Xml.Serialization.XmlSerializer>. The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` +<wrapper> + <Group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="id1" n1:GroupName=".NET" xmlns:n1="http://www.cpandl.com"> + </Group> +<Vehicle id="id2" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">ABCD</licenseNumber> + </Vehicle> +<Vehicle id="id3" n1:type="Vehicle" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance"> + <licenseNumber xmlns:q1="http://www.w3.org/2001/XMLSchema" n1:type="q1:string">1234</licenseNumber> + </Vehicle> +</wrapper> +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]></format> </remarks> </Docs> diff --git a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml index a8caf2b1176..aa2f3502861 100644 --- a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml +++ b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml @@ -53,7 +53,7 @@ <format type="text/markdown"><. + For more information about handling events, see [Events Overview](/dotnet/desktop/winforms/events-overview-windows-forms). The <xref:System.Xml.Serialization.XmlSerializer.UnknownAttribute> event occurs only when you call the <xref:System.Xml.Serialization.XmlSerializer.Deserialize%2A> method. diff --git a/xml/ns-System.Drawing.Drawing2D.xml b/xml/ns-System.Drawing.Drawing2D.xml index ba141f8a2d7..8fa569d4fad 100644 --- a/xml/ns-System.Drawing.Drawing2D.xml +++ b/xml/ns-System.Drawing.Drawing2D.xml @@ -23,6 +23,6 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/coordinate-systems-and-transformations">Coordinate Systems and Transformations</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/coordinate-systems-and-transformations">Coordinate Systems and Transformations</related> </Docs> </Namespace> diff --git a/xml/ns-System.Drawing.Imaging.xml b/xml/ns-System.Drawing.Imaging.xml index 03c4bb7ebed..b664e7c5984 100644 --- a/xml/ns-System.Drawing.Imaging.xml +++ b/xml/ns-System.Drawing.Imaging.xml @@ -15,10 +15,10 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/graphics-and-drawing-in-windows-forms">Graphics and Drawing in Windows Forms</related> - <related type="Article" href="/dotnet/framework/winforms/advanced/images-bitmaps-and-metafiles">Images, Bitmaps, and Metafiles</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/graphics-and-drawing-in-windows-forms">Graphics and Drawing in Windows Forms</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/images-bitmaps-and-metafiles">Images, Bitmaps, and Metafiles</related> <related type="Article" href="/dotnet/desktop/winforms/advanced/images-bitmaps-and-metafiles">Working with Images, Bitmaps, Icons, and Metafiles</related> - <related type="Article" href="/dotnet/framework/winforms/advanced/using-image-encoders-and-decoders-in-managed-gdi">Using Image Encoders and Decoders in Managed GDI+</related> - <related type="Article" href="/dotnet/framework/winforms/advanced/recoloring-images">Recoloring Images</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/using-image-encoders-and-decoders-in-managed-gdi">Using Image Encoders and Decoders in Managed GDI+</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/recoloring-images">Recoloring Images</related> </Docs> </Namespace> diff --git a/xml/ns-System.Drawing.Printing.xml b/xml/ns-System.Drawing.Printing.xml index 517158fca32..65c6d14e42d 100644 --- a/xml/ns-System.Drawing.Printing.xml +++ b/xml/ns-System.Drawing.Printing.xml @@ -24,6 +24,6 @@ ]]></format> </remarks> <altmember cref="T:System.Windows.Forms.PrintDialog" /> - <related type="Article" href="/dotnet/framework/winforms/advanced/windows-forms-print-support">Windows Forms Print Support</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/windows-forms-print-support">Windows Forms Print Support</related> </Docs> </Namespace> diff --git a/xml/ns-System.Drawing.Text.xml b/xml/ns-System.Drawing.Text.xml index 42e356ceebf..13f78eed83c 100644 --- a/xml/ns-System.Drawing.Text.xml +++ b/xml/ns-System.Drawing.Text.xml @@ -12,6 +12,6 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/advanced/using-fonts-and-text">Using Fonts and Text</related> + <related type="Article" href="/dotnet/desktop/winforms/advanced/using-fonts-and-text">Using Fonts and Text</related> </Docs> </Namespace> diff --git a/xml/ns-System.Windows.Forms.VisualStyles.xml b/xml/ns-System.Windows.Forms.VisualStyles.xml index 424beaae6b2..22398c600b7 100644 --- a/xml/ns-System.Windows.Forms.VisualStyles.xml +++ b/xml/ns-System.Windows.Forms.VisualStyles.xml @@ -17,6 +17,6 @@ ]]></format> </remarks> - <related type="Article" href="/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles">Rendering Controls with Visual Styles</related> + <related type="Article" href="/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles">Rendering Controls with Visual Styles</related> </Docs> </Namespace>