473,394 Members | 2,063 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,394 software developers and data experts.

AfterLoad event?

I have a combobox that is populated with a pretty long list. I'd like to
reduce the form's load time by populating it on another thread after the form
is completely loaded and displayed. Any advice? What I need, I think, is
and AfterLoad event, but there isn't one.

Thanks,
--
Pat
Nov 21 '05 #1
5 3206
If you fire off the thread in the load event, the form will still load
without the combobox being populated. As the worker thread is processing
the main thread will continue to load up the form. Why won't this work?

Chris

"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
I have a combobox that is populated with a pretty long list. I'd like to
reduce the form's load time by populating it on another thread after the
form
is completely loaded and displayed. Any advice? What I need, I think, is
and AfterLoad event, but there isn't one.

Thanks,
--
Pat

Nov 21 '05 #2
Aside from LOOKING ugly (the form slowly loads as the combo is being
populated), it also prevents the user from using the form and its other
controls while the slow combo population continues. Perhaps I am
implementing the thread incorrectly, but doing it this way seems to ensure
that the Load event doesn't complete until the combo population thread
(spawned in the Load event) finishes.

"Chris, Master of All Things Insignifican" wrote:
If you fire off the thread in the load event, the form will still load
without the combobox being populated. As the worker thread is processing
the main thread will continue to load up the form. Why won't this work?

Chris

"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
I have a combobox that is populated with a pretty long list. I'd like to
reduce the form's load time by populating it on another thread after the
form
is completely loaded and displayed. Any advice? What I need, I think, is
and AfterLoad event, but there isn't one.

Thanks,
--
Pat


Nov 21 '05 #3
hmmm... I must admit I haven't done it myself. Try to sleep the thread for
10 seconds (Thread.Sleep(10000)) before starting to process. Does the
form finish loading then?

Are you the same guy that was trying to do this w/ a splash screen but the
form will still delay while it was binding?

Chris

"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:C5**********************************@microsof t.com...
Aside from LOOKING ugly (the form slowly loads as the combo is being
populated), it also prevents the user from using the form and its other
controls while the slow combo population continues. Perhaps I am
implementing the thread incorrectly, but doing it this way seems to ensure
that the Load event doesn't complete until the combo population thread
(spawned in the Load event) finishes.

"Chris, Master of All Things Insignifican" wrote:
If you fire off the thread in the load event, the form will still load
without the combobox being populated. As the worker thread is processing
the main thread will continue to load up the form. Why won't this work?

Chris

"pmcguire" <pm******@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
>I have a combobox that is populated with a pretty long list. I'd like
>to
> reduce the form's load time by populating it on another thread after
> the
> form
> is completely loaded and displayed. Any advice? What I need, I think,
> is
> and AfterLoad event, but there isn't one.
>
> Thanks,
> --
> Pat


Nov 21 '05 #4

"pmcguire" <pm******@discussions.microsoft.com> wrote
I have a combobox that is populated with a pretty long list. I'd like to
reduce the form's load time by populating it on another thread after the form
is completely loaded and displayed. Any advice? What I need, I think, is
and AfterLoad event, but there isn't one.


Instead of a second thread, how about adding a Timer, and starting it off
in your load event. If that Timer routine only loads 50-100 items each Tick,
then it would not adversely effect whatever else the user wants to do.

Unless your list has tens of thousands of items, the user would have to be
pretty quick to click on the combo box before it gets finished. (assuming
a real small timer interval...)

LFS
Nov 21 '05 #5
Pat,

I assume that you use a dataset or another collection.
Can you try to set the binding (datasource) after that you have filled that
collection?

And not in your designer.

I hope this helps?

Cor
Nov 21 '05 #6

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

Similar topics

2
by: Rich | last post by:
Is there any way I can check to see if a document is loaded into the iframe before I call onLoad (sort of an afterLoad). I'm loading up a page into an iframe. But because we use four servers...
2
by: Tamir Khason | last post by:
How can I catch the event of AfterLoad of the form? I want to do something AFTER the form loaded and shown to user, how to do this?
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
28
by: pamelafluente | last post by:
Ok I am trying to attach the handlers dynamically: (within a JS file: ) ------------------------------------------------------- window.onload = addCellHandlers(); function addCellHandlers()...
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: 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
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.