Click here to Skip to main content
14,666,245 members
Home » Discussions » C#
   

C#

 
Questionexcel problem Pin
Mogaambo31-Jul-08 23:57
MemberMogaambo31-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
MemberMarkB77731-Jul-08 23:55 
AnswerRe: Threading problem Pin
Mogaambo1-Aug-08 0:12
MemberMogaambo1-Aug-08 0:12 
AnswerRe: Threading problem Pin
Guffa1-Aug-08 2:44
MemberGuffa1-Aug-08 2:44 
GeneralRe: Threading problem Pin
MarkB7771-Aug-08 2:56
MemberMarkB7771-Aug-08 2:56 
GeneralRe: Threading problem Pin
Mogaambo1-Aug-08 9:20
MemberMogaambo1-Aug-08 9:20 
GeneralRe: Threading problem Pin
MarkB7771-Aug-08 13:38
MemberMarkB7771-Aug-08 13:38 
Hey thanks for your help.

It works fine if i'm doing no loading after the thread start command, but if I add the PopulateTree call (or just a Thread.Sleep()), it gives me a InvalidOperationException (Invoke or BeginInvoke cannot be called on a control until the window handle has been created).

Here's what i've got:

<br />
        public PALImporter()<br />
        {<br />
                this.loadWindow = new LoadingWindow();<br />
                Thread loadingThread = new Thread(new ThreadStart(this.BeginLoad));<br />
                loadingThread.Start();<br />
<br />
                PopulateTree(new SqlCommand("SELECT * FROM Users", myConnection), (int)Tables.Users);<br />
                // more loading etc etc.....<br />
        }<br />
        }<br />
<br />
        private void BeginLoad()<br />
        {<br />
            this.BeginInvoke(new LoadDelegate(OpenLoadForm));<br />
<br />
            Thread.Sleep(2000);<br />
<br />
            this.BeginInvoke(new LoadDelegate(CloseLoadForm));<br />
        }<br />
<br />
        private void OpenLoadForm()<br />
        {<br />
            this.loadWindow.ShowDialog();<br />
        }<br />
<br />
        private void CloseLoadForm()<br />
        {<br />
            this.loadWindow.Dispose();<br />
        }<br />



GeneralRe: Threading problem Pin
MarkB7771-Aug-08 14:46
MemberMarkB7771-Aug-08 14:46 
QuestionSorting out the Data Pin
Hum Dum31-Jul-08 22:15
MemberHum Dum31-Jul-08 22:15 
AnswerRe: Sorting out the Data Pin
User 665831-Jul-08 22:45
MemberUser 665831-Jul-08 22:45 
Questionhow can i add the plus minus symbol in treeview in c# Pin
sanjeevmedhi31-Jul-08 22:05
Membersanjeevmedhi31-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
Membersanjeevmedhi31-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
professionalPIEBALDconsult1-Aug-08 15:29 
AnswerRe: how can i add the plus minus symbol in treeview in c# Pin
Medha jha2-Aug-08 2:57
MemberMedha 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
MemberSimon 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
Memberstancrm31-Jul-08 22:26 
QuestionHow to Acess permission for SPSite Pin
manju#12331-Jul-08 19:34
Membermanju#12331-Jul-08 19:34 
Questionmonitor Http traffic Pin
George_George31-Jul-08 19:01
MemberGeorge_George31-Jul-08 19:01 
AnswerRe: monitor Http traffic Pin
stancrm31-Jul-08 21:36
Memberstancrm31-Jul-08 21:36 
GeneralRe: monitor Http traffic Pin
George_George3-Aug-08 17:37
MemberGeorge_George3-Aug-08 17:37 

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.