dcahrakos Posted September 12, 2005 Posted September 12, 2005 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? Quote
ZeroEffect Posted September 12, 2005 Posted September 12, 2005 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 Quote If you can't find it, Build It. There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10
MadMaxx Posted September 12, 2005 Posted September 12, 2005 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. Quote
dcahrakos Posted September 12, 2005 Author Posted September 12, 2005 Thank you madmaxx! that worked perfectly :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.