Winforms Gantt Chart

Released 5 years ago , Last update 5 years ago

This .NET 4.0 class library project provides a C# Winforms UserControl that draws a gantt chart using GDI+

Winforms Gantt Chart Control

This winforms control is specifically useful if you are looking to quickly generate a gantt chart from raw data or draw the chart area of a typical gantt chart application.

The code is organised into a Chart usercontrol (view layer) and a ProjectManager (data layer) with a customisable (by inheritance) Task object which you can attach custom business data to suit your application.

screen shot demo of control in action

Control Features

  • Features Time unit independant data structure specification
  • Single tasks, grouped tasks, precedent/dependant tasks, split tasks, tagged resources
  • Printing respects page margin, orientation and multiple pages per page
  • Percentage complete property for each task
  • Various mouse events for customising UI experience directly on the chart.
  • Comes with default mouse commands that can be overriden through inheritance.
  • Determines critical path and slack
  • 5 0
  • 4 1
  • 3 0
  • 2 0
  • 1 0
1 Reviews Read Reviews


14 day 14-day money-back guarantee


MIT license

The MIT license is an open-source license.


Application License

  • Perpetual license

  • unlimited applications

  • Can distribute binary products only

  • Commercial use


Developer License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use


Sample usage is written below for easy reference. For full control documentation, please refer to doxygen documentation. Sample project is also included in the package.

Basic Usage: Create Chart and Adding Tasks

public Form1()
    var manager = new ProjectManager();
    var task = new Task() { Name = "Hello World" };
    var chart = new Chart();


Common Task Manipulation

You can manipulate the task through code using various methods in the ProjectManager:

// Set task durations 
_mManager.SetDuration(wake, 3);
// Give the Tasks some organisation, setting group and precedents e.g. make "wake" task a subtask under "work"
_mManager.Group(work, wake);
// Setting task dependencies e.g. make "wake" task a precedent of "brush teeth" task
_mManager.Relate(wake, teeth);
// Assigning Resources e.g. add "jake" resource to "wake" task
_mManager.Assign(wake, jake);
// splitting a tasks e.g. split the "pack up" task into 2 new tasks
_mManager.Split(pack, new MyTask(_mManager), new MyTask(_mManager), 2);
// set some tooltips to show the resources in each task e.g. set a tooltip on the "wake" task
_mChart.SetToolTip(wake, string.Join(", ", _mManager.ResourcesOf(wake).Select(x => (x as MyResource).Name)));

Custom Task Data: Different colors for every tasks

You can change the default task appearance for all task, or as in here change individual task color as a demo for adding customer business data to tasks.

public partial class ExampleSimple : Form
    ProjectManager _mProject;

    public ExampleSimple()

        _mProject = new ProjectManager();
        _mProject.Add(new Task() { Name = "New Task" });
        _mProject.Add(new ColoredTask() { Name = "Purple Task", Color = Color.Purple });
        _mProject.Add(new ColoredTask() { Name = "Gold Task", Color = Color.Gold });

        // Custom behavior on paint task
        _mChart.PaintTask += (s, e) =>
            ColoredTask ctask = e.Task as ColoredTask;
            if (ctask != null)
                var format = new TaskFormat();
                format = e.Format;
                format.BackFill = new SolidBrush(ctask.Color);
                e.Format = format;

        // Grab custom data for tasks
        _mChart.TaskSelected += (s, e) =>
            ColoredTask ctask = e.Task as ColoredTask;
            if (ctask != null)
                MessageBox.Show("Selected " + ctask.Color.ToString());

// Custom task with business data
public class ColoredTask : Task
    public ColoredTask()
        : base()

    public Color Color { get; set; }


This package is provided as a Microsoft Visual Studio 2010 .NET 4.0 C# solution with source code, example project and unit test project and comes with a copy of doxygen HTML documentation.

There is no special requirement or third party binaries required for compilation.

4 licenses, starting from From » FREE View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

Or enter your name and Email
  • SN Sven Norlin 4 weeks ago
    Is it possible to make the timeline look something like this(divide each month in 4 weeks)? Jan Feb Mar w1 w2 w3 w4 w1 w2 w3 w4 w1 w2 w3 w4
  • SN Sven Norlin 4 weeks ago
    I can see there is a function for grouping tasks but in your example I can't see the outcome of it. I want to create a grouping by persons in my chart where all the tasks for each persons keep together like below, is this possible? and if so can you give med an example? PERSON 1 task 1 task 2 ...............................Separator....................................... PERSON 2 task 1 task 2 task 3
  • S Sven 1 month ago
    Is it possible to create a vertical region through the chart to mark for example public holidays?