Problem in mutile instances of a form in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leoiser
    New Member
    • Jul 2007
    • 41

    Problem in mutile instances of a form in C#

    Hi all,
    I am creating multiple instance of a Form(let it be Form1).Actually Form1 having 4 panel.Each one having diffrent task.One panel showing picture,another calling web service & displying data.In Form1 I am having a control(like marquee,text is drawing using timer).But running different instances of form marquee is stopping for a while.Calling webservice cause the problem.In each form instances I ve the marquee.If I run first instance have the picture and marquee,second instance will access web service,so that time,both forms marquee is stopping. What I ve to do to solve this issue.Thanks in advance.

    With reagrds,
    leo
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    Hai,
    Make the process which has high load in a seperate thread. I Mean that web service call.

    Originally posted by leoiser
    Hi all,
    I am creating multiple instance of a Form(let it be Form1).Actually Form1 having 4 panel.Each one having diffrent task.One panel showing picture,another calling web service & displying data.In Form1 I am having a control(like marquee,text is drawing using timer).But running different instances of form marquee is stopping for a while.Calling webservice cause the problem.In each form instances I ve the marquee.If I run first instance have the picture and marquee,second instance will access web service,so that time,both forms marquee is stopping. What I ve to do to solve this issue.Thanks in advance.

    With reagrds,
    leo

    Comment

    • leoiser
      New Member
      • Jul 2007
      • 41

      #3
      For the marquee, I created a another class library project and using system.timer.,i nterval is 15

      in my form (form1) in each 10 seconds my panel is refreshing using System.Forms.Ti mer,
      so while refreshing it will call the webservie & displaying the values to the lables.
      I noticed that while displaying to the lablel the delay is occuring.Here I am giving the
      sample code(logic).Ple ase advice.Thanks

      Private void LoadFromWS()
      {
      //Getting data from web service & storing it in array
      ws.display obj = new ws.display();
      Arrshows = obj.getData(Dat eTime.Now.ToStr ing("MM/dd/yyyy hh:mm:ss tt"));
      }

      Private void display()
      {
      //Displaying 5 at a time for 10 seconds
      //Using system.Forms.Ti mer

      lable1.text = Arrshows[intIndex];

      lable2.text = Arrshows[++intIndex];

      lable3.text = Arrshows[++intIndex];

      lable4.text = Arrshows[++intIndex];

      lable5.text = Arrshows[++intIndex];
      //checking intIndex > Arrshows.lenght () then intIndex =0 & return;
      }

      private timer1_tick()
      {
      display();
      }

      Please advice with the code.sorry I am not good in threading....Th anks

      leo

      Comment

      Working...