private void AdjustMainControl() { if (_context.ControlContainer == null) { return; } if (!(_context.ControlContainer is IAdjustableControl)) { return; } _context.ControlContainer.Invoke(new Action(() => { IAdjustableControl iAdjust = (IAdjustableControl)_context.ControlContainer; if (!String.IsNullOrEmpty(_body.PackageName)) { iAdjust.Caption = _body.PackageName; } iAdjust.Height = _body.Height; iAdjust.Width = _body.Width; })); }
private void SetFormFixedSize(int width, int height, string caption) { Form mainForm = FindForm(); if (mainForm == null || !(mainForm is IAdjustableControl)) { return; } IAdjustableControl iAdjust = (IAdjustableControl)mainForm; if (width > -1) { iAdjust.Width = width; } if (height > -1) { iAdjust.Height = height; } if (caption != null) { iAdjust.Caption = caption; } }