Solved

Status Strip in VB.NET

Posted on 2007-11-21
3
11,957 Views
Last Modified: 2008-02-01
I just started to fool with VB.NET - I program in other languages.

Curious why this code won't work.  The Status Strip does not update.  It just shows as Gray without any text at all in the form when it displays.  I know the code in this load event is executed as I sat and watched it during debug.  All of this happens, but I get no text. I added the msgbox after setting the text property and there's definitely text in there.  Not sure what keeps the text from showing.

Any ideas?

    Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        DatabaseLogin.ShowDialog()
        If gConnected = False Then
            MsgBox("You cannot use this program without logging on", MsgBoxStyle.Critical, "Terminating Program")
            Me.Close()
        End If
        StatusStrip1.Text = "Logged in as '" & gUserName & "'"
         MsgBox(StatusStrip1.Text)

        ' Crap I added to try to get the strip to show the message....
        ' I have tried it with various combinations of these and without them
        StatusStrip1.Enabled = True
        StatusStrip1.Visible = True
        StatusStrip1.Refresh()
        Me.Refresh()
        Application.DoEvents()
End Sub
0
Comment
Question by:kautz
3 Comments
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 250 total points
ID: 20332323
this won't work, the status strip is empty. Add a status label inside it, using the form designer, and change the text of the status label.

0
 
LVL 18

Accepted Solution

by:
armoghan earned 250 total points
ID: 20333480
Dim ToolStripStatusLabel1 As New System.Windows.Forms.ToolStripStatusLabel
        StatusStrip1.Items.Add(ToolStripStatusLabel1)
        ToolStripStatusLabel1.Text =  "Logged in as '" & gUserName & "'"
0
 

Author Comment

by:kautz
ID: 20342172
I see, this makes perfect sense, thanks.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Single Form 8 42
VB.NET (2008) - Refactoring Question 2 21
VB.net capture  result of a SQL query in variables 3 9
MailAddress in vb 4 15
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question