using DPumpHydr.WinFrmUI.RLT.Controls;
|
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();
|
BuildAllTips();
|
BuildIcon();
|
}
|
|
private void BuildIcon()
|
{
|
//扩散管形状图片
|
metroTile扩散管形状.BackgroundImage = GlobalResource.BuildImage("kuosanguan.png", 878, 238);
|
|
//输入框前缀图片
|
mlTextBoxEdit扩散管长度.LeadingIcon = GlobalResource.GetLeadingIcon();
|
mlTextBoxEdit中心距离.LeadingIcon = GlobalResource.GetLeadingIcon();
|
}
|
|
public bool Verify(out string error)
|
{
|
error = "";
|
bool isOk = true;
|
if (string.IsNullOrEmpty(mlTextBoxEdit扩散管长度.Text) || mlTextBoxEdit扩散管长度.Text == "请输入扩散管长度")
|
{
|
error = "请输入扩散管长度!";
|
isOk = false;
|
mlTextBoxEdit扩散管长度.TrailingIcon = GlobalResource.GetTipTrailingIcon();
|
skyLabel扩散管长度.Visible = true;
|
}
|
if (string.IsNullOrEmpty(mlTextBoxEdit中心距离.Text) || mlTextBoxEdit中心距离.Text == "请输入中心距离")
|
{
|
error = "请输入中心距离!";
|
isOk = false;
|
mlTextBoxEdit中心距离.TrailingIcon = GlobalResource.GetTipTrailingIcon();
|
skyLabel中心距离.Visible = true;
|
}
|
return isOk;
|
}
|
|
private void BuildAllTips()
|
{
|
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)
|
{
|
skyLabel扩散管长度.Visible = false;
|
mlTextBoxEdit扩散管长度.TrailingIcon = null;
|
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)
|
{
|
skyLabel中心距离.Visible = false;
|
mlTextBoxEdit中心距离.TrailingIcon = null;
|
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;
|
}
|
}
|
}
|
|
private void mBtn更新模型_Click(object sender, EventArgs e)
|
{
|
if (mlTextBoxEdit扩散管长度.Text == "请输入扩散管长度" || string.IsNullOrEmpty(mlTextBoxEdit扩散管长度.Text))
|
{
|
skyLabel扩散管长度.Visible = true;
|
MessageBox.Show("请先输入扩散管长度!");
|
return;
|
}
|
if (mlTextBoxEdit中心距离.Text == "请输入中心距离" || string.IsNullOrEmpty(mlTextBoxEdit中心距离.Text))
|
{
|
skyLabel中心距离.Visible = true;
|
MessageBox.Show("请先输入中心距离!");
|
return;
|
}
|
}
|
}
|
}
|