Please find more information about Visual Drawing.Net in my personal web site at http://vddotnet.erdalhalici.com


Setting Up your Development Environment

Please take the following steps to set up your Visual Studio.Net development environment:

  • Create a new C# or VB.Net project.

To create a project:

  1. On the File menu, point to New, and then selectProject.
  2. In the Project Types pane, choose your desired language.
  3. In the Templates pane, choose your desired template for a Visual Basic or Visual C# projects, or choose a managed project template for Visual C++ projects.
    Note In the Name box, name the project something unique to indicate the application's purpose. In theLocation box, enter the directory in which you want to save your project, or click theBrowse button to navigate to it.
  • Add a reference to Camalon.Drawing.dll, Camalon.ColorPicker.dll andCamalon.Drawing.Design.dll in your project.

Note The reference to Camalon.Drawing.Design.dll and Camalon.ColorPicker.dll is only used during the design time. It is not used in run time. You don't need to deliver this to user's computer when deployed. You may remove this references, when you deploy your application.

To add the reference:

  1. In Solution Explorer, expand the project node you want to add a reference to.
  2. Right-click the References node for the project and select Add Reference from the shortcut menu.
  3. Locate the Camalon.Drawing.dll using the Browse button.
  4. Click OK. The reference will appear under the References node of the project.
  5. Please repeat the steps above for Camalon.ColorPicker.dll andCamalon.Drawing.Design.dll.

 

Note Following steps are not required if you have already done it:

  • Add a custom tab to the Toolbox
    1. Right-click on any existing tab in the Toolbox and choose Add Tab from its shortcut menu. The new tab appears at the bottom of the Toolbox window, with the Pointer tool automatically added.
    2. In the text box at the bottom of the Toolbox, type a name for the new tab and then press ENTER.

      Note If you already have a custom tab in your ToolBox that you want to use, ignore this step.
  • Add Shapes and shape decorators( ShapeBrush, ShapePen etc.) on your Toolbox tab

    1. On the Tools menu, choose Add/Remove Toolbox Items.

      The Customize Toolbox dialog box opens.

    2. In the Customize Toolbox dialog box, click from tab to tab to browse through available categories ofToolbox items.
    3. In each category, either

      Select the Shapes and shape decorators you want to add.

      — or —

      Click Browse to add the Shapes and painting tools not available on the current list. To do this, locate theCamalon.Drawing.dll.

    4. Click OK to close the Customize Toolbox dialog box. The Shapes and painting tools are added to the tab currently selected in theToolbox. From there, you can drag and drop Shapes and painting tools in a Shape Container.

Adding a new ShapeContainer Class in your Project

Please take the following steps to add a new ShapeContainer class in your project:

In Solution Explorer, select a target project.

  1. On the Project menu, select Add Class.
  2. Select the Code Category in the left pane.
  3. Select Class in the right pane.
  4. Enter the Name of the class
    Note
    The types of files that you can add to a project are determined by the project template used to create it. For example, you can add a new file with extension .vb to a project created with a Visual Basic project template.
  5. Select Open.
  6. Switch to Code View and inherit your class fromCamalon.Drawing.ShapeContainer class and add designer required methodInitializeComponent as described below:

 

Note Instead of adding a Class, you can add a newComponent in your project and then inherit it from Camalon.Drawing.ShapeContainerclass. Thus, all Shape Container Designer required code would be generated automatically.

 

C#

[System.ComponentModel.ToolboxItem(true)]
public class MyShapeContainer:Camalon.Drawing.ShapeContainer
{

public MyShapeContainer()

{

//This call is required by the Shape Container Designer

InitializeComponent();

}

 

//Required method for Designer support - do not modify
//the contents of this method with the code editor.
private void InitializeComponent()
{

}

}


Visual Basic

<System.ComponentModel.ToolboxItem(True)> _
Public Class MyShapeContainer
Inherits Camalon.Drawing.ShapeContainer

Public Sub New()

'This call is required by the Shape Container Designer
InitializeComponent()

End Sub

 

'Required method for Designer support - do not modify
'the contents of this method with the code editor.
Private Sub InitializeComponent()


End Sub

End Class

 

7. Switch back to Design View and drag and drop Shapes and Shape Decorators from theToolBox to the Shape Container Designer. The Shape Decorators such as ShapeFill, PathGradientFill, ShapeOutline etc. can be dragged and dropped to a shape to fill its surface in the shape container.

Note You must add the Class Level attribute ToolBoxItemAttribute, to be able to add your newly created ShapeContainer in theToolBox.

 

 

Last edited Feb 12, 2013 at 3:25 AM by mediteriana, version 2

Comments

No comments yet.