So stuck on this little issue. I am trying to create a status strip with two labels, one below the other.

I've got the StatusStrip set as a TableLayout, with the row count set to 2, but no matter how I try configure the labels, they appear next to each other.

        Me.StatusStrip1.AutoSize = False
        CType(Me.StatusStrip1.LayoutSettings, TableLayoutSettings).RowCount = 2
        CType(Me.StatusStrip1.LayoutSettings, TableLayoutSettings).ColumnCount = 2
        Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.statusCyclePeriod, Me.statusLabel, Me.statusDuration})
        Dim cellPos As New TableLayoutPanelCellPosition(0, 0)
        CType(Me.StatusStrip1.LayoutSettings, TableLayoutSettings).SetCellPosition(Me.statusCyclePeriod, cellPos)
        cellPos = New TableLayoutPanelCellPosition(0, 1)
        CType(Me.StatusStrip1.LayoutSettings, TableLayoutSettings).SetCellPosition(Me.statusLabel, cellPos)
        cellPos = New TableLayoutPanelCellPosition(1, 1)
        CType(Me.StatusStrip1.LayoutSettings, TableLayoutSettings).SetCellPosition(Me.statusDuration, cellPos)
        Me.StatusStrip1.Location = New System.Drawing.Point(0, 426)
        Me.StatusStrip1.Name = "StatusStrip1"
        Me.StatusStrip1.Size = New System.Drawing.Size(742, 47)
        Me.StatusStrip1.TabIndex = 7
        Me.StatusStrip1.Text = "StatusStrip1"

This is the modified generated code, to give an idea of what Im trying to do. I'll take any hints on the solution, c#/ doesn't matter.

I know I am doing something silly or missing something stupidly obvious, but stuffed if i know.

0 Answers