0,0 is not going to work for painting - you won’t be able to see anything. I’ve used 10, 20 for testing.
Sub Opening() Handles Opening
const theHeader as String = "bla,blub,blubber"
HeaderValues = theHeader.Split(",")
End Sub
Function PaintHeaderContent(g As Graphics, column As Integer) Handles PaintHeaderContent as Boolean
g.DrawString(HeaderValues(column), 10, 20)
Return True
End Function
I don’t do anything explicit to make the columns resizable, but I do to make them centered.
I’m currently doing this to get the header text centered in each column header:
Var x As Integer = 10
Var y As Integer = 13
Select Case column
Case 0
x = 25
Case 1
x = 16
Case 2
x = 0
Case 3
x = 15
Case 4
x = 10
Case 5
x = 13
Case 6
x = 3
Case 7
x = 6
Case 8
x = 45
End Select
A lot simpler to use g.textwidth(mytext) to get the width of the text you want to put out there, and mylistbox.ColumnAttributesAt(i).WidthActual to get the width of column i. From these you can calculate what the x-offset needs to be. And it works for all columns even if they’re resized.
Var x As Integer = 10
Var y As Integer = 13
Var t As String = LO_CallsListHeaderTitles(column)
Var w As Integer = g.TextWidth(t)
Var a As Integer = Me.ColumnAttributesAt(column).WidthActual
x = (a - w) / 2
If (Not Debug.DSSAssert(CurrentMethodName, “x”, x, GL_ERR, AS_GREATERTHAN, DENDebug.AssertMessages.QuitWithErrorMessage)) Then Return False