Question
How can I render a custom link when I set the link style to
tlsUserDraw. Can you supply an example please?
Answer
The first thing to do is to create the link and set its style to User:
Private Sub LinkTimes(theFrom As IphDataEntity_GantTime, theTo As IphDataEntity_GantTime)< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Dim aLink As IphDataEntity_Link
Dim aInt As Integer
   
   If (theFrom Is Nothing) Or (theTo Is Nothing) Then
     ‘ Dont do anything
   Else
     Set aLink = phGantX1.AddLink
        
     aLink.LinkOwner = theFrom
     aLink.LinkedTo = theTo
     
     aInt = globalCounter Mod 4
     ‘aLink.LinkStyle = tlsMSProject
     aLink.LinkStyle = tlsUserDraw
     
     aLink.LinkColor = vbBlue
     
     If aInt = 1 Then
       aLink.StartFinishOption = tlsfFS
     ElseIf aInt = 2 Then
       aLink.StartFinishOption = tlsfSS
     ElseIf aInt = 3 Then
       aLink.StartFinishOption = tlsfFF
     ElseIf aInt = 3 Then
       aLink.StartFinishOption = tlsfFS
     End If
     globalCounter = globalCounter + 1
   End If
   Set globalToLinkTo = theTo
End Sub
Private Sub phGantX1_OnUserDrawLink(ByVal theGant As phGantXControl.IphGantX2, ByVal theDataEntity_Link As phGantXControl.IphDataEntity_Link, ByVal theHDC As Long, ByVal Startx As Long, ByVal Starty As Long, ByVal Stopx As Long, ByVal Stopy As Long)
aDummy = Module1.MoveTo(theHDC, Startx, Starty)
aDummy = Module1.LineTo(theHDC, Stopx, Stopy)
End Sub