Label Topmost on Link Lines

How can I get the label to be on top of the Lines?

What you have there doesn’t look like the default behavior of the Processor sample. It starts with the Offset in LinkLabel at (0,0). This looks like (0,20) or so. If that’s right, changing the default on myOffset to (0,-20) should move the label up.

Hi Jake - i am not trying to move the label, i am talking about the Z - order of the label, i know that the label i part of the link. i am trying to make put all the Labels topmost on the view.

Oh! sorry. Ah… you can’t do that, at least easily. The labels are part of the GoGroup that is the parent class of GoLabeledLink. So, one of those groups in going to be on “top” of another.

You could, I suppose, cheat a bit. Override GoView.Paint, call the base, then scan the document for GoLabeledLinks, and look for LinkLabels within them, and call Pant on those objects again.

I think that would work… I haven’t tried it.

(Actually, overriding GoLayer.Paint and using that new class for the links layer would be better)

Hi Jake - i tried the following without success:

 Private Sub MyView_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
 
      For Each obj In Me.Doc
        If TypeOf obj Is GoDGMLink Then
          Dim ol As GoDGMLink = obj
          For Each o In ol
            If TypeOf o Is GoDGMLinkLabel Then
              o.Paint(e.Graphics, Me)
            End If
          Next
        End If
 
      Next
    End Sub
please assist me on getting this resolved.
Thunis

Try deriving a GoView class and override OnPaint. (GoLayer.Paint isn’t virtual)