Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"config": {
"default": true,
// Rule is fixable, but corrections may have impacts on headings showing up in sidebars
"MD001": false,
// Heading levels should only increment by one level at a time (accessibility)
"MD001": true,
// Rule is auto-fixable, and should pick single style
"MD004": false,
// Disabled as word wraping can cause many diffs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The disadvantage of using the <xref:System.Windows.Forms.Form.ShowDialog%2A?disp

You can create a class library in Windows Forms which has a method to show the form, and then build the class library for COM interop. You can use this DLL file from Visual Basic 6.0 or Microsoft Foundation Classes (MFC), and from either of these environments you can call the <xref:System.Windows.Forms.Form.ShowDialog%2A?displayProperty=nameWithType> method to display the form.

#### To support COM interop by displaying a windows form with the ShowDialog method
### To support COM interop by displaying a windows form with the ShowDialog method

- Replace all calls to the <xref:System.Windows.Forms.Form.Show%2A?displayProperty=nameWithType> method with calls to the <xref:System.Windows.Forms.Form.ShowDialog%2A?displayProperty=nameWithType> method in your .NET Framework component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description: Learn how to Align Drawn text in GDI and GDI+ as well as how to dra

When you perform custom drawing, you may often want to center drawn text on a form or control. You can easily align text drawn with the <xref:System.Drawing.Graphics.DrawString%2A> or <xref:System.Windows.Forms.TextRenderer.DrawText%2A> methods by creating the correct formatting object and setting the appropriate format flags.

### To draw centered text with GDI+ (DrawString)
## To draw centered text with GDI+ (DrawString)

1. Use a <xref:System.Drawing.StringFormat> with the appropriate <xref:System.Drawing.Graphics.DrawString%2A> method to specify centered text.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The <xref:System.Windows.Forms.MdiLayout> enumeration values display child forms

Often, these methods are used as the event handlers called by a menu item's <xref:System.Windows.Forms.Control.Click> event. In this way, a menu item with the text "Cascade Windows" can have the desired effect on the MDI child windows.

### To arrange child forms
## To arrange child forms

1. In a method, use the <xref:System.Windows.Forms.Form.LayoutMdi%2A> method to set the <xref:System.Windows.Forms.MdiLayout> enumeration for the MDI parent form. The following example uses the <xref:System.Windows.Forms.MdiLayout.Cascade?displayProperty=nameWithType> enumeration value for the child windows of the MDI parent form (`Form1`). The enumeration is used in code during the event handler for the <xref:System.Windows.Forms.Control.Click> event of the **Cascade Windows** menu item.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Learn how to change the value of a setting between application sess

At times, you might want to change the value of a setting between application sessions after the application has been compiled and deployed. For example, you might want to change a connection string to point to the correct database location. Since design-time tools are not available after the application has been compiled and deployed, you must change the setting value manually in the file.

### To Change the Value of a Setting Between Application Sessions
## To Change the Value of a Setting Between Application Sessions

1. Using Microsoft Notepad or some other text or XML editor, open the .config file associated with your application.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Learn how to change the value of an existing setting at design time

You can use Visual Studio to edit the values of existing settings in your project.

### To Change the Value of an Existing Setting at Design Time in C\#
## To Change the Value of an Existing Setting at Design Time in C\#

1. In **Solution Explorer**, expand the **Properties** node of your project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Often, users want to choose a printer other than the default printer to print to

In the following procedure, a text file is selected to be printed to the default printer. The <xref:System.Windows.Forms.PrintDialog> class is then instantiated.

### To choose a printer and then print a file
## To choose a printer and then print a file

1. Select the printer to be used using the <xref:System.Windows.Forms.PrintDialog> component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The <xref:System.Drawing.Drawing2D.PathGradientBrush> class allows you to custom

The examples in this article are methods that are called from a control's <xref:System.Windows.Forms.Control.Paint> event handler.

### To fill an ellipse with a path gradient
## To fill an ellipse with a path gradient

- The following example fills an ellipse with a path gradient brush. The center color is set to blue and the boundary color is set to aqua. The following illustration shows the filled ellipse.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In the following procedure, you manually create a wrapper class that derives fro

You can also perform this procedure using minimal code in the Visual Studio designer. Also see [How to: Create Application Settings Using the Designer](/previous-versions/visualstudio/visual-studio-2010/wabtadw6(v=vs.100)).

### To create new Application Settings programmatically
## To create new Application Settings programmatically

1. Add a new class to your project, and rename it. For this procedure, we will call this class `MyUserSettings`. Change the class definition so that the class derives from <xref:System.Configuration.ApplicationSettingsBase>.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ There are two steps in working with graphics:

A graphics object can be created in a variety of ways.

#### To create a graphics object
### To create a graphics object

- Receive a reference to a graphics object as part of the <xref:System.Windows.Forms.PaintEventArgs> in the <xref:System.Windows.Forms.Control.Paint> event of a form or control. This is usually how you obtain a reference to a graphics object when creating painting code for a control. Similarly, you can also obtain a graphics object as a property of the <xref:System.Drawing.Printing.PrintPageEventArgs> when handling the <xref:System.Drawing.Printing.PrintDocument.PrintPage> event for a <xref:System.Drawing.Printing.PrintDocument>.

Expand All @@ -46,7 +46,7 @@ A graphics object can be created in a variety of ways.

When programming the <xref:System.Windows.Forms.PaintEventHandler> for controls or the <xref:System.Drawing.Printing.PrintDocument.PrintPage> for a <xref:System.Drawing.Printing.PrintDocument>, a graphics object is provided as one of the properties of <xref:System.Windows.Forms.PaintEventArgs> or <xref:System.Drawing.Printing.PrintPageEventArgs>.

#### To obtain a reference to a Graphics object from the PaintEventArgs in the Paint event
### To obtain a reference to a Graphics object from the PaintEventArgs in the Paint event

1. Declare the <xref:System.Drawing.Graphics> object.

Expand Down Expand Up @@ -93,7 +93,7 @@ When programming the <xref:System.Windows.Forms.PaintEventHandler> for controls

You can also use the <xref:System.Windows.Forms.Control.CreateGraphics%2A> method of a control or form to obtain a reference to a <xref:System.Drawing.Graphics> object that represents the drawing surface of that control or form.

#### To create a Graphics object with the CreateGraphics method
### To create a Graphics object with the CreateGraphics method

- Call the <xref:System.Windows.Forms.Control.CreateGraphics%2A> method of the form or control upon which you want to render graphics.

Expand Down Expand Up @@ -122,7 +122,7 @@ You can also use the <xref:System.Windows.Forms.Control.CreateGraphics%2A> metho

Additionally, you can create a graphics object from any object that derives from the <xref:System.Drawing.Image> class.

#### To create a Graphics object from an Image
### To create a Graphics object from an Image

- Call the <xref:System.Drawing.Graphics.FromImage%2A?displayProperty=nameWithType> method, supplying the name of the Image variable from which you want to create a <xref:System.Drawing.Graphics> object.

Expand Down Expand Up @@ -160,7 +160,7 @@ After it is created, a <xref:System.Drawing.Graphics> object may be used to draw

- The <xref:System.Drawing.Color> structure—Represents the different colors to display.

#### To use the Graphics object you have created
### To use the Graphics object you have created

- Work with the appropriate object listed above to draw what you need.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Because an MDI application can have many instances of the same child form, the p

When you have several controls on a form, you also need to specify which control is active. Like the <xref:System.Windows.Forms.Form.ActiveMdiChild%2A> property, the <xref:System.Windows.Forms.ContainerControl.ActiveControl%2A> property returns the control with the focus on the active child form. The procedure below illustrates a copy procedure that can be called from a child form menu, a menu on the MDI form, or a toolbar button.

### To determine the active MDI child (to copy its text to the Clipboard)
## To determine the active MDI child (to copy its text to the Clipboard)

1. Within a method, copy the text of the active control of the active child form to the Clipboard.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: Learn how to draw cardinal splines by creating a Graphics object an

A cardinal spline is a curve that passes smoothly through a given set of points. To draw a cardinal spline, create a <xref:System.Drawing.Graphics> object and pass the address of an array of points to the <xref:System.Drawing.Graphics.DrawCurve%2A> method.

### Drawing a Bell-Shaped Cardinal Spline
## Drawing a Bell-Shaped Cardinal Spline

- The following example draws a bell-shaped cardinal spline that passes through five designated points. The following illustration shows the curve and five points.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The following illustration shows the output of text drawn at a specified point w

![Screenshot that shows the output of text at a specified point.](./media/how-to-draw-text-at-a-specified-location/font-text-specified-point.png)

### To draw a line of text with GDI+
## To draw a line of text with GDI+

1. Use the <xref:System.Drawing.Graphics.DrawString%2A> method, passing the text you want, <xref:System.Drawing.Point> or <xref:System.Drawing.PointF>, <xref:System.Drawing.Font>, and <xref:System.Drawing.Brush>.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following illustration shows the output of text drawn in the rectangle when

![Screenshot that shows the output when using DrawString method.](./media/how-to-draw-wrapped-text-in-a-rectangle/drawstring-method-font-text.png)

### To draw wrapped text in a rectangle with GDI+
## To draw wrapped text in a rectangle with GDI+

1. Use the <xref:System.Drawing.Graphics.DrawString%2A> overloaded method, passing the text you want, <xref:System.Drawing.Rectangle> or <xref:System.Drawing.RectangleF>, <xref:System.Drawing.Font> and <xref:System.Drawing.Brush>.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A <xref:System.Drawing.Drawing2D.GraphicsPath> object stores a sequence of lines

![Straight Lines and Curves](./media/aboutgdip02-art32a.gif "AboutGdip02_Art32A")

### To Flatten a Path
## To Flatten a Path

- call the <xref:System.Drawing.Drawing2D.GraphicsPath.Flatten%2A> method of a <xref:System.Drawing.Drawing2D.GraphicsPath> object. The <xref:System.Drawing.Drawing2D.GraphicsPath.Flatten%2A> method receives a flatness argument that specifies the maximum distance between the flattened path and the original path.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ms.assetid: 4c2a90ee-bbbe-4ff6-9170-1b06c195c918

For more advanced double buffering scenarios, you can use the .NET Framework classes to implement your own double-buffering logic. The class responsible for allocating and managing individual graphics buffers is the <xref:System.Drawing.BufferedGraphicsContext> class. Every application has its own default <xref:System.Drawing.BufferedGraphicsContext> that manages all of the default double buffering for that application. You can retrieve a reference to this instance by calling the <xref:System.Drawing.BufferedGraphicsManager.Current%2A>.

### To obtain a reference to the default BufferedGraphicsContext
## To obtain a reference to the default BufferedGraphicsContext

- Set the <xref:System.Drawing.BufferedGraphicsManager.Current%2A> property, as shown in the following code example.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are managing your own buffered graphics, you will need to be able to crea
> [!NOTE]
> If you perform your own rendering, memory consumption will increase, though the increase may only be slight.

### To manually display buffered graphics
## To manually display buffered graphics

1. Obtain a reference to an instance of the <xref:System.Drawing.BufferedGraphicsContext> class. For more information, see [How to: Manually Manage Buffered Graphics](how-to-manually-manage-buffered-graphics.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Performing drag-and-drop operations between applications is no different from en

In the following procedure, you will use a Windows-based application you create and the WordPad word processor that is included with the Windows operating system to perform drag-and-drop operations between applications. WordPad has a certain set of allowed effects for text being dragged and dropped; the Windows-based application you will write code for will work with these effects so that drag-and-drop operations may be completed successfully.

### To perform a drag-and-drop procedure between applications
## To perform a drag-and-drop procedure between applications

1. Create a new Windows Forms application.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ms.assetid: 32b891e6-52ff-4fea-a9ff-2ce5db20a4c6

Frequently, you will want to print graphics in your Windows-based application. The <xref:System.Drawing.Graphics> class provides methods for drawing objects to a device, such as a screen or printer.

### To print graphics
## To print graphics

1. Add a <xref:System.Drawing.Printing.PrintDocument> component to your form.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Double buffering uses a memory buffer to address the flicker problems associated

For more advanced double buffering scenarios, such as animation or advanced memory management, you can implement your own double buffering logic. For more information, see [How to: Manually Manage Buffered Graphics](how-to-manually-manage-buffered-graphics.md).

### To reduce flicker
## To reduce flicker

- Set the <xref:System.Windows.Forms.Control.DoubleBuffered%2A> property to `true`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ms.assetid: c128b79a-3e31-47d8-9e66-3470f570a056

You can use GDI+ to render images that exist as files in your applications. You do this by creating a new object of an <xref:System.Drawing.Image> class (such as <xref:System.Drawing.Bitmap>), creating a <xref:System.Drawing.Graphics> object that refers to the drawing surface you want to use, and calling the <xref:System.Drawing.Graphics.DrawImage%2A> method of the <xref:System.Drawing.Graphics> object. The image will be painted onto the drawing surface represented by the graphics class. You can use the Image Editor to create and edit image files at design time, and render them with GDI+ at run time. For more information, see [Image Editor for Icons](/cpp/windows/image-editor-for-icons).

### To render an image with GDI+
## To render an image with GDI+

1. Create an object representing the image you want to display. This object must be a member of a class that inherits from <xref:System.Drawing.Image>, such as <xref:System.Drawing.Bitmap> or <xref:System.Drawing.Imaging.Metafile>. An example is shown:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Often, within the context of [Multiple-Document Interface (MDI) Applications](mu
> [!NOTE]
> For information about verifying which child window has focus and sending its contents to the Clipboard, see [Determining the Active MDI Child](how-to-determine-the-active-mdi-child.md).

### To send data to the active MDI child window from the Clipboard
## To send data to the active MDI child window from the Clipboard

1. Within a method, copy the text on the Clipboard to the active control of the active child form.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The values <xref:System.Drawing.Drawing2D.PenAlignment.Center>, <xref:System.Dra

The following code example draws a line twice: once with a black pen of width 1 and once with a green pen of width 10.

### To vary the width of a pen
## To vary the width of a pen

- Set the value of the <xref:System.Drawing.Pen.Alignment%2A> property to <xref:System.Drawing.Drawing2D.PenAlignment.Center> (the default) to specify that pixels drawn with the green pen will be centered on the theoretical line. The following illustration shows the resulting line.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Just as tiles can be placed next to each other to cover a floor, rectangular ima

The wrap mode property of the <xref:System.Drawing.TextureBrush> object determines how the image is oriented as it is repeated in a rectangular grid. You can make all the tiles in the grid have the same orientation, or you can make the image flip from one grid position to the next. The flipping can be horizontal, vertical, or both. The following examples demonstrate tiling with different types of flipping.

### To tile an image
## To tile an image

- This example uses the following 75×75 image to tile a 200×200 rectangle.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For more information about event handling, see [Event Handlers Overview](../form

The following procedures show how to test for a valid birth date using either the <xref:System.Configuration.ApplicationSettingsBase.SettingChanging> or the <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving> event. The procedures were written under the assumption that you have already created your application settings; in this example, we will perform bounds checking on a setting named `DateOfBirth`. For more information about creating settings, see [How to: Create Application Settings](how-to-create-application-settings.md).

### To obtain the application settings object
## To obtain the application settings object

- Obtain a reference to the application settings object (the wrapper instance) by completing one of the following bulleted items:

Expand Down
Loading