Cant Figure this out....

dcahrakos

Freshman
Joined
Jul 18, 2004
Messages
25
Ok, well basically, I have a main form, and another form, on the main form is a status bar, and what I want to do is, from the other form, when someone picks something out of a listbox, and presses the OK Button, then the text on one of the panels on the statusbar on the main form changes to what was picked in the listbox....can anyone help me with this?
 
Is this what your looking for?

dcahrakos said:
Ok, well basically, I have a main form, and another form, on the main form is a status bar, and what I want to do is, from the other form, when someone picks something out of a listbox, and presses the OK Button, then the text on one of the panels on the statusbar on the main form changes to what was picked in the listbox....can anyone help me with this?

Which Part are you having trouble with, getting that data from the listbox or just getting the data to the statusbar?

To change the text in a status bar you use

Visual Basic:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'i = which panels text to change
'FormName = then name of the form the statusbar is on.
'FormName isn't used if the code is on the form the statusbar is on.
FormName.StatusBar1.Panels(i).Text = "some text"
End Sub

Hope This Helps

ZeroEffect
 
You must first create an instance of the form you want to change the status bar of for the above example to work.

Visual Basic:
#Region " Windows Form Designer generated code "

    Dim FormName As FormName

    Public Sub New(ByVal StatForm As FormName)
        MyBase.New()

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

        'Add any initialization after the InitializeComponent() call
        FormName = StatForm

    End Sub

This will give you an instance of the current form.

Hope this helps.
 
Back
Top