Manually adding a ToolStripStatusLabel Issues?

My program requires that at a certain point I manually add a ToolStripStatusLabel to my StatusStrip bar. I got it working to a point but I'm not sure it's the correct or accepted way to do so. When the program runs thru the code for the first time, even though the form in question has a StatusStrip along with a ToolStripStatuslabel already added, for some reason it appears as if it doesn't.

So, I execute the following code:

    If gSBR.Items.Count = 0 Then
        gSBR.Items(0).TextAlign = ContentAlignment.MiddleCenter
        gSBR.Items(0).Spring = True
    End If
    gSBR.Items(0).Text = "ESC - Close Form"


This code works but I'm not sure why I can't run this code:

    If gSBR.Items.Count = 0 Then
    End If  

It doesn't like the latter code.

Anyway, in the first set of code, I'm also trying to set the "Spring" property to True. Problem is, the Spring property doesn't show up in intellisense. How can I set this manually?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
In your second piece of code, you need to pass an instantiated object to the Add method. The name of the class is not sufficient:

gSBR.Items.Add(New ToolStripStatusLabel)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlakeMcKennaAuthor Commented:
Perfect James...worked like a charm!

BlakeMcKennaAuthor Commented:

I closed this out a little too soon. Your answer worked but was only part of the solution. I'm trying to reference the "Spring" property of the ToolStripStatusLabel and can't do it. Take a look at the last paragraph in my original post.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.