Can someone please explain how to implement the IntegralHeight and ItemHeight properties into a UserControl

I have a segmented progress bar and I would like to restrict the size (width) of the control so that only complete segments can be shown.

I cannot find much info on the topic, other then enabling it on a ListBox...


Re: Visual Basic Express Edition IntegralHeight in a custom control


Here's an example, works in the designer too:

Public Class UserControl1
Private Sub UserControl1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
'--- Snap to a multiple of 10 pixels
Me.Width = 10 * ((Me.Width + 5) \ 10)
End Sub
End Class