Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
Posted

Is this what your looking for?

 

Ok' date=' 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?[/quote']

 

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

 

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

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted

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

 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...