Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: & missing Pin
Moreno Airoldi3-Jun-09 1:24
Moreno Airoldi3-Jun-09 1:24 
QuestionSybase connection error... Pin
The_Collector3-Jun-09 0:24
The_Collector3-Jun-09 0:24 
AnswerRe: Sybase connection error... Pin
Moreno Airoldi3-Jun-09 0:40
Moreno Airoldi3-Jun-09 0:40 
GeneralRe: Sybase connection error... Pin
The_Collector3-Jun-09 4:00
The_Collector3-Jun-09 4:00 
GeneralRe: Sybase connection error... Pin
Moreno Airoldi3-Jun-09 5:21
Moreno Airoldi3-Jun-09 5:21 
GeneralRe: Sybase connection error... Pin
The_Collector3-Jun-09 14:36
The_Collector3-Jun-09 14:36 
QuestionException when making a control button Pin
gwithey3-Jun-09 0:08
gwithey3-Jun-09 0:08 
AnswerRe: Exception when making a control button Pin
Moreno Airoldi3-Jun-09 0:21
Moreno Airoldi3-Jun-09 0:21 
AnswerRe: Exception when making a control button Pin
Rob Philpott3-Jun-09 0:21
Rob Philpott3-Jun-09 0:21 
GeneralRe: Exception when making a control button Pin
gwithey3-Jun-09 0:56
gwithey3-Jun-09 0:56 
QuestionHow to encapsulate C++ in C# Pin
sbotz2-Jun-09 23:55
sbotz2-Jun-09 23:55 
AnswerRe: How to encapsulate C++ in C# Pin
Simon P Stevens3-Jun-09 1:02
Simon P Stevens3-Jun-09 1:02 
GeneralRe: How to encapsulate C++ in C# Pin
sbotz3-Jun-09 1:20
sbotz3-Jun-09 1:20 
GeneralRe: How to encapsulate C++ in C# Pin
Simon P Stevens3-Jun-09 3:16
Simon P Stevens3-Jun-09 3:16 
GeneralRe: How to encapsulate C++ in C# Pin
Dave Kreskowiak3-Jun-09 3:24
mveDave Kreskowiak3-Jun-09 3:24 
Questioncross thread events Pin
spiritboy2-Jun-09 23:55
spiritboy2-Jun-09 23:55 
AnswerRe: cross thread events Pin
Moreno Airoldi3-Jun-09 0:15
Moreno Airoldi3-Jun-09 0:15 
I had a look at your original post, and I think it will make it easier for you if you change your design a bit.

If I uderstand correctly, you want to show your main form, and then show a splash screen right on top of it with a progress bar showing the advancement of some intialization work carried out by a background thread.

Try this way:

- Use the standard Main() for a Windows Form application, which will just run the app showing the main form (Form1).

- In the Shown() event handler for Form1, show the splash screen (Form2), create your thread, link its events to functions in Form2 and start the thread.

- When you get an event from the thread, use Invoke() to update the progress bar. As others told you, this is the best way to do that.

- If you feel unsure about Invoke(), set up a thread-safe (using lock) property in Form2 and update it from the events handlers, then have a timer check it and update your progress bar. This is not good design, but it will work.

I hope I got your problem correctly, and hope this can help you. Smile | :)

2+2=5 for very large amounts of 2
(always loved that one hehe!)

GeneralRe: cross thread events Pin
harold aptroot3-Jun-09 0:22
harold aptroot3-Jun-09 0:22 
AnswerRe: cross thread events Pin
S. Senthil Kumar3-Jun-09 9:12
S. Senthil Kumar3-Jun-09 9:12 
QuestionProblem with multiple versions of references Pin
vijaylumar2-Jun-09 23:47
vijaylumar2-Jun-09 23:47 
Questionmysql connect + retrieving record Pin
benjamin yap2-Jun-09 23:40
benjamin yap2-Jun-09 23:40 
AnswerRe: mysql connect + retrieving record Pin
Blue_Boy2-Jun-09 23:52
Blue_Boy2-Jun-09 23:52 
AnswerRe: mysql connect + retrieving record Pin
Moreno Airoldi2-Jun-09 23:58
Moreno Airoldi2-Jun-09 23:58 
GeneralRe: mysql connect + retrieving record Pin
benjamin yap3-Jun-09 0:01
benjamin yap3-Jun-09 0:01 
GeneralRe: mysql connect + retrieving record Pin
benjamin yap3-Jun-09 0:07
benjamin yap3-Jun-09 0: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.