修复inputnumber鼠标长按加减导致的跨线程问题
This commit is contained in:
parent
5534b3ed1f
commit
eb30901846
@ -156,14 +156,21 @@ namespace AntdUIDemo.Views
|
|||||||
// 添加清理逻辑
|
// 添加清理逻辑
|
||||||
public void CloseFloatButtonForm()
|
public void CloseFloatButtonForm()
|
||||||
{
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
Invoke(new Action(CloseFloatButtonForm));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (floatButtonForm != null)
|
if (floatButtonForm != null)
|
||||||
{
|
{
|
||||||
floatButtonForm?.Close();
|
floatButtonForm.Close();
|
||||||
floatButtonForm?.Dispose();
|
floatButtonForm.Dispose();
|
||||||
floatButtonForm = null;
|
floatButtonForm = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region EventHandler
|
#region EventHandler
|
||||||
private void select_intvalue_SelectedIndexChanged(object sender, IntEventArgs e)
|
private void select_intvalue_SelectedIndexChanged(object sender, IntEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -91,12 +91,18 @@ namespace AntdUIDemo.Views
|
|||||||
#region 事件
|
#region 事件
|
||||||
private void select_intvalue_SelectedIndexChanged(object sender, IntEventArgs e)
|
private void select_intvalue_SelectedIndexChanged(object sender, IntEventArgs e)
|
||||||
{
|
{
|
||||||
flowPanel.Align = (TAlignFlow)select_align.SelectedValue;
|
if (flowPanel.InvokeRequired)
|
||||||
|
{
|
||||||
|
flowPanel.Invoke(new Action(() => { flowPanel.Align = (TAlignFlow)select_align.SelectedValue; }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void input_gap_ValueChanged(object sender, DecimalEventArgs e)
|
private void input_gap_ValueChanged(object sender, DecimalEventArgs e)
|
||||||
{
|
{
|
||||||
flowPanel.Gap = (int)input_gap.Value;
|
if (flowPanel.InvokeRequired)
|
||||||
|
{
|
||||||
|
flowPanel.Invoke(new Action(() => { flowPanel.Gap = (int)input_gap.Value; }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 添加按钮
|
// 添加按钮
|
||||||
private void buttonADD_Click(object sender, EventArgs e)
|
private void buttonADD_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@ -37,6 +37,11 @@ namespace AntdUIDemo.Views
|
|||||||
|
|
||||||
private void LoadGridPanel(string spantext, decimal gap)
|
private void LoadGridPanel(string spantext, decimal gap)
|
||||||
{
|
{
|
||||||
|
if (gridPanel.InvokeRequired)
|
||||||
|
{
|
||||||
|
gridPanel.Invoke(new Action(() => LoadGridPanel(spantext, gap)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
gridPanel.Controls.Clear();
|
gridPanel.Controls.Clear();
|
||||||
gridPanel.Span = spantext;
|
gridPanel.Span = spantext;
|
||||||
gridPanel.Gap = (int)gap;
|
gridPanel.Gap = (int)gap;
|
||||||
|
|||||||
@ -78,6 +78,11 @@ namespace AntdUIDemo.Views
|
|||||||
|
|
||||||
private void LoadPanel()
|
private void LoadPanel()
|
||||||
{
|
{
|
||||||
|
if (panel.InvokeRequired)
|
||||||
|
{
|
||||||
|
panel.Invoke(new Action(() => LoadPanel()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
panel.ArrowAlign = (TAlign)select_arrowalign.SelectedValue;
|
panel.ArrowAlign = (TAlign)select_arrowalign.SelectedValue;
|
||||||
panel.ArrowSize = (int)input_arrowsize.Value;
|
panel.ArrowSize = (int)input_arrowsize.Value;
|
||||||
panel.Radius = (int)input_radius.Value;
|
panel.Radius = (int)input_radius.Value;
|
||||||
|
|||||||
@ -82,12 +82,24 @@ namespace AntdUIDemo.Views
|
|||||||
|
|
||||||
private void input_itemsize_TextChanged(object sender, EventArgs e)
|
private void input_itemsize_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
stackPanel.ItemSize = input_itemsize.Text;
|
if (stackPanel.InvokeRequired)
|
||||||
|
{
|
||||||
|
stackPanel.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
stackPanel.ItemSize = input_itemsize.Text;
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void input_gap_ValueChanged(object sender, DecimalEventArgs e)
|
private void input_gap_ValueChanged(object sender, DecimalEventArgs e)
|
||||||
{
|
{
|
||||||
stackPanel.Gap = (int)input_gap.Value;
|
if (stackPanel.InvokeRequired)
|
||||||
|
{
|
||||||
|
stackPanel.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
stackPanel.Gap = (int)input_gap.Value;
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonDEL_Click(object sender, EventArgs e)
|
private void ButtonDEL_Click(object sender, EventArgs e)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user