Click here to Skip to main content
15,908,843 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to show "please wait" during a long time process? Pin
Julianne_juju26-Sep-05 9:46
Julianne_juju26-Sep-05 9:46 
AnswerRe: How to show "please wait" during a long time process? Pin
26-Sep-05 11:58
suss26-Sep-05 11:58 
Hi, i just had the same "problem" (it isn't a prob at all).
I'm a bit confuse you just said "page" and that makes me think it could be a web page, i use this way for winforms apps but it should work anyway. You need to handle the task in a different Thread so you can do what ever you want while your system is doing the task.
To do this just add a reference to "using System.Threading" and add the following function:

public void StartMyTask()
{
Thread MyThread = new Thread(new ThreadStart(taskmethod));
MyThread.IsBackground = true;
MyThread.ApartmentState = ApartmentState.STA;
ssThread.Start();
}

Note that taskmethod must not include (). When you call StartMyTask() it will start taskmethod() in a new thread so your system do not wait until the task is performed to show the message or whatever. I assume in this example that the task is all in one method.

Hope it work.

Heinz

-- modified at 17:59 Monday 26th September, 2005
GeneralRe: How to show Pin
Heinz_26-Sep-05 12:03
Heinz_26-Sep-05 12:03 
GeneralRe: How to show Pin
Dave Kreskowiak26-Sep-05 12:11
mveDave Kreskowiak26-Sep-05 12:11 
GeneralRe: How to show Pin
26-Sep-05 12:22
suss26-Sep-05 12:22 
QuestionC# newbee Pin
Ann6626-Sep-05 8:15
sussAnn6626-Sep-05 8:15 
AnswerRe: C# newbee Pin
Mohamad Al Husseiny26-Sep-05 8:25
Mohamad Al Husseiny26-Sep-05 8:25 
GeneralRe: C# newbee Pin
Ann6626-Sep-05 8:31
sussAnn6626-Sep-05 8:31 
GeneralRe: C# newbee Pin
Mohamad Al Husseiny26-Sep-05 8:35
Mohamad Al Husseiny26-Sep-05 8:35 
GeneralRe: C# newbee Pin
Ann6626-Sep-05 9:48
sussAnn6626-Sep-05 9:48 
GeneralRe: C# newbee Pin
Dan Neely26-Sep-05 10:10
Dan Neely26-Sep-05 10:10 
AnswerRe: C# newbee Pin
Dave Kreskowiak26-Sep-05 9:18
mveDave Kreskowiak26-Sep-05 9:18 
AnswerRe: C# newbee Pin
Ann6626-Sep-05 10:15
sussAnn6626-Sep-05 10:15 
AnswerRe: C# newbee Pin
Heath Stewart26-Sep-05 11:44
protectorHeath Stewart26-Sep-05 11:44 
AnswerRe: C# newbee Pin
Heinz_26-Sep-05 12:19
Heinz_26-Sep-05 12:19 
QuestionAdding columns to CrystalReport Pin
zaboboa26-Sep-05 6:13
zaboboa26-Sep-05 6:13 
QuestionReprtDocument Exception need HELP Pin
zaboboa26-Sep-05 5:03
zaboboa26-Sep-05 5:03 
QuestionDataGrid + vertical Scrollbar Pin
totig26-Sep-05 2:51
totig26-Sep-05 2:51 
AnswerRe: DataGrid + vertical Scrollbar Pin
Wjousts26-Sep-05 2:59
Wjousts26-Sep-05 2:59 
GeneralRe: DataGrid + vertical Scrollbar Pin
totig26-Sep-05 3:36
totig26-Sep-05 3:36 
GeneralRe: DataGrid + vertical Scrollbar Pin
Wjousts26-Sep-05 9:13
Wjousts26-Sep-05 9:13 
QuestionTreeview issues Pin
PHDENG8126-Sep-05 2:45
PHDENG8126-Sep-05 2:45 
AnswerRe: Treeview issues Pin
munawarhussain26-Sep-05 6:17
munawarhussain26-Sep-05 6:17 
GeneralRe: Treeview issues Pin
PHDENG8126-Sep-05 6:42
PHDENG8126-Sep-05 6:42 
GeneralRe: Treeview issues Pin
Wjousts26-Sep-05 8:07
Wjousts26-Sep-05 8:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.