473,597 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Switch from "loading... " message to file name

There's a problem with what is displayed on a tab in my UI. At first,
it's a message, "loading... ". Then it should be replaced with the
actual file name on the tab.

Now the issue is that it takes a long time before the message
"loading... " is replaced by file name. In my debugger, the switch
between "loading... " and file name happens AFTER the last line of code
below:

void LoadReportFiles Worker_RunWorke rCompleted(obje ct sender,
RunWorkerComple tedEventArgs e)
{
this.tabControl .SuspendLayout( );

foreach(TabPage lPage in mDynamicPages)
{
this.tabControl .TabPages.Add(l Page);
}
this.tabControl .TabPages.Remov e(mLoadingPage) ;

this.tabControl .ResumeLayout(t rue);
}

When I hit F10 at "}", "loading... " is replaced by the file name.
Anyone can tell me why it takes long time to get the file name
displayed? Thanks!

Oct 1 '07 #1
2 1815
It might be that the UI thread must wait until it can actually refresh the
display.

Try to use:
Application.DoE vents();
right after you change the "loading... " caption to the actual filename.
HTH,
--
_____________
Adam Bieganski
http://godevelop.blogspot.com
"Curious" wrote:
There's a problem with what is displayed on a tab in my UI. At first,
it's a message, "loading... ". Then it should be replaced with the
actual file name on the tab.

Now the issue is that it takes a long time before the message
"loading... " is replaced by file name. In my debugger, the switch
between "loading... " and file name happens AFTER the last line of code
below:

void LoadReportFiles Worker_RunWorke rCompleted(obje ct sender,
RunWorkerComple tedEventArgs e)
{
this.tabControl .SuspendLayout( );

foreach(TabPage lPage in mDynamicPages)
{
this.tabControl .TabPages.Add(l Page);
}
this.tabControl .TabPages.Remov e(mLoadingPage) ;

this.tabControl .ResumeLayout(t rue);
}

When I hit F10 at "}", "loading... " is replaced by the file name.
Anyone can tell me why it takes long time to get the file name
displayed? Thanks!

Oct 1 '07 #2
Adam,

Thanks for respond! What does the UI thread wait for?

Oct 2 '07 #3

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

Similar topics

1
3375
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of six slideshows (rather than try to articulate, have a look here): http://www.slack.net/~stacey/stestbed/homejs.jsp Clicking any of the six blocks of text along the sides will begin a loop of the corresponding slideshow.
12
3216
by: junky_fellow | last post by:
Which is better using a switch statement or the if-then equivalent of switch ?
3
1530
by: ken | last post by:
any function is equal to "Switch" in Java with VB thank heaps
3
2125
by: Stimp | last post by:
I have two dropdowns that take a few seconds to populate (they are populated from a remote database, but the connection to the database is not the best). Is it possible to put a 'Loading...' message into the dropdownlist which will show by default, and then will disappear when the dropdown is populated? Maybe this could be done through javascript or otherwise?
2
2055
by: dana lees | last post by:
Hi, I am developing a c# asp.net application. I have a button which when i click on i open a pdf file. Since the pdf file is very very large i would like to open a window that says "Loading file..." and when the file is loaded, it will be loaded on the same page. How can i do that?
0
1361
by: Sudz28 | last post by:
Greetings! I am attempting to write a program that will allow a user to manipulate data read from a file, and am obviously in no way near finished. However, one problem I'm having that I don't understand is with my switch subroutine. In the below code, if I select "d" or anything that is an invalid response, it loops correctly back to the menu. However, if I attempt to insert (i), find (f), or delete (d) it loops back to the menu *but*...
2
2432
by: brianflannery | last post by:
Greetings! My situation is this. I currently have a database of which in a form displays jpeg pictures (one at a time) which are linked to the db and stored in a separate folder. I have set up a report with an image control do display/print 4 pictures on a page. When the report opens (in preview mode) the "loading image" dialog flashes 4 times (once for each picture) which isn't a huge deal, but is annoying. There have been several...
2
5346
by: =?Utf-8?B?Z2VvZmZh?= | last post by:
I cannot figure this out and would appreciate any help..... I have a datagrid view that displays the results from a Stored Procedure. it can take awhile to load..... the stored procedure fires when a Calendar is clicked. ( a date is part of the stored procedure ) How can i just show a new page or a pop-up that says "please wait" until the stored procedure has run and gotten all the data and the page is completely loaded? In all the...
7
11747
by: saurabhsingh | last post by:
Can anyone plz suggest any Idea that How to implement "loading message" in a site with master pages. I am having Default page which is master page enabled and it contains many Gridviews with database connection. This page is taking so much of time to load therefore I want to show loading message for this page only. Thanks in advance..
0
7885
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8272
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8031
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6687
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5428
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3882
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1233
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.