* UILoginForm:更新回车按钮事件执行两次的问题

This commit is contained in:
Sunny 2020-07-12 12:28:10 +08:00
parent b39c27753e
commit 72ab4b487e
12 changed files with 25 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -68,17 +68,20 @@
this.PieChart.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
this.PieChart.Font = new System.Drawing.Font("微软雅黑", 12F);
this.PieChart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(54)))), ((int)(((byte)(54)))), ((int)(((byte)(54)))));
this.PieChart.LegendFont = new System.Drawing.Font("微软雅黑", 12F);
this.PieChart.Location = new System.Drawing.Point(30, 48);
this.PieChart.Name = "PieChart";
this.PieChart.Option = null;
this.PieChart.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.PieChart.Size = new System.Drawing.Size(670, 400);
this.PieChart.SubFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.PieChart.TabIndex = 20;
this.PieChart.Text = "uiPieChart1";
//
// uiImageButton1
//
this.uiImageButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiImageButton1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiImageButton1.Image = global::Sunny.UI.Demo.Properties.Resources.ChartDefaultStyle;
this.uiImageButton1.Location = new System.Drawing.Point(30, 466);
this.uiImageButton1.Name = "uiImageButton1";
@ -92,6 +95,7 @@
// uiImageButton2
//
this.uiImageButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiImageButton2.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiImageButton2.Image = global::Sunny.UI.Demo.Properties.Resources.ChartPlainStyle;
this.uiImageButton2.Location = new System.Drawing.Point(136, 466);
this.uiImageButton2.Name = "uiImageButton2";
@ -105,6 +109,7 @@
// uiImageButton3
//
this.uiImageButton3.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiImageButton3.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiImageButton3.Image = global::Sunny.UI.Demo.Properties.Resources.ChartDarkStyle;
this.uiImageButton3.Location = new System.Drawing.Point(242, 466);
this.uiImageButton3.Name = "uiImageButton3";

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Windows.Forms;
namespace Sunny.UI.Demo
{
@ -9,11 +10,12 @@ namespace Sunny.UI.Demo
InitializeComponent();
uiDataGridView1.AddColumn("Column1", "Column1", 100);
uiDataGridView1.AddColumn("Column2", "Column2").SetFixedMode(100);
uiDataGridView1.AddColumn("Column2", "Column2").SetFixedMode(1000);
uiDataGridView1.AddColumn("Column3", "Column3").SetFixedMode(100);
//uiDataGridView1.AddColumn("Column4", "Column4", 20);
uiDataGridView1.ReadOnly = true;
uiDataGridView1.ScrollBars = ScrollBars.Both;
}
public override void Init()

View File

@ -9,11 +9,12 @@
private void FLogin_ButtonLoginClick(object sender, System.EventArgs e)
{
if (UserName == "admin" && Password == "admin")
{
IsLogin = true;
Close();
}
this.ShowInfoTip("DSFSDF");
// if (UserName == "admin" && Password == "admin")
// {
// IsLogin = true;
// Close();
// }
}
}
}

View File

@ -156,6 +156,11 @@ namespace Sunny.UI
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (tip != null && !tip.Font.Equals(legendFont))
{
tip.Font = legendFont;
}
DrawOption(e.Graphics);
}
@ -192,7 +197,7 @@ namespace Sunny.UI
}
}
public Font legendFont = UIFontColor.SubFont;
private Font legendFont = UIFontColor.SubFont;
[DefaultValue(typeof(Font), "微软雅黑, 9pt")]
public Font LegendFont
@ -201,6 +206,7 @@ namespace Sunny.UI
set
{
legendFont = value;
if (tip != null) tip.Font = subFont;
Invalidate();
}
}
@ -299,7 +305,7 @@ namespace Sunny.UI
{
g.FillRoundRectangle(ChartStyle.SeriesColor[i % ChartStyle.ColorCount], (int)startleft, (int)top + 1, 18, (int)oneHeight - 2, 5);
g.DrawString(data, LegendFont, ChartStyle.ForeColor, startleft + 20, top);
startleft += 20;
startleft += 22;
startleft += sf.Width;
}

View File

@ -116,7 +116,7 @@ namespace Sunny.UI
else
g.FillFan(color, angle.Center, angle.Inner, angle.Outer, angle.Start - 90, angle.Sweep);
Angles[pieIndex][azIndex].TextSize = g.MeasureString(Angles[pieIndex][azIndex].Text, legendFont);
Angles[pieIndex][azIndex].TextSize = g.MeasureString(Angles[pieIndex][azIndex].Text, LegendFont);
if (pie.Label.Show && ActiveAzIndex == azIndex)
{

View File

@ -129,7 +129,7 @@ namespace Sunny.UI
Color color = ChartStyle.SeriesColor[azIndex % ChartStyle.ColorCount];
RectangleF rectx = new RectangleF(rect.X - 10, rect.Y - 10, rect.Width + 20, rect.Width + 20);
g.FillPie(color, (ActivePieIndex == pieIndex && ActiveAzIndex == azIndex) ? rectx : rect, Angles[pieIndex][azIndex].Start - 90, Angles[pieIndex][azIndex].Sweep);
Angles[pieIndex][azIndex].TextSize = g.MeasureString(Angles[pieIndex][azIndex].Text, legendFont);
Angles[pieIndex][azIndex].TextSize = g.MeasureString(Angles[pieIndex][azIndex].Text, LegendFont);
}
}
}

View File

@ -70,7 +70,6 @@ namespace Sunny.UI
{
if (e.KeyData == Keys.Enter)
{
base.OnKeyDown(e);
EnterKeyPress?.Invoke(this, e);
}

View File

@ -91,7 +91,7 @@ namespace Sunny.UI
private void UILoginForm_Enter(object sender, EventArgs e)
{
btnLogin.PerformClick();
//btnLogin.PerformClick();
}
public string UserName