Click here to Skip to main content
Click here to Skip to main content

Gantt Chart

, 2 Oct 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
Adds an easy to use Gantt chart to your application.



This component makes it easy to add a Gantt chart to your application. You just need three lines of code to get it working.

This Gantt chart control includes these features:

  • The columns are automatically shown based on the width of the component and the time between the start date and the end date. If there're more than two days between those dates, it will only show the date; otherwise, it will show the time of the day (with minimum 5 minutes apart).
  • You can set the color (including the hover color) for each bar individually.
  • The Gantt chart automatically shows a custom scroll bar when it contains more rows than the visible area allows.
  • You can easily obtain information about the bar when hovering your mouse above one.
  • An easy to use multi-row tooltip text.
  • Change bars using your mouse.


I tried to find a good, free, and easy Gantt chart control to use in my project, but didn't have any luck. Then, I decided to make one myself, which actually was easier than I thought it would be.

Using the code

To get the Gantt chart component to show something, you only need this:

GanttChart1.FromDate = New Date(2007, 12, 12, 0, 0, 0)
GanttChart1.ToDate = New Date(2007, 12, 24, 0, 0, 0)
GanttChart1.AddChartBar("Row 1", Nothing, New Date(2007, 12, 12), 
    New Date(2007, 12, 16), Color.Aqua, Color.Khaki, 0))

As mentioned above, this component also includes a multi-line tooltip text.

With GanttChart2
  Dim toolTipText As New List(Of String)

  .ToolTipTextTitle = .MouseOverRowText
  .ToolTipText = toolTipText
End With

When a tooltip-text-row is included, the line is automatically bolded.

It is also possible to save the Gantt Chart to an image file:


The included Zip file contains a project showing how to use its different features.


  • Version 0.55
    • Added the feature to drag the bars (after editing a bar, a BarChanged event is fired).
    • If time between start and end date is larger than 60 days, the Gantt chart switches over to showing months instead of days.
  • Version 0.54
    • The Gantt chart can now be saved to an image file.
  • Version 0.53
    • ScrollBar added to component.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author


Denmark Denmark
No Biography provided

Comments and Discussions

QuestionHorizontal Scroll Bar Pinmembergabriele_greco8-Apr-15 0:29 
QuestionHorizontal scroll bar to Gantt Chart Pinmembersalman ansari2-Mar-15 20:48 
GeneralMy vote of 5 PinmemberAAL87-Nov-14 11:44 
SuggestionUpgrade for rectangle bars PinmemberMember 1045306330-Oct-14 5:27 
QuestionI am getting an error that the control is missing. PinmemberArun KrishnaMoorthy16-Sep-14 22:02 
QuestionASP.Net Version of it ?? Pinmemberbenaref25-May-14 0:21 
QuestionC# Version Webforms PinmemberFlavio Renato19-Nov-13 2:23 
AnswerRe: C# Version Webforms PinmemberIngve Moss Liknes22-Mar-14 0:01 
GeneralRe: C# Version Webforms PinmemberMember 109619107-Aug-14 21:34 
Questionhow to add waiting Cursors in your lib PinmemberMember 87300737-May-13 17:54 
AnswerHow To Add Text to Bars PinmemberFamous Mortimer15-Apr-13 10:50 
QuestionHow to control the column text (need to change the moth to days) PinmemberMember 982388314-Apr-13 20:33 
AnswerRe: How to control the column text (need to change the moth to days) PinmemberAdagio.8117-Apr-13 1:50 
GeneralMy vote of 5 Pinmemberdoktor0_929-Jan-13 10:23 
GeneralRe: My vote of 5 PinmemberAdagio.8129-Jan-13 21:52 
QuestionSpeed improvement ?! PinmemberPSoft200014-Nov-12 4:54 
QuestionText on Bars PinmemberMember 95508663-Nov-12 11:01 
AnswerRe: Text on Bars Pinmemberfk_nirvana25-Jun-13 11:52 
QuestionHow to change line height for bars ? Pinmembermjfuchs4-Oct-12 2:39 
AnswerRe: How to change line height for bars ? [modified] PinmemberMember 95508663-Nov-12 11:12 
Question1 Question and 1 Error Pinmembermjfuchs2-Oct-12 3:06 
Questionsignatures on blocks Pinmemberibrogim4-Sep-12 2:29 
QuestionC# Version (bug fix help needed) PinmemberOrilon1-Sep-12 1:08 
GeneralRe: C# Version (bug fix help needed) PinmemberOrilon3-Sep-12 0:59 
Hi again,

I've posted new changes to the C# version of the Gantt Chart -[^]

It's now displaying the bars and layout correctly. I'm currently working on (adding) a "BarChanging" event for the control.
Will keep you posted.
Kind Regards
"There are 10 types of people in the world.
Those that understand binary... and those that don't!"

Questionadd more rows Pinmemberwoerny24-Jul-12 12:08 
AnswerRe: add more rows PinmemberAdagio.8124-Jul-12 20:26 
GeneralRe: add more rows Pinmemberwoerny25-Jul-12 11:13 
QuestionAdd a Text Column Pinmembermono543218-Jul-12 8:06 
AnswerRe: Add an other Text Column Pinmembermono543213-Aug-12 12:27 
QuestionFix for Ghost Bar PinmemberGoofkop13-Apr-12 2:00 
QuestionGhost Chart bar? PinmemberGoofkop5-Mar-12 5:52 
QuestionDo you have c# version?? Pinmemberliusanpi28-Feb-12 17:30 
AnswerRe: Do you have c# version?? PinmemberMember 1098361031-Jul-14 21:12 
QuestionI don't know how to use its !! PinmemberHighgain29-Jan-12 19:57 
GeneralMy vote of 2 [modified] Pinmembermusthe9930-Dec-11 20:24 
Question5 star Pinmemberchunk2-Nov-11 5:25 
GeneralMy vote of 5 Pinmemberralexs26-Aug-11 18:54 
Questionnice work mate Pinmembercdlitteam24-Aug-11 2:03 
QuestionNeed C# form source code for studying Pinmemberrongconmocrang13-Jul-11 1:41 
AnswerRe: Need C# form source code for studying PinmemberAdagio.8113-Jul-11 1:50 
GeneralRe: Need C# form source code for studying Pinmemberrongconmocrang15-Jul-11 19:50 
AnswerRe: Need C# form source code for studying Pinmvpthatraja26-Jan-12 21:42 
GeneralVery good PinmemberMember 392087330-Jun-11 16:33 
GeneralRe: Very good PinmemberAdagio.8113-Jul-11 1:51 
QuestionGreat! PinmemberMember 801179219-Jun-11 22:59 
AnswerRe: Great! PinmemberAdagio.8113-Jul-11 1:53 
GeneralGreat Job.... Pinmembersandipm8-May-11 20:31 
GeneralRe: Great Job.... PinmemberAdagio.8113-Jul-11 1:55 
GeneralMy vote of 5 Pinmemberweichiang333-May-11 17:17 
GeneralRe: My vote of 5 PinmemberAdagio.8113-Jul-11 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150414.1 | Last Updated 2 Oct 2008
Article Copyright 2007 by Adagio.81
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid