Click here to Skip to main content
15,887,328 members
Home / Discussions / C#
   

C#

 
QuestionHow to connect a DTO to my table Pin
Exelioindia1-Aug-08 0:12
Exelioindia1-Aug-08 0:12 
AnswerRe: How to connect a DTO to my table Pin
leppie1-Aug-08 0:31
leppie1-Aug-08 0:31 
Questionexcel problem Pin
Mogaambo31-Jul-08 23:57
Mogaambo31-Jul-08 23:57 
AnswerRe: excel problem Pin
Paul Conrad2-Aug-08 10:31
professionalPaul Conrad2-Aug-08 10:31 
QuestionThreading problem Pin
MarkB77731-Jul-08 23:55
MarkB77731-Jul-08 23:55 
AnswerRe: Threading problem Pin
Mogaambo1-Aug-08 0:12
Mogaambo1-Aug-08 0:12 
AnswerRe: Threading problem Pin
Guffa1-Aug-08 2:44
Guffa1-Aug-08 2:44 
GeneralRe: Threading problem Pin
MarkB7771-Aug-08 2:56
MarkB7771-Aug-08 2:56 
Hi Guffa,

Thanks for you reply, I'm getting really stuck on this.

I've been trying to do what the guy above suggested with little success, here's where I'm at right now.

<br />
Form2 loadForm;<br />
<br />
       private delegate void TestDelegate();<br />
       public Form1()<br />
       {<br />
          InitializeComponent();<br />
<br />
          Thread t = new Thread(delegate() { <br />
              this.loadForm = new Form2(); <br />
          });<br />
          t.Start();<br />
<br />
          this.BeginInvoke(new TestDelegate(Openform));<br />
<br />
          Thread.Sleep(4000); // do stuff in main thread     <br />
<br />
          this.BeginInvoke(new TestDelegate(Closeform));<br />
<br />
          t.Abort();<br />
       }<br />
<br />
        private void Openform()<br />
        {<br />
            this.loadForm.ShowDialog();<br />
        }<br />
<br />
        private void Closeform()<br />
        {<br />
            this.loadForm.Dispose();<br />
        }<br />


This isnt even compiling at moment (Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.), so I'm getting pretty anoyed with the whole threading thing.

How else can you close a thread without calling Abort? Can you spot where i'm screwing up here?

Im trying to:

1. Create a (non-visible) window in thread 1
2. Show a loading window in thread 2 (form 2)
3. Do some loading in thread 1
4. Close the loading window in thread 2
5. Show the window in thread 1


Thanks heaps,


GeneralRe: Threading problem Pin
Mogaambo1-Aug-08 9:20
Mogaambo1-Aug-08 9:20 
GeneralRe: Threading problem Pin
MarkB7771-Aug-08 13:38
MarkB7771-Aug-08 13:38 
GeneralRe: Threading problem Pin
MarkB7771-Aug-08 14:46
MarkB7771-Aug-08 14:46 
QuestionSorting out the Data Pin
Hum Dum31-Jul-08 22:15
Hum Dum31-Jul-08 22:15 
AnswerRe: Sorting out the Data Pin
User 665831-Jul-08 22:45
User 665831-Jul-08 22:45 
Questionhow can i add the plus minus symbol in treeview in c# Pin
sanjeevmedhi31-Jul-08 22:05
sanjeevmedhi31-Jul-08 22:05 
AnswerRe: how can i add the plus minus symbol in treeview in c# Pin
Anurag Gandhi31-Jul-08 22:27
professionalAnurag Gandhi31-Jul-08 22:27 
GeneralRe: how can i add the plus minus symbol in treeview in c# Pin
sanjeevmedhi31-Jul-08 22:43
sanjeevmedhi31-Jul-08 22:43 
GeneralRe: how can i add the plus minus symbol in treeview in c# Pin
Mycroft Holmes31-Jul-08 22:49
professionalMycroft Holmes31-Jul-08 22:49 
AnswerRe: how can i add the plus minus symbol in treeview in c# Pin
PIEBALDconsult1-Aug-08 15:29
mvePIEBALDconsult1-Aug-08 15:29 
AnswerRe: how can i add the plus minus symbol in treeview in c# Pin
Medha jha2-Aug-08 2:57
Medha jha2-Aug-08 2:57 
QuestionFigured out why C# people are so finicy about layout Pin
Mycroft Holmes31-Jul-08 21:22
professionalMycroft Holmes31-Jul-08 21:22 
AnswerRe: Figured out why C# people are so finicy about layout Pin
Simon P Stevens31-Jul-08 21:47
Simon P Stevens31-Jul-08 21:47 
GeneralRe: Figured out why C# people are so finicy about layout Pin
Mycroft Holmes31-Jul-08 21:51
professionalMycroft Holmes31-Jul-08 21:51 
GeneralRe: Figured out why C# people are so finicy about layout Pin
stancrm31-Jul-08 22:26
stancrm31-Jul-08 22:26 
QuestionHow to Acess permission for SPSite Pin
manju#12331-Jul-08 19:34
manju#12331-Jul-08 19:34 
Questionmonitor Http traffic Pin
George_George31-Jul-08 19:01
George_George31-Jul-08 19:01 

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.