Esempio n. 1
0
        public AbstractControl(Control c, ResizableForm originalForm)
        {
            _parentForm = originalForm;

            _originalWidthWindow  = originalForm.Width;
            _originalHeightWindow = originalForm.Height;
            _originalFontControl  = c.Font.Size;

            if (c is DataGridView)
            {
                _originalFontCell = getFontCell(c);
            }

            _associatedControl   = c;
            _handle              = c.Handle;
            _originalHeightRatio = (double)c.Height / (double)originalForm.Height;
            _originalWidthRatio  = (double)c.Width / (double)originalForm.Width;

            _originalXRatio = (double)c.Location.X / (double)originalForm.Width;
            _originalYRatio = (double)c.Location.Y / (double)originalForm.Height;
        }
Esempio n. 2
0
 /// <summary>
 /// Default constructor - adds controls to the collection based on the controls on the form
 /// </summary>
 /// <param name="originalForm"></param>
 public AbstractControlCollection(ResizableForm originalForm)
 {
     _originalForm = originalForm;
     addControls(originalForm);
 }