views:

225

answers:

1

dear all;

thnx for all your replays .. i tried your options and i want to ask if that was right and is are the 2 threads working in paralel or not..

and here is my code :

// in the Form.Load()

        Timer1.Enabled = true;
        Timer1.Start();

        if (InvokeRequired)
        {
            Invoke(new GetFromServerHandler(GetFromServer));
            Invoke(new GetFromPCHandler(GetFromPC));
        }
        else
        {
            ServerQuranTreeView.Nodes.Clear();
            GetFromServer();
            GetFromPC();
        }

// another 2 functions, which are the delegate and the function (GetFromServer) and (GetFromPC)

    private delegate void GetFromServerHandler(); 
    private void GetFromServer()
    {
    }

    private delegate void GetFromPCHandler(); 
    private void GetFromPC()
    {
    }

// now the application takes a few second to start up (and i explained that it required this time to get data from server)

is that right, or i missed somthing ?

thnx in advance

+1  A: 

I really dont understand what you are trying to do here :S Please clarify. Atleast I can say that you would normally not need invoke in a Form_Load handler.

And you really have to fix the tags of your post, they should be descriptive for your question, ie: something like c# threading invoke.

You have to help us help you. And by the way, if you already asked a question on this topic you could atleast include a link to that question.

sindre j