mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
Fixes related to open issues. (#122)
* Update framework winforms landing * Add note about attribute * Adjust storyboard overview * Fix comments in snippet * Adjust table in getting started * Add missing encoded char * Fix bad desiredheight prop * Fix blank column * Fix description metadata * Review feedback
This commit is contained in:
+6
-1
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: "Defining Default Values with the ShouldSerialize and Reset Methods"
|
||||
description: "Learn how to use the ShouldSerialize and Reset property methods to control the Windows Forms designer behavior."
|
||||
ms.date: "03/30/2017"
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
@@ -10,7 +11,7 @@ helpviewer_keywords:
|
||||
ms.assetid: 7b6c5e00-3771-46b4-9142-5a80d5864a5e
|
||||
---
|
||||
# Defining Default Values with the ShouldSerialize and Reset Methods
|
||||
`ShouldSerialize` and `Reset` are optional methods that you can provide for a property, if the property does not a have simple default value. If the property has a simple default value, you should apply the <xref:System.ComponentModel.DefaultValueAttribute> and supply the default value to the attribute class constructor instead. Either of these mechanisms enables the following features in the designer:
|
||||
`ShouldSerialize` and `Reset` are optional methods that you can provide for a property, if the property does not have a simple default value. If the property has a simple default value, you should apply the <xref:System.ComponentModel.DefaultValueAttribute> and supply the default value to the attribute class constructor instead. Either of these mechanisms enables the following features in the designer:
|
||||
|
||||
- The property provides visual indication in the property browser if it has been modified from its default value.
|
||||
|
||||
@@ -56,6 +57,9 @@ public bool ShouldSerializeMyFont() {
|
||||
}
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> If you want to permanently prevent a property from being serialized by the designer, add the [DesignerSerializationVisibility](xref:System.ComponentModel.DesignerSerializationVisibilityAttribute) attribute with the value of `Hidden`.
|
||||
|
||||
A complete code example follows.
|
||||
|
||||
```vb
|
||||
@@ -141,3 +145,4 @@ public class MyControl : Control {
|
||||
- [Properties in Windows Forms Controls](properties-in-windows-forms-controls.md)
|
||||
- [Defining a Property](defining-a-property-in-windows-forms-controls.md)
|
||||
- [Property-Changed Events](property-changed-events.md)
|
||||
- <xref:System.ComponentModel.DesignerSerializationVisibilityAttribute?displayProperty=fullName>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
### YamlMime:Landing
|
||||
|
||||
title: .NET Desktop Guide for Windows Forms
|
||||
summary: Learn about using Windows Forms on Windows with either .NET Framework, .NET 5 and above, or .NET Core 3.1.
|
||||
summary: Learn about Windows Forms (WinForms), a graphical user interface for Windows and .NET Framework.
|
||||
|
||||
metadata:
|
||||
title: Windows Forms for .NET documentation
|
||||
description: Learn about using Windows Forms (WinForms), a graphical user interface for Windows and .NET.
|
||||
description: Learn about Windows Forms (WinForms), a graphical user interface for Windows and .NET Framework.
|
||||
ms.topic: landing-page
|
||||
ms.date: 08/30/2020
|
||||
|
||||
@@ -27,7 +27,7 @@ landingContent:
|
||||
url: /visualstudio/designers/walkthrough-windows-forms-designer
|
||||
- text: Create a WinForms app from the command-line
|
||||
url: how-to-create-a-windows-forms-application-from-the-command-line.md
|
||||
|
||||
|
||||
- title: Controls
|
||||
linkLists:
|
||||
- linkListType: overview
|
||||
@@ -59,4 +59,28 @@ landingContent:
|
||||
links:
|
||||
- text: Order in which events are raised
|
||||
url: order-of-events-in-windows-forms.md
|
||||
|
||||
|
||||
- title: Input
|
||||
linkLists:
|
||||
- linkListType: overview
|
||||
links:
|
||||
- text: About keyboard input
|
||||
url: how-keyboard-input-works.md
|
||||
- text: About mouse input
|
||||
url: how-mouse-input-works-in-windows-forms.md
|
||||
- linkListType: concept
|
||||
links:
|
||||
- text: Keyboard events
|
||||
url: using-keyboard-events.md
|
||||
- text: Mouse events
|
||||
url: mouse-events-in-windows-forms.md
|
||||
- text: Mouse pointers
|
||||
url: mouse-pointers-in-windows-forms.md
|
||||
- linkListType: how-to-guide
|
||||
links:
|
||||
- text: Modify keyboard input
|
||||
url: how-to-modify-keyboard-input-to-a-standard-control.md
|
||||
- text: Detect modifier keyboard keys
|
||||
url: how-to-determine-which-modifier-key-was-pressed.md
|
||||
- text: Distinguish between single/double clicks
|
||||
url: how-to-distinguish-between-clicks-and-double-clicks.md
|
||||
|
||||
Reference in New Issue
Block a user