Commit 849e118b 刘韬

1

1 个父辈 d0658333
...@@ -6,6 +6,7 @@ using System.Collections.Generic; ...@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
namespace HZH_Controls namespace HZH_Controls
...@@ -69,6 +70,7 @@ namespace HZH_Controls ...@@ -69,6 +70,7 @@ namespace HZH_Controls
if ((strCurLanguage == null || strCurLanguage.Equals("")) && (!defaultStr.Equals(""))) if ((strCurLanguage == null || strCurLanguage.Equals("")) && (!defaultStr.Equals("")))
{ {
strCurLanguage = defaultStr; strCurLanguage = defaultStr;
if (HasChinese(defaultStr))
NoIdLog(id, defaultStr); NoIdLog(id, defaultStr);
} }
} }
...@@ -90,6 +92,10 @@ namespace HZH_Controls ...@@ -90,6 +92,10 @@ namespace HZH_Controls
} }
return strCurLanguage; return strCurLanguage;
} }
static bool HasChinese(string txt)
{
return Regex.IsMatch(txt.ToString(), @"[\u4E00-\u9FA5]+");
}
public static string GetString(string id, string defaultStr, params object[] param) public static string GetString(string id, string defaultStr, params object[] param)
{ {
string strCurLanguage = GetString(id, defaultStr); string strCurLanguage = GetString(id, defaultStr);
...@@ -101,7 +107,7 @@ namespace HZH_Controls ...@@ -101,7 +107,7 @@ namespace HZH_Controls
if (OpenResourceLog) if (OpenResourceLog)
{ {
if (!LangMap["zh-CN"].ContainsKey(id) && checkInterid(id)) if (!LangMap["zh-CN"].ContainsKey(id) && checkInterid(id))
LOG.Info("No Res id:" + id + "#" + defaultStr); LOG.Info("No Res id:" + id + "\t" + defaultStr);
} }
} }
private static bool checkInterid(string id) { private static bool checkInterid(string id) {
...@@ -116,7 +122,7 @@ namespace HZH_Controls ...@@ -116,7 +122,7 @@ namespace HZH_Controls
} }
private static bool getLangRes(string lang) { private static bool getLangRes(string lang) {
if (!LangMap.ContainsKey(lang)) { if (!LangMap.ContainsKey(lang)) {
string path = Application.StartupPath + @"\resources\"+lang+".txt"; string path = Application.StartupPath + @"\resources\"+lang+ ".lngres";
if (!File.Exists(path)) if (!File.Exists(path))
{ {
return false; return false;
...@@ -125,7 +131,7 @@ namespace HZH_Controls ...@@ -125,7 +131,7 @@ namespace HZH_Controls
var map = new Dictionary<string, string>(); var map = new Dictionary<string, string>();
foreach (string line in lines) foreach (string line in lines)
{ {
string[] array = line.Split('#'); string[] array = line.Split('\t');
if (array.Length >= 3) if (array.Length >= 3)
{ {
string key = array[0]; string key = array[0];
...@@ -147,7 +153,7 @@ namespace HZH_Controls ...@@ -147,7 +153,7 @@ namespace HZH_Controls
} }
public static string CurrLanguage = ""; public static string CurrLanguage = "";
public static void LanguageProcess(ContainerControl cc, string className) public static void LanguageProcess(ContainerControl cc, string className, bool firerefresh=true)
{ {
if (CurrLanguage.Equals(CodeResourceControl.GetLanguage())) if (CurrLanguage.Equals(CodeResourceControl.GetLanguage()))
{ {
...@@ -159,11 +165,14 @@ namespace HZH_Controls ...@@ -159,11 +165,14 @@ namespace HZH_Controls
if (!name.Equals("")) { cc.Text = name; } if (!name.Equals("")) { cc.Text = name; }
PreControlLanaguage(cc, className); PreControlLanaguage(cc, className);
if (firerefresh)
RefreshLanguageEvent?.Invoke(); RefreshLanguageEvent?.Invoke();
} }
private static void PreControlLanaguage(Control partentControl, string className) private static void PreControlLanaguage(Control partentControl, string className)
{ {
//if (partentControl.Tag.ToString() == "not")
// return;
//string className = this.ClassName; //string className = this.ClassName;
Con_GetTxt(partentControl, out string title); Con_GetTxt(partentControl, out string title);
string newStr = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className, partentControl.Name), title); string newStr = CodeResourceControl.GetString(CodeResourceControl.GetTextIdStr(className, partentControl.Name), title);
...@@ -173,6 +182,8 @@ namespace HZH_Controls ...@@ -173,6 +182,8 @@ namespace HZH_Controls
} }
foreach (Control con in partentControl.Controls) foreach (Control con in partentControl.Controls)
{ {
if (con.Tag!=null && con.Tag.ToString() == "not")
continue;
string txt = ""; string txt = "";
bool haslang = false; bool haslang = false;
if (Con_GetTxt(con, out txt)) if (Con_GetTxt(con, out txt))
...@@ -184,6 +195,7 @@ namespace HZH_Controls ...@@ -184,6 +195,7 @@ namespace HZH_Controls
//haslang = true; //haslang = true;
} }
} }
if (con is UCCheckBox) if (con is UCCheckBox)
continue; continue;
if (con.Controls.Count > 0 && !haslang) if (con.Controls.Count > 0 && !haslang)
......
...@@ -104,37 +104,37 @@ namespace HZH_Controls.Controls ...@@ -104,37 +104,37 @@ namespace HZH_Controls.Controls
{ {
return; return;
} }
if (lbl.Text == "大写") if (lbl.Text.ToLower() == "upper")
{ {
ToUper(true); ToUper(true);
lbl.Text = "小写"; lbl.Text = "Lower";
} }
else if (lbl.Text == "小写") else if (lbl.Text.ToLower() == "lower")
{ {
ToUper(false); ToUper(false);
lbl.Text = "大写"; lbl.Text = "Upper";
} }
else if (lbl.Text == "?123" || lbl.Text == "abc.") else if (lbl.Text.ToLower() == "?123" || lbl.Text.ToLower() == "abc.")
{ {
CharOrNum(); CharOrNum();
} }
else if (lbl.Text == "空格") else if (lbl.Text.ToLower() == "space")
{ {
SendKeys.Send(" "); SendKeys.Send(" ");
} }
else if (lbl.Text == "删除") else if (lbl.Text.ToLower() == "backspace")
{ {
SendKeys.Send("{BACKSPACE}"); SendKeys.Send("{BACKSPACE}");
if (BackspaceClike != null) if (BackspaceClike != null)
BackspaceClike(sender, e); BackspaceClike(sender, e);
} }
else if (lbl.Text == "回车") else if (lbl.Text == "Enter")
{ {
SendKeys.Send("{ENTER}"); SendKeys.Send("{ENTER}");
if (EnterClick != null) if (EnterClick != null)
EnterClick(sender, e); EnterClick(sender, e);
} }
else if (lbl.Text == "收起") else if (lbl.Text == "Close")
{ {
if (RetractClike != null) if (RetractClike != null)
RetractClike(sender, e); RetractClike(sender, e);
......
...@@ -170,7 +170,7 @@ namespace HZH_Controls.Controls ...@@ -170,7 +170,7 @@ namespace HZH_Controls.Controls
// label11 // label11
// //
this.label11.Dock = System.Windows.Forms.DockStyle.Fill; this.label11.Dock = System.Windows.Forms.DockStyle.Fill;
this.label11.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label11.Location = new System.Drawing.Point(0, 0); this.label11.Location = new System.Drawing.Point(0, 0);
this.label11.Name = "label11"; this.label11.Name = "label11";
...@@ -207,7 +207,7 @@ namespace HZH_Controls.Controls ...@@ -207,7 +207,7 @@ namespace HZH_Controls.Controls
// label12 // label12
// //
this.label12.Dock = System.Windows.Forms.DockStyle.Fill; this.label12.Dock = System.Windows.Forms.DockStyle.Fill;
this.label12.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label12.Location = new System.Drawing.Point(0, 0); this.label12.Location = new System.Drawing.Point(0, 0);
this.label12.Name = "label12"; this.label12.Name = "label12";
...@@ -244,7 +244,7 @@ namespace HZH_Controls.Controls ...@@ -244,7 +244,7 @@ namespace HZH_Controls.Controls
// label13 // label13
// //
this.label13.Dock = System.Windows.Forms.DockStyle.Fill; this.label13.Dock = System.Windows.Forms.DockStyle.Fill;
this.label13.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label13.Location = new System.Drawing.Point(0, 0); this.label13.Location = new System.Drawing.Point(0, 0);
this.label13.Name = "label13"; this.label13.Name = "label13";
...@@ -282,7 +282,7 @@ namespace HZH_Controls.Controls ...@@ -282,7 +282,7 @@ namespace HZH_Controls.Controls
// label10 // label10
// //
this.label10.Dock = System.Windows.Forms.DockStyle.Fill; this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
this.label10.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label10.Location = new System.Drawing.Point(0, 0); this.label10.Location = new System.Drawing.Point(0, 0);
this.label10.Name = "label10"; this.label10.Name = "label10";
...@@ -331,7 +331,7 @@ namespace HZH_Controls.Controls ...@@ -331,7 +331,7 @@ namespace HZH_Controls.Controls
// label9 // label9
// //
this.label9.Dock = System.Windows.Forms.DockStyle.Fill; this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label9.Location = new System.Drawing.Point(0, 0); this.label9.Location = new System.Drawing.Point(0, 0);
this.label9.Name = "label9"; this.label9.Name = "label9";
...@@ -380,7 +380,7 @@ namespace HZH_Controls.Controls ...@@ -380,7 +380,7 @@ namespace HZH_Controls.Controls
// label8 // label8
// //
this.label8.Dock = System.Windows.Forms.DockStyle.Fill; this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label8.Location = new System.Drawing.Point(0, 0); this.label8.Location = new System.Drawing.Point(0, 0);
this.label8.Name = "label8"; this.label8.Name = "label8";
...@@ -429,7 +429,7 @@ namespace HZH_Controls.Controls ...@@ -429,7 +429,7 @@ namespace HZH_Controls.Controls
// label6 // label6
// //
this.label6.Dock = System.Windows.Forms.DockStyle.Fill; this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label6.Location = new System.Drawing.Point(0, 0); this.label6.Location = new System.Drawing.Point(0, 0);
this.label6.Name = "label6"; this.label6.Name = "label6";
...@@ -486,7 +486,7 @@ namespace HZH_Controls.Controls ...@@ -486,7 +486,7 @@ namespace HZH_Controls.Controls
this.label14.Size = new System.Drawing.Size(107, 162); this.label14.Size = new System.Drawing.Size(107, 162);
this.label14.TabIndex = 3; this.label14.TabIndex = 3;
this.label14.Tag = "{ENTER}"; this.label14.Tag = "{ENTER}";
this.label14.Text = "确\r\n定"; this.label14.Text = "OK";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label14.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Enter_MouseDown); this.label14.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Enter_MouseDown);
// //
...@@ -506,7 +506,7 @@ namespace HZH_Controls.Controls ...@@ -506,7 +506,7 @@ namespace HZH_Controls.Controls
// label7 // label7
// //
this.label7.Dock = System.Windows.Forms.DockStyle.Fill; this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label7.Location = new System.Drawing.Point(0, 0); this.label7.Location = new System.Drawing.Point(0, 0);
this.label7.Name = "label7"; this.label7.Name = "label7";
...@@ -555,7 +555,7 @@ namespace HZH_Controls.Controls ...@@ -555,7 +555,7 @@ namespace HZH_Controls.Controls
// label3 // label3
// //
this.label3.Dock = System.Windows.Forms.DockStyle.Fill; this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label3.Location = new System.Drawing.Point(0, 0); this.label3.Location = new System.Drawing.Point(0, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
...@@ -604,7 +604,7 @@ namespace HZH_Controls.Controls ...@@ -604,7 +604,7 @@ namespace HZH_Controls.Controls
// label5 // label5
// //
this.label5.Dock = System.Windows.Forms.DockStyle.Fill; this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label5.Location = new System.Drawing.Point(0, 0); this.label5.Location = new System.Drawing.Point(0, 0);
this.label5.Name = "label5"; this.label5.Name = "label5";
...@@ -654,7 +654,7 @@ namespace HZH_Controls.Controls ...@@ -654,7 +654,7 @@ namespace HZH_Controls.Controls
// //
this.label4.BackColor = System.Drawing.Color.White; this.label4.BackColor = System.Drawing.Color.White;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill; this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label4.Image = global::HZH_Controls.Properties.Resources.keyboard_bs; this.label4.Image = global::HZH_Controls.Properties.Resources.keyboard_bs;
this.label4.Location = new System.Drawing.Point(0, 0); this.label4.Location = new System.Drawing.Point(0, 0);
...@@ -692,7 +692,7 @@ namespace HZH_Controls.Controls ...@@ -692,7 +692,7 @@ namespace HZH_Controls.Controls
// label2 // label2
// //
this.label2.Dock = System.Windows.Forms.DockStyle.Fill; this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label2.Location = new System.Drawing.Point(0, 0); this.label2.Location = new System.Drawing.Point(0, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
...@@ -741,7 +741,7 @@ namespace HZH_Controls.Controls ...@@ -741,7 +741,7 @@ namespace HZH_Controls.Controls
// label1 // label1
// //
this.label1.Dock = System.Windows.Forms.DockStyle.Fill; this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("Arial Unicode MS", 30F); this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102))))); this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
......
...@@ -109,6 +109,7 @@ namespace HZH_Controls.Controls ...@@ -109,6 +109,7 @@ namespace HZH_Controls.Controls
foreach (var item in DataSource) foreach (var item in DataSource)
{ {
UCHorizontalListItem uc = new UCHorizontalListItem(); UCHorizontalListItem uc = new UCHorizontalListItem();
uc.ForeColor = ForeColor;
uc.SelectedColor = selectedColor; uc.SelectedColor = selectedColor;
uc.DataSource = item; uc.DataSource = item;
uc.SelectedItem += uc_SelectItem; uc.SelectedItem += uc_SelectItem;
......
...@@ -56,7 +56,7 @@ namespace HZH_Controls.Controls ...@@ -56,7 +56,7 @@ namespace HZH_Controls.Controls
// //
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill; this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 10F); this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 10F);
this.lblTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.lblTitle.ForeColor = ForeColor;
this.lblTitle.Location = new System.Drawing.Point(1, 0); this.lblTitle.Location = new System.Drawing.Point(1, 0);
this.lblTitle.Name = "lblTitle"; this.lblTitle.Name = "lblTitle";
this.lblTitle.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); this.lblTitle.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
......
...@@ -53,8 +53,8 @@ namespace HZH_Controls.Controls ...@@ -53,8 +53,8 @@ namespace HZH_Controls.Controls
var g = lblTitle.CreateGraphics(); var g = lblTitle.CreateGraphics();
int intWidth = ControlHelper.GetStringWidth(value.Value, g, lblTitle.Font); int intWidth = ControlHelper.GetStringWidth(value.Value, g, lblTitle.Font);
g.Dispose(); g.Dispose();
if (intWidth < 50) if (intWidth < 100)
intWidth = 50; intWidth = 100;
this.Width = intWidth + 20; this.Width = intWidth + 20;
lblTitle.Text = value.Value; lblTitle.Text = value.Value;
SetSelect(false); SetSelect(false);
...@@ -106,7 +106,7 @@ namespace HZH_Controls.Controls ...@@ -106,7 +106,7 @@ namespace HZH_Controls.Controls
} }
else else
{ {
lblTitle.ForeColor = Color.FromArgb(64, 64, 64); lblTitle.ForeColor = ForeColor;
ucSplitLine_H1.Visible = false; ucSplitLine_H1.Visible = false;
this.lblTitle.Padding = new Padding(0, 0, 0, 0); this.lblTitle.Padding = new Padding(0, 0, 0, 0);
} }
......
...@@ -224,6 +224,8 @@ namespace HZH_Controls.Controls ...@@ -224,6 +224,8 @@ namespace HZH_Controls.Controls
base.OnPaint(e); base.OnPaint(e);
var g = e.Graphics; var g = e.Graphics;
g.SetGDIHigh(); g.SetGDIHigh();
if (this.Height < 2)
return;
if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse) if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse)
{ {
var fillColor = m_checked ? m_trueColor : m_falseColor; var fillColor = m_checked ? m_trueColor : m_falseColor;
......
...@@ -59,8 +59,8 @@ namespace HZH_Controls.Controls ...@@ -59,8 +59,8 @@ namespace HZH_Controls.Controls
this.txtNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); this.txtNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.txtNum.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtNum.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtNum.DecLength = 3; this.txtNum.DecLength = 3;
this.txtNum.Font = new System.Drawing.Font("Arial Unicode MS", 15F); this.txtNum.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.txtNum.InputType = TextInputType.Number; this.txtNum.InputType = HZH_Controls.TextInputType.Number;
this.txtNum.Location = new System.Drawing.Point(37, 11); this.txtNum.Location = new System.Drawing.Point(37, 11);
this.txtNum.Margin = new System.Windows.Forms.Padding(0); this.txtNum.Margin = new System.Windows.Forms.Padding(0);
this.txtNum.MaxValue = new decimal(new int[] { this.txtNum.MaxValue = new decimal(new int[] {
...@@ -80,7 +80,7 @@ namespace HZH_Controls.Controls ...@@ -80,7 +80,7 @@ namespace HZH_Controls.Controls
this.txtNum.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.txtNum.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.txtNum.PromptText = ""; this.txtNum.PromptText = "";
this.txtNum.RegexPattern = ""; this.txtNum.RegexPattern = "";
this.txtNum.Size = new System.Drawing.Size(78, 27); this.txtNum.Size = new System.Drawing.Size(78, 23);
this.txtNum.TabIndex = 9; this.txtNum.TabIndex = 9;
this.txtNum.Text = "1"; this.txtNum.Text = "1";
this.txtNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
......
...@@ -328,6 +328,7 @@ namespace HZH_Controls.Controls ...@@ -328,6 +328,7 @@ namespace HZH_Controls.Controls
private void UCNumTextBox_Load(object sender, EventArgs e) private void UCNumTextBox_Load(object sender, EventArgs e)
{ {
this.txtNum.BackColor = this.BackColor; this.txtNum.BackColor = this.BackColor;
this.txtNum.ForeColor = this.ForeColor;
} }
/// <summary> /// <summary>
......
...@@ -31,6 +31,9 @@ namespace HZH_Controls.Forms ...@@ -31,6 +31,9 @@ namespace HZH_Controls.Forms
/// <seealso cref="HZH_Controls.Forms.FrmBase" /> /// <seealso cref="HZH_Controls.Forms.FrmBase" />
public partial class FrmDialog : FrmBase public partial class FrmDialog : FrmBase
{ {
public static string TitleTxt="提示";
public static string OkTxt="确认";
public static string CancelTxt="取消";
/// <summary> /// <summary>
/// The BLN enter close /// The BLN enter close
/// </summary> /// </summary>
...@@ -50,11 +53,13 @@ namespace HZH_Controls.Forms ...@@ -50,11 +53,13 @@ namespace HZH_Controls.Forms
bool blnShowClose = false, bool blnShowClose = false,
bool blnisEnterClose = true) bool blnisEnterClose = true)
{ {
TitleTxt = strTitle;
InitializeComponent(); InitializeComponent();
InitFormMove(this.lblTitle); InitFormMove(this.lblTitle);
if (!string.IsNullOrWhiteSpace(strTitle)) lblTitle.Text = TitleTxt;
lblTitle.Text = strTitle;
lblMsg.Text = strMessage; lblMsg.Text = strMessage;
btnOK.BtnText = OkTxt;
btnCancel.BtnText = CancelTxt;
if (blnShowCancel) if (blnShowCancel)
{ {
this.tableLayoutPanel1.ColumnStyles[1].Width = 1; this.tableLayoutPanel1.ColumnStyles[1].Width = 1;
...@@ -94,7 +99,7 @@ namespace HZH_Controls.Forms ...@@ -94,7 +99,7 @@ namespace HZH_Controls.Forms
public static DialogResult ShowDialog( public static DialogResult ShowDialog(
IWin32Window owner, IWin32Window owner,
string strMessage, string strMessage,
string strTitle = "提示", string strTitle,
bool blnShowCancel = false, bool blnShowCancel = false,
bool isShowMaskDialog = true, bool isShowMaskDialog = true,
bool blnShowClose = false, bool blnShowClose = false,
......
...@@ -64,10 +64,11 @@ namespace HZH_Controls.Forms ...@@ -64,10 +64,11 @@ namespace HZH_Controls.Forms
this.btnOK.BtnBackColor = System.Drawing.Color.Transparent; this.btnOK.BtnBackColor = System.Drawing.Color.Transparent;
this.btnOK.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOK.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(85)))), ((int)(((byte)(51))))); this.btnOK.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(85)))), ((int)(((byte)(51)))));
this.btnOK.BtnText = "确定"; this.btnOK.BtnText = "Confirm";
this.btnOK.ConerRadius = 5; this.btnOK.ConerRadius = 5;
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand; this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOK.Dock = System.Windows.Forms.DockStyle.Fill; this.btnOK.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnOK.EnabledMouseEffect = false;
this.btnOK.FillColor = System.Drawing.Color.White; this.btnOK.FillColor = System.Drawing.Color.White;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.btnOK.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.btnOK.IsRadius = false; this.btnOK.IsRadius = false;
...@@ -91,10 +92,11 @@ namespace HZH_Controls.Forms ...@@ -91,10 +92,11 @@ namespace HZH_Controls.Forms
this.btnCancel.BtnBackColor = System.Drawing.Color.Transparent; this.btnCancel.BtnBackColor = System.Drawing.Color.Transparent;
this.btnCancel.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCancel.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232))))); this.btnCancel.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.btnCancel.BtnText = "取消"; this.btnCancel.BtnText = "Cancel";
this.btnCancel.ConerRadius = 5; this.btnCancel.ConerRadius = 5;
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand; this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancel.Dock = System.Windows.Forms.DockStyle.Fill; this.btnCancel.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnCancel.EnabledMouseEffect = false;
this.btnCancel.FillColor = System.Drawing.Color.White; this.btnCancel.FillColor = System.Drawing.Color.White;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.btnCancel.IsRadius = false; this.btnCancel.IsRadius = false;
......
...@@ -123,10 +123,6 @@ namespace HZH_Controls.Forms ...@@ -123,10 +123,6 @@ namespace HZH_Controls.Forms
/// The uc split line h1 /// The uc split line h1
/// </summary> /// </summary>
private Controls.UCSplitLine_H ucSplitLine_H1; private Controls.UCSplitLine_H ucSplitLine_H1;
/// <summary> protected System.Windows.Forms.Panel btnClose;
/// The BTN close
/// </summary>
private System.Windows.Forms.Panel btnClose;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HZH_Controls</RootNamespace> <RootNamespace>HZH_Controls</RootNamespace>
<AssemblyName>HZH_Controls</AssemblyName> <AssemblyName>HZH_Controls</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -29,6 +31,7 @@ ...@@ -29,6 +31,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net"> <Reference Include="log4net">
......
...@@ -19,7 +19,7 @@ namespace HZH_Controls.Properties { ...@@ -19,7 +19,7 @@ namespace HZH_Controls.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
...@@ -47,8 +47,8 @@ namespace HZH_Controls.Properties { ...@@ -47,8 +47,8 @@ namespace HZH_Controls.Properties {
} }
/// <summary> /// <summary>
/// 重写当前线程的 CurrentUICulture 属性 /// 重写当前线程的 CurrentUICulture 属性,对
/// 重写当前线程的 CurrentUICulture 属性 /// 使用此强类型资源类的所有资源查找执行重写
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
......
...@@ -19,7 +19,7 @@ namespace Test.Properties { ...@@ -19,7 +19,7 @@ namespace Test.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
...@@ -47,8 +47,8 @@ namespace Test.Properties { ...@@ -47,8 +47,8 @@ namespace Test.Properties {
} }
/// <summary> /// <summary>
/// 使用此强类型资源类,为所有资源查找 /// 重写当前线程的 CurrentUICulture 属性,对
/// 重写当前线程的 CurrentUICulture 属性 /// 使用此强类型资源类的所有资源查找执行重写
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Test.Properties namespace Test.Properties {
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default public static Settings Default {
{ get {
get
{
return defaultInstance; return defaultInstance;
} }
} }
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Test</RootNamespace> <RootNamespace>Test</RootNamespace>
<AssemblyName>Test</AssemblyName> <AssemblyName>Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
...@@ -30,6 +32,7 @@ ...@@ -30,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>logo.ico</ApplicationIcon> <ApplicationIcon>logo.ico</ApplicationIcon>
...@@ -998,6 +1001,7 @@ ...@@ -998,6 +1001,7 @@
<EmbeddedResource Include="UC\UCTestWaveChart.resx"> <EmbeddedResource Include="UC\UCTestWaveChart.resx">
<DependentUpon>UCTestWaveChart.cs</DependentUpon> <DependentUpon>UCTestWaveChart.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="LiveCharts" version="0.9.7" targetFramework="net40" /> <package id="LiveCharts" version="0.9.7" targetFramework="net40" requireReinstallation="true" />
<package id="LiveCharts.WinForms" version="0.9.7.1" targetFramework="net40" /> <package id="LiveCharts.WinForms" version="0.9.7.1" targetFramework="net40" requireReinstallation="true" />
<package id="LiveCharts.Wpf" version="0.9.7" targetFramework="net40" /> <package id="LiveCharts.Wpf" version="0.9.7" targetFramework="net40" requireReinstallation="true" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!