I have an application that takes a long time to view the Print Preview on a particular user's computer. The rest of my users don't have a problem. I narrowed the problem down to the following line of code:
Dim XOffset As Single = CSng((e.PageSettings.PaperSize.Width - e.PageSettings.Margins.Right - e.PageSettings.Margins.Left) / 2 - StringSize.Width / 2)
which simply determines an X offset for a subsequent e.Drawstring that is centered.
On this particular user's computer, this line of code takes between 1 and 2 seconds to execute.
Another strange symptom is that once he prints the document, the print preview executes as fast as it should.
Can anyone shed some light on this mysterious behavior? Thanks!
View Complete Post