473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Refresh Listbox1 items

I have a Listbox1 in the main form and I can add listbox1 items in the
parent form. But when I close the parent form Listbox1 in the main form does
not get refresh. I need to re-open the app.

Any idea on how to refresh items in the main from from a parent form without
opening the app.

-Thanks

Sep 7 '08 #1
5 2442
On Sep 7, 5:30 am, "BlackBox" <replymeo...@hotmail.comwrote:
I have a Listbox1 in the main form and I can add listbox1 items in the
parent form. But when I close the parent form Listbox1 in the main form does
not get refresh. I need to re-open the app.

Any idea on how to refresh items in the main from from a parent form without
opening the app.

-Thanks
Use "<form>.Refresh" for other forms and "Me.Refresh" for current
form.

Or depending on your wish, you can try Listbox1.Refresh method.

Onur Güzel
Sep 7 '08 #2
Well I forgot to mention the listbox1 should get refreshed after I close the
parent window.

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:03**********************************@m73g2000 hsh.googlegroups.com...
On Sep 7, 5:30 am, "BlackBox" <replymeo...@hotmail.comwrote:
>I have a Listbox1 in the main form and I can add listbox1 items in the
parent form. But when I close the parent form Listbox1 in the main form
does
not get refresh. I need to re-open the app.

Any idea on how to refresh items in the main from from a parent form
without
opening the app.

-Thanks

Use "<form>.Refresh" for other forms and "Me.Refresh" for current
form.

Or depending on your wish, you can try Listbox1.Refresh method.

Onur Güzel
Sep 7 '08 #3
On Sep 7, 1:47 pm, "BlackBox" <replymeo...@hotmail.comwrote:
Well I forgot to mention the listbox1 should get refreshed after I close the
parent window.

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:03**********************************@m73g2000 hsh.googlegroups.com...
On Sep 7, 5:30 am, "BlackBox" <replymeo...@hotmail.comwrote:
I have a Listbox1 in the main form and I can add listbox1 items in the
parent form. But when I close the parent form Listbox1 in the main form
does
not get refresh. I need to re-open the app.
Any idea on how to refresh items in the main from from a parent form
without
opening the app.
-Thanks
Use "<form>.Refresh" for other forms and "Me.Refresh" for current
form.
Or depending on your wish, you can try Listbox1.Refresh method.
Onur Güzel
Then, IIUC, you need to handle FormClosed event which is raised after
form is closed. But, curious, why do you mean by "refreshing"? Adding
new items or using Refresh method which redraws the control? Because
as you re-open your form, it may be needless to call Refresh method
based on your implementation.

Thanks,

Onur Güzel
Sep 7 '08 #4
Well here is the explanation -
I have a listbox1 in main form containing product lists. Now I allow the
user to add new products in the second form and when they close the second
form - the main form should update the new product items in the Listbox1
under main form. And I don't know what is the best way to do it.

Thanks

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:96**********************************@j22g2000 hsf.googlegroups.com...
On Sep 7, 1:47 pm, "BlackBox" <replymeo...@hotmail.comwrote:
Well I forgot to mention the listbox1 should get refreshed after I close
the
parent window.

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:03**********************************@m73g2000 hsh.googlegroups.com...
On Sep 7, 5:30 am, "BlackBox" <replymeo...@hotmail.comwrote:
I have a Listbox1 in the main form and I can add listbox1 items in the
parent form. But when I close the parent form Listbox1 in the main form
does
not get refresh. I need to re-open the app.
Any idea on how to refresh items in the main from from a parent form
without
opening the app.
-Thanks
Use "<form>.Refresh" for other forms and "Me.Refresh" for current
form.
Or depending on your wish, you can try Listbox1.Refresh method.
Onur Güzel
Then, IIUC, you need to handle FormClosed event which is raised after
form is closed. But, curious, why do you mean by "refreshing"? Adding
new items or using Refresh method which redraws the control? Because
as you re-open your form, it may be needless to call Refresh method
based on your implementation.

