private void simpleButton3_Click(object sender, EventArgs e) { AddPanel = new XtraMessageBoxForm(); AddPanel.StartPosition = FormStartPosition.CenterScreen; BasicInfoElectricMeterAdd UserControl = new BasicInfoElectricMeterAdd(); AddPanel.Width = (UserControl.Width + 16); AddPanel.Height = UserControl.Height; AddPanel.Controls.Add(UserControl); AddPanel.Show(); }