return new Size(bounds.Right - bounds.Left + (int)(form.MyAutoScaleFactor.Width * 4), bounds.Bottom - bounds.Top);
but i get warning of
Warning 2 Accessing a member on 'NonFullscreen.MessageBoxForm.MyAutoScaleFactor' may cause a runtime exception because it is a field of a marshal-by-reference class C:\Projekti\Skladiscenje\Skladiscenje\NonFullscreen\MessageBoxForm.cs 244 60 NonFullscreen
how can i prevent runtime exception?
According to the docs for that warning, something like this may help (by extracting to a local variable first):