Getting Started with the ActiveGanttVBW Gantt Chart Scheduler Component

Saturday, November 12, 2011

ActiveGanttVBW is a Gantt Chart / Scheduler component designed for the Windows Presentation Foundation (WPF) and Visual Basic .Net. This is a complete tutorial that describes how to get started with the ActiveGanttVBW Component. It covers installing the component, as well as creating a very simple WPF application with ActiveGanttVBW.

1. ActiveGanttVBW Requirements

2. Downloading the ActiveGanttVBW component.

3. Installing the ActiveGanttVBW component.

4. Examining the files created by the ActiveGanttVBW install program.

      4.1. The ActiveGanttVBW HTML Help Shortcut.

      4.2. The ActiveGanttVBW Demo Project Shortcut.

      4.3. The ActiveGanttVBW Demo Executable.

5. How to create a simple WPF application using the ActiveGanttVBW component.

1. ActiveGanttVBW Requirements.

For developing applications with ActiveGanttVBW:

For deploying your applications that use ActiveGanttVBW:

Notes:

2. Downloading the ActiveGanttVBW component.

The latest version of the ActiveGanttVBW component is accessible from this page in our website:

http://www.sourcecodestore.com/TrialDownloads/ActiveGantt/Default.aspx

Select ActiveGanttVBW from the drop down list and press the Download Now button, select the destination directory (this procedures varies according to the type of browser being used) and begin downloading.

The ActiveGanttVBW install program is packaged in a compressed .zip file. The file names are structured according to the following convention:

3. Installing the ActiveGanttVBW component.

Downloading will have left you with a file named AGVBW_NETXX_X_X_X(D/R).zip.

The ActiveGanttVBW install program does not contain any spyware, viruses or useless third party tools.

 

This .zip file contains two files: the .msi install package and a readme file in .rtf format. The readme file can be viewed using Microsoft Word or Word Pad.

 

Extract both files from the .zip file

 

Double click on the AGVBW_NETXX_X_X_X(D/R).msi file to begin the install process. In Windows Vista and above you will get a security prompt. Click on the Yes button to continue.

 

You will be taken to the welcome screen of the ActiveGanttVBW installation program. Click on the Next button.

 

You will then be prompted for the installation directory. Click on the Next button.

 

The install program will ask for your confirmation before beginning to install ActiveGanttVBW, click on the Next button.

 

Another security screen will ask you if you want the ActiveGanttVBW install program to copy software onto your computer. Click on the Yes button.

 

After the ActiveGanttVBW installation program finishes copying files to your computer, a browser window will open which contains all the above setup instructions plus any version specific information that might be of use.

 

Click on the Close button to terminate the installation of ActiveGanttVBW.

 

The ActiveGanttVBW component can now be uninstalled using the control panel. Always use the control panel application to uninstall ActiveGanttVBW. After uninstalling the ActiveGanttVBW component you can also erase the "C:\Program Files\The Source Code Store LLC\ActiveGanttVBW\" directory for a complete uninstall.

You must completely uninstall the ActiveGanttVBW component when upgrading to a more recent version or when switching from the Trial to the Release version.

4. Examining the files created by the ActiveGanttVBW install program.

On a default install of the ActiveGanttVBW component, all files will be copied to the "C:\Program Files\The Source Code Store LLC\ActiveGanttVBW\" directory.

The most important files in this directory are the following:

Path File Description
C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\ AGVBW_TR.sln The Visual Studio Solution File
C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\AGVBWCON\ AGVBWCON.vbproj The example's Visual Basic project file
C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\AGVBWCON\bin\ AGVBWCON.exe The example's executable file
C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\AGVBWCON\AGVBW\ AGVBW.dll The ActiveGanttVBW WPF Control
C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\Additional Files\ AGVBW.chm The ActiveGanttVBW compiled HTML Help file

 

The install program will generate one shortcut on the desktop, the ActiveGanttVBW Demo Project is a shortcut to the AGVBW_TR.sln file.

 

The install program will also create an ActiveGanttVBW menu in Programs. This menu contains copies of the shortcut installed on the desktop, plus a shortcut to the ActiveGanttVBW help file and a shortcut to the ReadMe file.

4.1. The ActiveGanttVBW HTML Help Shortcut.

 

Clicking on the ActiveGanttVBW Help shortcut in the ActiveGanttVBW menu will bring up the local HTML help file for the component.

 

This help file is also available online from this link:

http://www.sourcecodestore.com/Documentation/DOCFrameset.aspx?PN=AG&PL=VBW

4.2. The ActiveGanttVBW Demo Project Shortcut.

Clicking on the ActiveGanttVBW Demo Project shortcut will generate an elevated permissions prompt in the operating system. Click on the Restart this application under different credentials option.

 

You will then get a User Access Control prompt. Click on the Yes button.

 

You will then get the AGVBW_TR.sln Visual Studio solution file.

The Visual Studio solution file contains all the source code for the ActiveGanttVBW example. You can press the F5 key to begin debuging.

4.3. The ActiveGanttVBW Demo Executable.

 

In a default installation the AGVBWCON.exe file will be located in "C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\AGVBWCON\bin".

 

Clicking on the AGVBWCON.exe file will bring up this screen.

The ActiveGanttVBW Demo has two main examples:

