2

i'm building a c# program for some company. When I test the program from the company's laptop it runs smooth and stable. but when i run the program on a microsoft terminal client, on a from with a listview that can have around 1000 rows and 5 or 6 columns it starts to slow way down until nothing responds and the terminal client is unusable. the code for the form is about 1000 lines.

What can i do to improve performance? is my code that inefficent or are there some limitations on mstsc that i have to take in considiration?

Daanvl
  • 608
  • 1
  • 9
  • 24
  • Stupid question, but where are you pulling that data from and is the MSTSC a 64bit Machine? i had a similar problem with an OLEDB Access and Excel Interop libraries running on a 64bit Terminal Server – Robbie Tapping Feb 23 '11 at 12:14
  • 1
    I've seen performances issues with msrdp when in the code of a form, there are calls to InvalidateCode, or controls with Paint event not properly configurated. is it your case ? can you post some code ? – Steve B Feb 23 '11 at 12:14
  • well 1000 lines of code can wreak havoc. what matters is what they do. – ukhardy Feb 23 '11 at 12:36
  • @Robbie Tapping, stupid because the MS in mstsc stands for microsoft and is therefore slow by default? datasource is ms sql 2005 database using stored procedures and generated datasets. @Steve B, I dont call or use InvalidateCode as far as i know. i've got 1 button with a overloaded paint event so I will test if ive got the same problem if I replace it with a standard button. @ukhardy not sure which parts are sowest. afer running dottrace only hotspots are main.run and form load event but nothing socking... – Daanvl Feb 23 '11 at 13:08

2 Answers2

0

You probably need to tune down the mstsc experience settings:

run MSTSC, then click on the options>> button. Goto the experience tab. Either change the connection speed or turn off some of the options yourself (particularly "menu and window animation")

You can save these settings as your default or save an rdp file for your particular connection so that you don't need to tweak these every time.

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
0

from this comment:" I've seen performances issues with msrdp when in the code of a form, there are calls to InvalidateCode, or controls with Paint event not properly configurated. is it your case ? can you post some code ? – Steve B"

I found that commenting this little piece of code, that was never intended to make the final release, but is temporary until the buttons from the designer are done, was the culprit. why i dont really get bet he! it works now!

private void terug_btn_Paint(object sender, PaintEventArgs e)
    {
       /* if (mf != null)
        {
            System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
            myGraphicsPath.AddLine(30, 0, 130, 0);
            myGraphicsPath.AddLine(130, 0, 130, 30);
            myGraphicsPath.AddLine(130, 30, 30, 30);
            myGraphicsPath.AddLine(30, 30, 0, 15);
            myGraphicsPath.AddLine(0, 15, 30, 0);
            terug_btn.Size = new System.Drawing.Size(135, 35);
            terug_btn.Region = new Region(myGraphicsPath);
            terug_btn.BackColor = Color.LightBlue;
        }*/
    }    
Daanvl
  • 608
  • 1
  • 9
  • 24