using DPumpHydr.WinFrmUI.Volute.ViewModel; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace DPumpHydr.WinFrmUI.Volute { public partial class ctrlSetOutflowStyle : ParasInfoBaseCtrl { public ctrlSetOutflowStyle() { InitializeComponent(); AddControlToPanel(_type, panel); BuildAllTips(); } int _type = 0; public void SetBindingData(eOutflowStyle eOutflowStyle) { if (eOutflowStyle == eOutflowStyle.中心出口_垂直法兰面流出) { _type = 0; panel.Controls.Clear(); AddControlToPanel(_type, panel); } if (eOutflowStyle == eOutflowStyle.侧面出口_曲线连接) { _type = 1; panel.Controls.Clear(); AddControlToPanel(_type, panel); } if (eOutflowStyle == eOutflowStyle.侧面出口_直线连接) { _type = 2; panel.Controls.Clear(); AddControlToPanel(_type, panel); } } private Control AddControlToPanel(int type, Panel panel) { Control newControl = null; switch (type) { case 0: newControl = new centralExitControl(); metroTile扩散管形状.BackgroundImage = GlobalResource.BuildImage("Central-exit.png", 878, 238); break; case 1: newControl = new sideCurveExitControl(); metroTile扩散管形状.BackgroundImage = GlobalResource.BuildImage("Side-exit-curve.png", 878, 238); break; case 2: newControl = new sidelineExitControl(); metroTile扩散管形状.BackgroundImage = GlobalResource.BuildImage("Side-exit-straight-line.png", 878, 238); break; default: throw new ArgumentException("Invalid control type"); } // 将控件添加到Panel中 panel.Controls.Add(newControl); newControl.Dock = DockStyle.Top; return newControl; } private void BuildAllTips() { metroToolTip第六步提示.SetToolTip(this.metroTile扩散管形状, "断面图"); } private void mBtn更新模型_Click(object sender, EventArgs e) { } } }