void Container_ControlAdded(object sender, ControlEventArgs e) { if (e.Control is ICustomSizableControl) { ICustomSizableControl iCsControl = (ICustomSizableControl)e.Control; if (iCsControl.WidthType == WidthMeasurement.Percent) { int pWidth = this.Width; int mWidth = (pWidth * iCsControl._Width) / 100; iCsControl.ShouldWidhtChangeFireSizeChange = false; e.Control.Width = mWidth; iCsControl.ShouldWidhtChangeFireSizeChange = true; } if (e.Control is EIBTabControl) { if (((EIBTabControl)e.Control).HeightType == HeightMeasurement.Percent) { int pHeight = this.Height; int mHeight = (pHeight * ((EIBTabControl)e.Control)._Height) / 100; ((EIBTabControl)e.Control).ShouldHeightChangeFireSizeChange = false; e.Control.Height = mHeight; ((EIBTabControl)e.Control).ShouldHeightChangeFireSizeChange = true; } } } }
public void adjustChildSize() { foreach (Control ctrl in this.Controls) { if (ctrl is ICustomSizableControl) { ICustomSizableControl iCsControl = (ICustomSizableControl)ctrl; if (iCsControl.WidthType == WidthMeasurement.Percent) { int pWidth = this.Width; int mWidth = (pWidth * iCsControl._Width) / 100; iCsControl.ShouldWidhtChangeFireSizeChange = false; ctrl.Width = mWidth; iCsControl.ShouldWidhtChangeFireSizeChange = true; } } else if (ctrl is EIBColumn) { EIBColumn col = (EIBColumn)ctrl; if (col.WidthType == WidthMeasurement.Pixel) { col.Width = col.WidthPixel; } } } }
void Container_ControlAdded(object sender, ControlEventArgs e) { if (e.Control is ICustomSizableControl) { ICustomSizableControl iCsControl = (ICustomSizableControl)e.Control; if (iCsControl.WidthType == WidthMeasurement.Percent) { int pWidth = this.Width; int mWidth = (pWidth * iCsControl._Width) / 100; iCsControl.ShouldWidhtChangeFireSizeChange = false; e.Control.Width = mWidth; iCsControl.ShouldWidhtChangeFireSizeChange = true; } } }