Thanks,

Onur Güzel
Sep 8 '08 #5
On Sep 8, 3:44 am, "IndiDeveloper" <replymeo...@hotmail.comwrote:
Well here is the explanation -
I have a listbox1 in main form containing product lists. Now I allow the
user to add new products in the second form and when they close the second
form - the main form should update the new product items in the Listbox1
under main form. And I don't know what is the best way to do it.

Thanks

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:96**********************************@j22g2000 hsf.googlegroups.com...
On Sep 7, 1:47 pm, "BlackBox" <replymeo...@hotmail.comwrote:
Well I forgot to mention the listbox1 should get refreshed after I close
the
parent window.
"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message
news:03**********************************@m73g2000 hsh.googlegroups.com....
On Sep 7, 5:30 am, "BlackBox" <replymeo...@hotmail.comwrote:
>I have a Listbox1 in the main form and I can add listbox1 items in the
>parent form. But when I close the parent form Listbox1 in the main form
>does
>not get refresh. I need to re-open the app.
>Any idea on how to refresh items in the main from from a parent form
>without
>opening the app.
>-Thanks
Use "<form>.Refresh" for other forms and "Me.Refresh" for current
form.
Or depending on your wish, you can try Listbox1.Refresh method.
Onur Güzel

Then, IIUC, you need to handle FormClosed event which is raised after
form is closed. But, curious, why do you mean by "refreshing"? Adding
new items or using Refresh method which redraws the control? Because
as you re-open your form, it may be needless to call Refresh method
based on your implementation.

Thanks,

Onur Güzel
Well, then you need to add new items of second form's listbox
items(items which will be added to the entire product list) into main
form's listbox. So, you'd better handle FormClosing event of second
form and add all the items to the main form's listbox before second
form is closed, as follows:

'----Begin------
'Add second form's listbox items into entire list
'which are located in mainform's listbox.
'Put the code in your second form
Private Sub SecondForm_FormClosing(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.FormClosingEventArgs) _
Handles MyBase.FormClosing

MainForm.mainforms_listbox.Items.AddRange(Me.secon dforms_listbox.Items)

End Sub
'----End------

...where "MainForm" is the name of your main form, "mainforms_listbox"
is the name of your main form's listbox, "second_form" is the name of
your second form and "secondforms_listbox" is the name of your second
form's listbox.
Hope this helps,

Onur Güzel

Sep 8 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Amy Snyder | last post by:
Probably a very simple questions but... I am playing around with ASP.NET for the first time and put together my first page that has a few text boxes and listboxes. I like the way values are...
4
by: Bilo | last post by:
I dont know what i am doing false. the code : private void button2_Click(object sender, System.EventArgs e) { foreach (string filename in listBox1.SelectedItems)...
1
by: Tariq | last post by:
Hi, I have a list box that is bound to an arraylist, but when the data changes the listbox does not refresh. ----------------------------------------------------------------------------- al =...
1
by: JBD | last post by:
Hi, I have a button that fires the below sub routine. This works fine if the user clicks the button as they are supposed to, even if they click it repeatedly. However, if you click "refresh" on...
2
by: Jan | last post by:
Hi there, I'm a newbee in vb.net with the following problem: 4444528; Baltic Birch; 16.20; 0 I have more of these lines in a ListBox1. Now I want to change the latest 0 with the...
6
by: Rémi Lavoie | last post by:
Hi, I'm adding items in a listbox automatically. When my listbox is full, the scrollbar appears but i can't set my listbox to see the new items. I would like that my scrollbar follow the new...
2
by: Bernie Yaeger | last post by:
I want to open a window with a listbox (custlist) in it, but I want to automatically select a certain item in the listbox, and have it be the correct selectedindex. The call to open this window...
8
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the...
0
by: Franchdream | last post by:
I use the AccessDataSource to fill the data for Listbox. I doesn't use the DataSet. But when I check button to update the database, the Listbox can't fresh the data at onece. And the Code which...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.