473,385 Members | 1,427 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.

OnLoad

Hi,

I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update the
progress bar as it does. The only event I can find to
initiate my code is in the form's Form_Load event, but
when this code is executed, the form has not yet been
displayed.

I need to run some code once the form has been displayed,
how do I do this?

Burns
Nov 15 '05 #1
6 7710
"Burns" <an*******@discussions.microsoft.com> wrote:
I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update
the progress bar as it does.


If you can split the task into discrete chunks, a Timer control would be
appropriate.

P.
Nov 15 '05 #2
SP
Hi

you can not use the "Load" event of the form here, since a form gets loaded only after executing all the code in the "Load" event. The solution to your problem is to attach a new event handler to the "Paint" event of the progress bar control. And use the graphics object of the "PaintEventArgs" to redraw the progress bar. You can fire the "Paint" event whenever the status on the form has changed to reflect that on the progress bar.

In case you are not using the progress bar control, you can use the "Paint" event of the form.
Nov 15 '05 #3
OnShow

-vJ
"Burns" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hi,

I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update the
progress bar as it does. The only event I can find to
initiate my code is in the form's Form_Load event, but
when this code is executed, the form has not yet been
displayed.

I need to run some code once the form has been displayed,
how do I do this?

Burns

Nov 15 '05 #4
Sorry.. a little out of touch after a long vacation.

It's VisibleChanged event!

-vJ

"Vijaye Raji" <no************@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
OnShow

-vJ
"Burns" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hi,

I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update the
progress bar as it does. The only event I can find to
initiate my code is in the form's Form_Load event, but
when this code is executed, the form has not yet been
displayed.

I need to run some code once the form has been displayed,
how do I do this?

Burns


Nov 15 '05 #5
OnShow

-vJ
"Burns" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hi,

I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update the
progress bar as it does. The only event I can find to
initiate my code is in the form's Form_Load event, but
when this code is executed, the form has not yet been
displayed.

I need to run some code once the form has been displayed,
how do I do this?

Burns

Nov 15 '05 #6
Sorry.. a little out of touch after a long vacation.

It's VisibleChanged event!

-vJ

"Vijaye Raji" <no************@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
OnShow

-vJ
"Burns" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hi,

I've built a form with a progress bar on in C#, I want
some code to run once the form is opened and update the
progress bar as it does. The only event I can find to
initiate my code is in the form's Form_Load event, but
when this code is executed, the form has not yet been
displayed.

I need to run some code once the form has been displayed,
how do I do this?

Burns


Nov 15 '05 #7

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

Similar topics

4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
6
by: Brian | last post by:
Hi everyone, I'm writing a function (in javascript) that needs to do one thing if the page has not loaded, and another (different) thing if the page has already loaded. I'm looking for a way...
4
by: David Virgil Hobbs | last post by:
My web host inserts banner ads into my html pages. The javascript in these banner ads interferes with the onload triggered javascript functions in my pages. Whether I trigger my javascript...
10
by: berg | last post by:
I'm trying to use the onload event to load a series of urls. What I find is that the onload function is only called one time no matter how large the array. Here is the onload function. var...
3
by: Liming | last post by:
Hi, Here is my situation. I have a textarea on the page. When the page loads, I need it to have some default text (which will be generated dynamically) so I did something like this ...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
4
by: PJ6 | last post by:
Say I have serveral controls, all of which need to emit clientside script to execute on page load. They can't emit to OnLoad = <functionname> because then only one of the scripts will get executed....
3
by: Andrew Poulos | last post by:
I've been asked to add some additional code to HTML that get generated by a 3rd party program. Currently the code that gets generated already includes a window.onload = init; The program lets...
20
by: Mark Anderson | last post by:
Hi, I have this in an external JS library: ///////////////////////// function addMyEvent(){ var obj; if(document.attachEvent) { obj = document.getElementsByTagName('img'); for...
1
by: zebra242 | last post by:
I'm working to get the onLoad function of a javascript to work: the script allows form buttons in html to refer to labeled frames in flash. Which works fine. Now I want to add onLoad...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...
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...

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.