This topic will give you a head start on creating great looking viewport for all of your Windows Forms applications.
Creating a new Windows Application Project
- Launch Visual Studio
- From the File menu, select New, and then click Project
- In the New Project dialog box, click either Visual C# or Visual Basic from the Project types list
- From the Templates list, click Windows Forms Application
- In the Name field, replace the default project name with the name of your project
Adding a viewport to Form1
Add a viewport to your Windows Form by either double-clicking on the ViewportProfessional toolbox icon (installed in the Eyeshot tab of the toolbox), or by clicking on the icon once then "drawing" the viewport onto the form using the left mouse button.

Figure 1: The Eyeshot viewport control in design-time mode.
Required using/Imports statements
Add the following using/Imports statements at the beginning of the Form1.cs file.
| C# | Copy Code |
|---|---|
|
using devDept.Eyeshot; using devDept.Eyeshot.Standard; using devDept.Eyeshot.Geometry; | |
| Visual Basic | Copy Code |
|---|---|
|
Imports devDept.Eyeshot Imports devDept.Eyeshot.Standard Imports devDept.Eyeshot.Geometry | |
Customizing your viewport
Expand the Background property in the Properties window under the Viewport category and change the TopColor. A long list of viewport attributes is available, spend a couple of minutes on them.

Figure 2: Changing the viewport control background.
Adding the Load event handler to Form1
From the Form1 properties window switch to Events and double-click the Load event, the Form1_Load() method will be added to the Form1 class.
Drawing a rectangular face
Add the following lines to the Form1_Load() method, then build and start your application.
| C# | Copy Code |
|---|---|
|
private void Form1_Load(object sender, EventArgs e) { // creates a new Quad entity Quad q = new Quad( 0, 0, 0, // first vertex 100, 0, 0, // second vertex 100, 80, 80, // third vertex 0, 80, 80, // fourth vertex Color.DarkOrange); // adds the entity to viewport's master entity collection viewportProfessional1.Entities.Add(q); // Sets edge color as entity color viewportProfessional1.Edge.ColorMode = edgeColorType.EntityColor; // Fits the model in the viewport viewportProfessional1.ZoomFit(); } | |
| Visual Basic | Copy Code |
|---|---|
|
Private Sub Form1_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' creates a new Quad entity Dim q As New Quad( _ 0, 0, 0, _ ' first vertex 100, 0, 0, _ ' second vertex 100, 80, 80, _ ' third vertex 0, 80, 80, _ ' fourth vertex Color.DarkOrange)) ' adds the entity to viewport's master entity collection viewportProfessional1.Entities.Add(q); ' Sets edge color as entity color viewportProfessional1.Edge.ColorMode = edgeColorType.EntityColor ' Fits the model in the viewport viewportProfessional1.ZoomFit() End Sub | |
You should now see something like this:

Figure 3: Your first 3D drawing with Eyeshot.
![]() |
Navigation quick commands:
|
For your convenience you may want to rename viewportProfessional1 as viewport1.
Now it's your turn
Try to add more entities like points, lines, circles, triangles, etc. You'll find them in the devDept.Eyeshot.Standard namespace.
Introduction
Installation and Requirements
