473,473 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Populate a listbox after completely loading a form

I have a very simple application, consisting of a form and a listbox on it.
I would like automatically to populate the listbox after the form is loaded
and displayed, not using a button.
But if I put my code in Load event, the form is not shown until after the
listbox is populated.
Because populating the listbox is not fast in my case, I also would like the
list items to be visible after I insert them one by one, not at the end when
the entire process is finished.

How can I do that?

Thanks,
Yakimo
Nov 16 '05 #1
2 3732
Yakimo wrote:
I have a very simple application, consisting of a form and a listbox on it.
I would like automatically to populate the listbox after the form is loaded
and displayed, not using a button.
But if I put my code in Load event, the form is not shown until after the
listbox is populated.
Because populating the listbox is not fast in my case, I also would like the
list items to be visible after I insert them one by one, not at the end when
the entire process is finished.

How can I do that?


Use the Form.Activated event.
Nov 16 '05 #2
"Yakimo" <ty******@fullof.spams> wrote in message
news:e%****************@TK2MSFTNGP09.phx.gbl...
I have a very simple application, consisting of a form and a listbox on it. I would like automatically to populate the listbox after the form is loaded and displayed, not using a button.
But if I put my code in Load event, the form is not shown until after the
listbox is populated.
Because populating the listbox is not fast in my case, I also would like the list items to be visible after I insert them one by one, not at the end when the entire process is finished.

How can I do that?


You can solve the first problem by using a timer. Put the code that
populates the form in the Tick event handler. The first thing the code
should do is disable the timer, so that it does not fire more than once.

To solve the second problem, use a background thread. Needs careful coding
but there are code samples on the web.

Tim

IBM's take on web services and SOA:
http://www.itwriting.com/ibmwebservices.php
Nov 16 '05 #3

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

Similar topics

2
by: James Goodman | last post by:
I have a listbox named sub1 on an asp page. I need to fill this list with values from a table. These are selected based upon the selection of a value/s in another listbox. It was suggested that I...
2
by: Wishing I was skiing mom | last post by:
Newbie to VB .NET. My solution contains an item maintenance screen, one of the fields on the screen is an item status, this field is defined as a listbox. The listbox item property contains a...
1
by: John M | last post by:
I have 1st list box from table Grain 2nd list box from related table Varieties, related by GrainID At the moment Grain listbox is on its own form and Variety listbox is on subform in Grain form....
2
by: Yakimo | last post by:
I have a very simple application, consisting of a form and a listbox on it. I would like automatically to populate the listbox after the form is loaded and displayed, not using a button. But if I...
1
by: Devin Wood | last post by:
Hi, I have a page with a ListBox on it, and It's also have a some buttons to populate the ListBox by using JavaScript. I have no problem with populate the listbox using JavaScript. But when the...
1
by: Spock | last post by:
Hi. I have a form with a listbox and a few label fields all bound to a dataset. When i navigate the listbox the labels change accordingly. so far everything works good. I made a button to...
5
by: Arpan | last post by:
In order to populate any server control with data dynamically, is it ALWAYS NECESSARY to either BIND the DataSource to that server control or call the DataBind method of that server control? For...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.