statusbar problem how do i update panel text and also display progress bar

i have the code below in an update form...

my problem is i dont think the text is going to the panel and displaying..at least i cant see it when its run...

my next question is how do i put a progressbar to show the downloaded files progress

(and have i dont this form right, ie is the code slopy or can it be better, im learning vb.net any help would be great)

Thx
Johnny
aka Pern

---- code ---
Public Class Update

    Private Sub Update_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        ''Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        ''Me.ClientSize = New System.Drawing.Size(232, 40)
        ''Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        ''Me.Name = "update"
        ''Me.ShowInTaskbar = False
        ''Me.Text = "Updater"
        ''Me.TransparencyKey = System.Drawing.SystemColors.Control
        ''Me.WindowState = System.Windows.Forms.FormWindowState.Minimized

        'Label1.Text = Me.ProductVersion
        TextBox1.Text = "This product version is: " & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString 'Application.ProductVersion
        ListBox1.Items.Add("Version Major: " & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major)
        ListBox1.Items.Add("Version Minor: " & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor)
        ListBox1.Items.Add("Version Build: " & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build)
        ListBox1.Items.Add("Version Revision: " & System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision)

        Dim Panel1_text As String
        Panel1_text = "Ready..."
        ''CreateMyStatusBar(Panel1_text)



        ' Create a StatusBar control.
        Dim statusBar1 As New StatusBar()
        ' Create two StatusBarPanel objects to display in the StatusBar.
        Dim panel1 As New StatusBarPanel()

        Dim panel2 As New StatusBarPanel()

        ' Display the first panel with a sunken border style.
        panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken
        ' Initialize the text of the panel.
        ''panel1.Text = "Ready..."
        panel1.Text = Panel1_text
        ' Set the AutoSize property to use all remaining space on the StatusBar.
        panel1.AutoSize = StatusBarPanelAutoSize.Spring
        ' Display the second panel with a raised border style.
        panel2.BorderStyle = StatusBarPanelBorderStyle.Raised
        ' Create ToolTip text that displays the current time.
        panel2.ToolTipText = System.DateTime.Now.ToShortTimeString()
        ' Set the text of the panel to the current date.
        panel2.Text = System.DateTime.Today.ToLongDateString()
        ' Set the AutoSize property to size the panel to the size of the contents.
        panel2.AutoSize = StatusBarPanelAutoSize.Contents

        ' Display panels in the StatusBar control.
        statusBar1.ShowPanels = True

        ' Add both panels to the StatusBarPanelCollection of the StatusBar.            
        statusBar1.Panels.Add(panel1)
        statusBar1.Panels.Add(panel2)

        ' Add the StatusBar to the form.
        Me.Controls.Add(statusBar1)

        ''Panel1_text = "Ready...test"
        ''CreateMyStatusBar(Panel1_text)
        statusBar1.Panels(0).Text = "Downloading file ..."

        deleteFile("ArgoDragonEMailManager_Version.txt")

        Dim wc As New System.Net.WebClient()
        wc.DownloadFile("http://www.argodragonsoftware.info/Download/ArgoDragonEMailManager_Version.txt", _
                 "ArgoDragonEMailManager_Version.txt")
        statusBar1.Panels(0).Text = "Got file: ArgoDragonEMailManager_Version.txt"
        Dim strVersion, strPath As String
        ''Try
        'Dim uc As New Net.WebClient
        'uc.DownloadFile("http://router19.org:8080/updates/updater.txt", "updater.txt")
        If System.IO.File.Exists("ArgoDragonEMailManager_Version.txt") Then
            ''MsgBox("Exists!")
            statusBar1.Panels(0).Text = "File Exists: ArgoDragonEMailManager_Version.txt"
            FileOpen(2, "ArgoDragonEMailManager_Version.txt", OpenMode.Input) ', OpenAc
            strVersion = LineInput(2)
            TextBox2.Text = "" & strVersion
            FileClose(2)

        Else
            ''MsgBox("D'oh!")
            TextBox2.Text = "File not found or file was not downloaded"
        End If
        ''strPath = LineInput(2)
        'Shell("explorer.exe " & "http://www.router19.org/software.aspx", vbNormalFocus)
        ''Dim uc2 As Net.WebClient
        ''uc2.DownloadFile(strPath, "FirePanelXP.msi")
        ''Catch ex As Exception
        ''End Try

        statusBar1.Panels(0).Text = "Ready"
        wc.Dispose()

    End Sub
    Public Sub CreateMyStatusBar(ByVal Panel1_text As String)
        ' Create a StatusBar control.
        Dim statusBar1 As New StatusBar()
        ' Create two StatusBarPanel objects to display in the StatusBar.
        Dim panel1 As New StatusBarPanel()

        Dim panel2 As New StatusBarPanel()

        ' Display the first panel with a sunken border style.
        panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken
        ' Initialize the text of the panel.
        ''panel1.Text = "Ready..."
        panel1.Text = Panel1_text
        ' Set the AutoSize property to use all remaining space on the StatusBar.
        panel1.AutoSize = StatusBarPanelAutoSize.Spring
        ' Display the second panel with a raised border style.
        panel2.BorderStyle = StatusBarPanelBorderStyle.Raised
        ' Create ToolTip text that displays the current time.
        panel2.ToolTipText = System.DateTime.Now.ToShortTimeString()
        ' Set the text of the panel to the current date.
        panel2.Text = System.DateTime.Today.ToLongDateString()
        ' Set the AutoSize property to size the panel to the size of the contents.
        panel2.AutoSize = StatusBarPanelAutoSize.Contents

        ' Display panels in the StatusBar control.
        statusBar1.ShowPanels = True

        ' Add both panels to the StatusBarPanelCollection of the StatusBar.            
        statusBar1.Panels.Add(panel1)
        statusBar1.Panels.Add(panel2)

        ' Add the StatusBar to the form.
        Me.Controls.Add(statusBar1)
    End Sub