Additionally the ActiveGanttVBW Demo has three examples on how to read Microsoft Project 2003, 2007 and 2010 XML files.

All the code used to generate the demo is included in the AGVBW_TR.sln Visual Studio Solution.

5. How to create a simple WPF application using the ActiveGanttVBW component.

Start a new instance of Visual Studio.

 

Select   File -> New -> Project....

.

 

In the New Project dialog select   Installed Templates -> Visual Basic -> Windows -> WPF Application. Leave the solution's name as the default: WPFApplication1.

 

The template will generate a WPF application with a single WPF Window named MainWindow.

 

Select the Toolbox tab on left. Right click on any control and from the drop down menu select the Choose Items... option.

 

The Choose Toolbox Items dialog will pop-up. Click on the Browse button in the WPF Components tab.

 

Select the ActiveGanttVBW component (AGVBW.dll). In a default installation it will be located in "C:\Program Files\Boötes Systems SAS\ActiveGanttVBW\AGVBWCON\AGVBW\AGVBW.dll". Then click on the Open button.

 

The ActiveGanttVBWCtl is now included in the Choose Toolbox Items dialog. Click on the OK button to exit the dialog.

 

After exiting the Choose Toolbox Items dialog, the ActiveGanttVBWCtl component will now be present in the Toolbox.

 

Drag the ActiveGanttVBWCtl from the Toolbox onto the MainWindow.

In the trial version of the ActiveGanttVBW control you will be presented with a nag screen, click the OK button to continue.

In the trial version of the component the nag screen will pop-up when:

  • You are adding a new control from the Toolbox onto a Form.
  • You are opening a Window in design view that contains an ActiveGanttVBW control.
  • You are building the project.
  • You are opening a WPF Window during runtime that contains the ActiveGanttVBW control.

When you change the MainWindow's XAML code to the following:


<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="650" Width="850" xmlns:AGVBW="clr-namespace:AGVBW;assembly=AGVBW">
    <Grid>
        <AGVBW:ActiveGanttVBWCtl Name="ActiveGanttVBWCtl1" />
    </Grid>
</Window>

 

The ActiveGanttVBW control and the MainWindow will be resized to a more appropriate size. Press the F5 key to begin debugging or alternatively you can go to the  Debug -> Start Debugging  menu.

 

At this time you will only have an ActiveGanttVBW control with no functionality. The watermark on the lower right hand side will only be present in the trial version of the ActiveGanttVBW component.

 

Close the window to exit debugging. You will again have the MainWindow in design view. Go to the Properties Window on the bottom right hand side. Click on the Events tab. Scroll down to Loaded and double click on the dropdown on the right.

Include the following code:


     Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
        Dim i As Integer
        ActiveGanttVBWCtl1.Columns.Add("Column 1", "", 125, "")
        ActiveGanttVBWCtl1.Columns.Add("Column 2", "", 100, "")
        For i = 1 To 10
            ActiveGanttVBWCtl1.Rows.Add("K" & i.ToString(), "Row " & i.ToString() & " (Key: " & "K" & i.ToString() & ")", True, True, "")
        Next

        ActiveGanttVBWCtl1.Redraw()
    End Sub

The above code will create two Columns and ten empty Rows. Notice that every Row has to be identified by a unique key, "K1", "K2", K3", etc.

 

Press the F5 key to begin debugging. You will now have an ActiveGanttVBW control with no Task objects.

 

You can add Task objects by clicking and dragging over any Row in the Client Area of the ActiveGanttVBW control.

You can also add Task objects programmatically:


    Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
        Dim i As Integer
        ActiveGanttVBWCtl1.Columns.Add("Column 1", "", 125, "")
        ActiveGanttVBWCtl1.Columns.Add("Column 2", "", 100, "")
        For i = 1 To 10
            ActiveGanttVBWCtl1.Rows.Add("K" & i.ToString(), "Row " & i.ToString() & " (Key: " & "K" & i.ToString() & ")", True, True, "")
        Next

        ActiveGanttVBWCtl1.CurrentViewObject.TimeLine.Position(New AGVBW.DateTime(2011, 11, 21, 0, 0, 0))
        ActiveGanttVBWCtl1.Tasks.Add("Task 1", "K1", New AGVBW.DateTime(2011, 11, 21, 0, 0, 0), New AGVBW.DateTime(2011, 11, 21, 3, 0, 0), "", "", "")
        ActiveGanttVBWCtl1.Tasks.Add("Task 2", "K2", New AGVBW.DateTime(2011, 11, 21, 1, 0, 0), New AGVBW.DateTime(2011, 11, 21, 4, 0, 0), "", "", "")
        ActiveGanttVBWCtl1.Tasks.Add("Task 3", "K3", New AGVBW.DateTime(2011, 11, 21, 2, 0, 0), New AGVBW.DateTime(2011, 11, 21, 5, 0, 0), "", "", "")

        ActiveGanttVBWCtl1.Redraw()
    End Sub

 

The above code will produce this result.

The examples included in the demo cover almost every piece of functionality present in the ActiveGanttVBW component, but if you need further assistance please read our ActiveGantt support options. Important: if you are sending an e-mail you have to specify that you are referring to the ActiveGanttVBW component, otherwise you will inevitably experience delays in having your query answered.

 

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.