jmcilhinney said:He has a StatusBar at the bottom of the form with several StatusBarPanels. Above that, on the form surface (not in front of, as in z-order, but vertically above) he has the same number of Labels as StatusBarPanels. He wants each Label to relocate and/or resize to remain in the same position relative to the corresponding StatusBarPanel.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SetLabelLocations()
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
Me.SetLabelLocations()
End Sub
Private Sub SetLabelLocations()
Me.Label1.Left = 0
Me.Label1.Width = Me.StatusBarPanel1.Width
Me.Label2.Left = Me.Label1.Right
Me.Label2.Width = Me.StatusBarPanel2.Width
Me.Label3.Left = Me.Label2.Right
Me.Label3.Width = Me.StatusBarPanel3.Width
Me.Label4.Left = Me.Label3.Right
Me.Label4.Width = Me.StatusBarPanel4.Width
End Sub
[SIZE=2]Label1.Size = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Size([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].StatusBar1.Panels.Item(0).Width, 20)
Label2.Size = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Size([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].StatusBar1.Panels.Item(1).Width, 20)
Label2.Left = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label1.Width
Label3.Size = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Size([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].StatusBar1.Panels.Item(2).Width, 20)
Label3.Left = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label1.Width + [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label2.Width
Label4.Size = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Size([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].StatusBar1.Panels.Item(3).Width, 20)
Label4.Left = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label1.Width + [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label2.Width + [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].Label3.Width
[/SIZE]
Who you calling lazzzzzzzzz.........kulrom said:For those who were lazy to open my attachment