Share via


Add or modify an object (Blend for Visual Studio)

You can add an object to the artboard by selecting a control or a tool in the Tools panel or in the Assets panel, and then drawing the object on the artboard by using your mouse. You can also select a styled or custom control from the Assets panel, drag a styled control from the Resources panel, or drag resources from the Resources panel onto an existing object on the artboard to apply the resource to one of the properties of the object.

Note

The following procedures assume that you have a project open in Design view in Blend for Visual Studio 2012.

To add an object by using the Tools panel

  • Do one of the following:

    • Double-click the icon for a control (such as Rectangle JJ154979.81ffc148-cf5c-4faf-bd3f-f38d3073a12c(en-us,VS.110).png, Grid JJ154979.a87ee957-7fbf-4135-a6ab-6de7e63160aa(en-us,VS.110).png, Button JJ154979.05df1779-a68f-436b-b834-a91b7995a3ec(en-us,VS.110).png, or TextBlock JJ154979.42165963-00f7-4a33-abcd-b0849edebada(en-us,VS.110).png) in the Tools panel. The object is inserted into the upper-left corner of the artboard at a default width and size.

    • Select the icon of the control in the Tools panel and use your mouse to draw the control on the artboard.

To add an object by using the Assets panel

  1. Open the Assets panel by clicking Assets JJ154979.0d8b8d29-1af9-418f-8741-be3097d76eab(en-us,VS.110).png in the Tools panel.

  2. Do one of the following:

    • To add a control   Under Controls, click All, select a control from the list, and then use your mouse to draw the control on the artboard.

    • To add a styled control that occurs in a resource dictionary   Under Styles, select the resource dictionary, select a styled control from the list, and then use your mouse to draw the control on the artboard.

    • To add a styled control that is defined in your project   Under Styles, select a styled control from the list, and then use your mouse to draw the control on the artboard.

      Note

      Styles are created by selecting an existing control and then modifying its style or template. You can also convert any property value in the Properties panel to a resource. For more information, see Create a resource (Blend for Visual Studio).

    • To add a media item   Under Media, select a media item from the list (such as an image or video file), and then use your mouse to draw the control on the artboard.

      Note

      The media file must already be listed in the Projects panel. To add a file to your project, click Add Existing Item on the Project menu. For more information about how to use media files in Blend, see Insert an item into the active document (Windows Store apps) and Insert an audio or video file into the active document (Blend for Visual Studio).

    • To add a custom or user control   Under Project, select a custom control from the list, and then use your mouse to draw the control on the artboard.

      Note

      If you have added a custom control or user control to your project and you do not see it listed in the Project category, build your project (Ctrl+SHIFT+B.

To add an object by using the Resources panel

  1. From the Resources panel, expand the nodes, and then select a resource.

  2. Drag the resource onto the artboard.

    • If the resource is a style or a template, an instance of the control that the resource was created from is added to the artboard, with the style or template already applied.

    • If the resource is a property value, a pop-up menu appears that gives you the option to create a new object and then apply the style to one of its properties, or apply the style to one of the existing objects on the artboard.

To modify an object

  • Do one of the following:

    • Modify the object by using the on-object handles that appear on the artboard when you move the pointer over the corners of the blue bounding box of the object. These handles enable you to rotate JJ154979.888cbf6b-c442-424d-977d-61d942703c4a(en-us,VS.110).png, resize or flip JJ154979.7d350cd4-6d4f-40bc-9d04-d46d2d54ebee(en-us,VS.110).png, move JJ154979.eff911a7-b891-4315-a86c-cc4cd088e647(en-us,VS.110).png, or add a corner radius JJ154979.8ff4c5e0-3b7f-49d7-97cb-ad373c3a7fe7(en-us,VS.110).png to the object. If you do not see the on-object handles, click Selection JJ154979.2ff91340-477e-4efa-a0f7-af20851e4daa(en-us,VS.110).png or Direct Selection JJ154979.6dd6571f-c116-451d-8dd2-1f88b8406362(en-us,VS.110).png, and then select the object.

      You can change the behavior of the on-object handles in the following ways:

      • To constrain the aspect ratio, hold down the Shift key while you resize or scale.

      • To maintain the position of the center point (instead of maintaining the position of the opposite corner or edge), hold down the Alt key while you resize, scale, or skew.

      • To snap every 15 degrees, hold down the Shift key while you rotate the object.

    • Modify the object by selecting it in the Objects and Timeline panel and then changing the properties in the Properties panel. You can use this method to change the appearance of the object, change its location, or bind data to specific properties on the object.

    • Animate the object.

      For more information, see Animating objects (Blend for Visual Studio).

    • Create a template for the object by selecting the object in the Objects and Timeline panel, and then selecting Edit Style or Edit Template under the Object menu.

      For more information, see the following topics:

See Also

Tasks

Reposition or translate an object (Blend for Visual Studio)

Rename an object (XAML)

Move an object (Blend for Visual Studio)

Copy, cut, paste, or delete an object (XAML)

Align objects (Blend for Visual Studio)

Group or ungroup objects (Blend for Visual Studio)