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 : UserControl { public ctrlSetOutflowStyle() { InitializeComponent(); Tips(); addimage(); } /// /// 图片 /// /// 文件夹路径(编译路径下的) /// 文件名 /// private System.Drawing.Image Icon(string path, string filename) { System.Drawing.Image thumbnail = AssembledPath(path, filename).GetThumbnailImage(878, 538, () => false, IntPtr.Zero); return thumbnail; } /// /// 路径、文件名拼接 /// /// 路径 /// 文件名 /// private System.Drawing.Image AssembledPath(string path, string filename) { if (path == null && filename == null) { return null; } string fullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path, filename); System.Drawing.Image image = System.Drawing.Image.FromFile(fullPath); return image; } private void addimage() { string ResourcesPath = @"Data\MainForm\Icons"; metroTile扩散管形状.BackgroundImage = Icon(ResourcesPath, "kuosanguan.png"); } private void Tips() { metroToolTip第六步提示.SetToolTip(this.metroTile扩散管形状, "断面图"); metroToolTip第六步提示.SetToolTip(this.mlTextBoxEdit扩散长度, "蜗室中液体流动\n路径的扩展或扩\n散程度"); metroToolTip第六步提示.SetToolTip(this.mlTextBoxEdit中心距离, "中心距离 解释"); metroToolTip第六步提示.SetToolTip(this.crownLabel出口, "出口 解释"); metroToolTip第六步提示.SetToolTip(this.dungeonNumeric出口, "出口 解释"); metroToolTip第六步提示.SetToolTip(this.metroTrackBar出口, "出口 解释"); metroToolTip第六步提示.SetToolTip(this.crownLabel第八端面, "第八断面 解释"); metroToolTip第六步提示.SetToolTip(this.dungeonNumeric第八端面, "第八端面 解释"); metroToolTip第六步提示.SetToolTip(this.metroTrackBar第八端面, "第八端面 解释"); } private void metroTrackBar第八端面_Scroll(object sender) { dungeonNumeric第八端面.Value = metroTrackBar第八端面.Value; } private void metroTrackBar出口_Scroll(object sender) { dungeonNumeric出口.Value = metroTrackBar出口.Value; } private void dungeonNumeric出口_Leave(object sender, EventArgs e) { metroTrackBar出口.Value = (int)(dungeonNumeric出口.Value); } private void dungeonNumeric第八端面_Leave(object sender, EventArgs e) { metroTrackBar第八端面.Value = (int)(dungeonNumeric第八端面.Value); } private void mlTextBoxEdit扩散长度_TextChanged(object sender, EventArgs e) { foreach (var s in mlTextBoxEdit扩散长度.Text) { if (!double.TryParse(mlTextBoxEdit扩散长度.Text, out double result) && !string.IsNullOrEmpty(mlTextBoxEdit扩散长度.Text) && mlTextBoxEdit扩散长度.Text != "请输入扩散管长度") { mlTextBoxEdit扩散长度.UseAccent = true; mlTextBoxEdit扩散长度.ShowAssistiveText = true; mlTextBoxEdit扩散长度.Text = ""; break; } else { mlTextBoxEdit扩散长度.ShowAssistiveText = false; mlTextBoxEdit扩散长度.UseAccent = false; } } } private void mlTextBoxEdit扩散长度_Enter(object sender, EventArgs e) { if (mlTextBoxEdit扩散长度.Text == "请输入扩散管长度") { mlTextBoxEdit扩散长度.Text = ""; } } private void mlTextBoxEdit扩散长度_Leave(object sender, EventArgs e) { if (string.IsNullOrEmpty(mlTextBoxEdit扩散长度.Text)) { mlTextBoxEdit扩散长度.Text = "请输入扩散管长度"; } } private void mlTextBoxEdit中心距离_Enter(object sender, EventArgs e) { if (mlTextBoxEdit中心距离.Text == "请输入中心距离") { mlTextBoxEdit中心距离.Text = ""; } } private void mlTextBoxEdit中心距离_Leave(object sender, EventArgs e) { if (string.IsNullOrEmpty(mlTextBoxEdit中心距离.Text)) { mlTextBoxEdit中心距离.Text = "请输入中心距离"; } } private void mlTextBoxEdit中心距离_TextChanged(object sender, EventArgs e) { foreach (var s in mlTextBoxEdit中心距离.Text) { if (!double.TryParse(mlTextBoxEdit中心距离.Text, out double result) && !string.IsNullOrEmpty(mlTextBoxEdit中心距离.Text) && mlTextBoxEdit中心距离.Text != "请输入中心距离") { mlTextBoxEdit中心距离.UseAccent = true; mlTextBoxEdit中心距离.ShowAssistiveText = true; mlTextBoxEdit中心距离.Text = ""; break; } else { mlTextBoxEdit中心距离.ShowAssistiveText = false; mlTextBoxEdit中心距离.UseAccent = false; } } } } }