End Class
JohnnyAsked:
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.

burakiewiczCommented:
for the progress bar just add the progress bar control. for the text i think it is statusBar1.Panels(panel1).Text = "Downloading file ..."
if not i will check when i get home, at work right now
0
JohnnyAuthor Commented:
ive done that in the code a few times heres one:

statusBar1.Panels(0).Text = "Got file: ArgoDragonEMailManager_Version.txt"

but i cant see it eitehr its NOT displaying or its going by to fast or i thought it maybe that do events thing that used to be in vb6. does vb.net have that?? how would you incriment the progress bar for downloading the file?

thx
Johnny
aka Pern
0
armoghanCommented:
see this simple code it shows the panels and text in them, Also changing the 2nd panel's text on load

Public Class Form2
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
    Friend WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents StatusBarPanel2 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents StatusBarPanel3 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents StatusBarPanel4 As System.Windows.Forms.StatusBarPanel
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.StatusBar1 = New System.Windows.Forms.StatusBar
        Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel
        Me.StatusBarPanel2 = New System.Windows.Forms.StatusBarPanel
        Me.StatusBarPanel3 = New System.Windows.Forms.StatusBarPanel
        Me.StatusBarPanel4 = New System.Windows.Forms.StatusBarPanel
        CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.StatusBarPanel2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.StatusBarPanel3, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.StatusBarPanel4, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'StatusBar1
        '
        Me.StatusBar1.Location = New System.Drawing.Point(0, 244)
        Me.StatusBar1.Name = "StatusBar1"
        Me.StatusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.StatusBarPanel1, Me.StatusBarPanel2, Me.StatusBarPanel3, Me.StatusBarPanel4})
        Me.StatusBar1.ShowPanels = True
        Me.StatusBar1.Size = New System.Drawing.Size(292, 22)
        Me.StatusBar1.TabIndex = 0
        Me.StatusBar1.Text = "StatusBar1"
        '
        'StatusBarPanel1
        '
        Me.StatusBarPanel1.Text = "StatusBarPanel1"
        '
        'StatusBarPanel2
        '
        Me.StatusBarPanel2.Text = "StatusBarPanel2"
        '
        'StatusBarPanel3
        '
        Me.StatusBarPanel3.Text = "StatusBarPanel3"
        '
        'StatusBarPanel4
        '
        Me.StatusBarPanel4.Text = "StatusBarPanel4"
        '
        'Form2
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.StatusBar1)
        Me.Name = "Form2"
        Me.Text = "Form2"
        CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.StatusBarPanel2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.StatusBarPanel3, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.StatusBarPanel4, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.StatusBarPanel2.Text = "somenew text"
    End Sub
End Class
0
JohnnyAuthor Commented:
i give nothings working


0
armoghanCommented:
I have visual Studio 2003.
I created a Form, added scrollbar on it. In scrollbar properties.. I added panels. added what ever text is required in those panels
I made the property ShowPanels = True,

Now i can see the panels and string in them in Designer as well

I double clicked the form to get the Form_Load method. as I do have the panels, so I added the following lines

Me.StatusBarPanel2.Text = "somenew text"

This is simple and straight forward.
0

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
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.