Skip to Content
Feb 04, 2021 at 09:14 AM

Viewer window grows on every printout?


Crystal, SP29.- The viewer is embedded in a windows form. The dimensions of said form is stored in and read from the registry. The general idea being that the users adjusts it to his or her screen and the size is saved for the next time.

When the form is destroyed:

int h = Size.Height;
int w = Size.Width;
Registry::SetValue("HKEY_CURRENT_USER\\Software\\Acme\\CRViewer", "h", h);
Registry::SetValue("HKEY_CURRENT_USER\\Software\\Acme\\CRViewer", "w", w);

When the form is created the values are read and:

this->ClientSize = System::Drawing::Size(w, h);

Here is the weird part: On my test machine, the width grows by 16 every time. Ie I read w=1430 and when I close the window, without touching it it is 1446. The height remains. But on another machine I see the same change in width, here it is 39?

Not sure if this is a Crystal or Windows issue?