private void ExpondPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) { PanelStyle panelStyle = e.PanelStyle; if (panelStyle != this._panelStyle) { this.PanelStyle = panelStyle; } }
protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) { PanelStyle panelStyle = e.PanelStyle; this.Padding = new System.Windows.Forms.Padding(0); foreach (ExpondPanel expondPanel in this.ExpondPanels) { PropertyDescriptorCollection propertyDescriptorCollection = TypeDescriptor.GetProperties(expondPanel); if (propertyDescriptorCollection.Count > 0) { PropertyDescriptor propertyDescriptorPanelStyle = propertyDescriptorCollection["PanelStyle"]; if (propertyDescriptorPanelStyle != null) { propertyDescriptorPanelStyle.SetValue(expondPanel, panelStyle); } PropertyDescriptor propertyDescriptorLeft = propertyDescriptorCollection["Left"]; if (propertyDescriptorLeft != null) { propertyDescriptorLeft.SetValue(expondPanel, this.Padding.Left); } PropertyDescriptor propertyDescriptorWidth = propertyDescriptorCollection["Width"]; if (propertyDescriptorWidth != null) { propertyDescriptorWidth.SetValue( expondPanel, this.ClientRectangle.Width - this.Padding.Left - this.Padding.Right); } } } if (this.PanelStyleChanged != null) { this.PanelStyleChanged(sender, e); } }
protected override void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) { OnLayout(new LayoutEventArgs(this, null)); base.OnPanelStyleChanged(sender, e); }