* UITransfer: 增加了显示多个移动的属性
This commit is contained in:
parent
76e13855df
commit
299fef8ce3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -28,10 +28,10 @@
|
|||||||
Text = "Button" + index++.ToString("D2")
|
Text = "Button" + index++.ToString("D2")
|
||||||
};
|
};
|
||||||
|
|
||||||
//可以用原生方法Controls.Add
|
//建议用封装的方法Add
|
||||||
uiFlowLayoutPanel1.Controls.Add(btn);
|
uiFlowLayoutPanel1.Add(btn);
|
||||||
//或者封装的方法Add
|
//也可以用原生方法Controls.Add(不推荐)
|
||||||
//uiFlowLayoutPanel1.Add(btn);
|
//uiFlowLayoutPanel1.Controls.Add(btn);
|
||||||
|
|
||||||
uiButton3.Enabled = true;
|
uiButton3.Enabled = true;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ using System.ComponentModel;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Forms.Layout;
|
|
||||||
|
|
||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
@ -65,11 +64,6 @@ namespace Sunny.UI
|
|||||||
timer.Stop();
|
timer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override LayoutEngine LayoutEngine
|
|
||||||
{
|
|
||||||
get { return Panel.LayoutEngine; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(System.Windows.Forms.FlowDirection.LeftToRight)]
|
[DefaultValue(System.Windows.Forms.FlowDirection.LeftToRight)]
|
||||||
[Localizable(true)]
|
[Localizable(true)]
|
||||||
public FlowDirection FlowDirection
|
public FlowDirection FlowDirection
|
||||||
|
@ -362,20 +362,20 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void WndProc(ref Message m)
|
//protected override void WndProc(ref Message m)
|
||||||
{
|
//{
|
||||||
if (IsDisposed || Disposing) return;
|
// if (IsDisposed || Disposing) return;
|
||||||
if (IsHandleCreated)
|
// if (IsHandleCreated)
|
||||||
{
|
// {
|
||||||
if (m.Msg == Win32.User.WM_ERASEBKGND)
|
// if (m.Msg == Win32.User.WM_ERASEBKGND)
|
||||||
{
|
// {
|
||||||
m.Result = IntPtr.Zero;
|
// m.Result = IntPtr.Zero;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
base.WndProc(ref m);
|
// base.WndProc(ref m);
|
||||||
}
|
//}
|
||||||
|
|
||||||
public ImageListBox()
|
public ImageListBox()
|
||||||
{
|
{
|
||||||
|
@ -607,11 +607,11 @@ namespace Sunny.UI
|
|||||||
ItemsInsert?.Invoke(this, EventArgs.Empty);
|
ItemsInsert?.Invoke(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.Msg == Win32.User.WM_ERASEBKGND)
|
//if (m.Msg == Win32.User.WM_ERASEBKGND)
|
||||||
{
|
//{
|
||||||
m.Result = IntPtr.Zero;
|
// m.Result = IntPtr.Zero;
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.WndProc(ref m);
|
base.WndProc(ref m);
|
||||||
|
@ -46,6 +46,14 @@ namespace Sunny.UI
|
|||||||
l2.ItemsCountChange += L2_ItemsCountChange;
|
l2.ItemsCountChange += L2_ItemsCountChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[Description("显示多选按钮"), Category("SunnyUI")]
|
||||||
|
public bool ShowMulti
|
||||||
|
{
|
||||||
|
get => b1.Visible;
|
||||||
|
set => b1.Visible = b4.Visible = value;
|
||||||
|
}
|
||||||
|
|
||||||
private void L2_ItemsCountChange(object sender, EventArgs e)
|
private void L2_ItemsCountChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ItemsRightCountChange?.Invoke(this, e);
|
ItemsRightCountChange?.Invoke(this, e);
|
||||||
@ -84,12 +92,17 @@ namespace Sunny.UI
|
|||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public ListBox ListBoxRight => l2.ListBox;
|
public ListBox ListBoxRight => l2.ListBox;
|
||||||
|
|
||||||
|
public delegate void ItemChange(object sender, object item);
|
||||||
|
|
||||||
|
public event ItemChange ItemAdd;
|
||||||
|
public event ItemChange ItemRemove;
|
||||||
|
|
||||||
private void b1_Click(object sender, EventArgs e)
|
private void b1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
foreach (object item in l1.Items)
|
foreach (object item in l1.Items)
|
||||||
{
|
{
|
||||||
l2.Items.Add(item);
|
l2.Items.Add(item);
|
||||||
|
ItemAdd?.Invoke(this, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
l1.Items.Clear();
|
l1.Items.Clear();
|
||||||
@ -106,6 +119,7 @@ namespace Sunny.UI
|
|||||||
int idx = l1.SelectedIndex;
|
int idx = l1.SelectedIndex;
|
||||||
object item = l1.SelectedItem;
|
object item = l1.SelectedItem;
|
||||||
l2.Items.Add(item);
|
l2.Items.Add(item);
|
||||||
|
ItemAdd?.Invoke(this, item);
|
||||||
l1.Items.Remove(item);
|
l1.Items.Remove(item);
|
||||||
|
|
||||||
if (l2.Items.Count > 0)
|
if (l2.Items.Count > 0)
|
||||||
@ -132,6 +146,7 @@ namespace Sunny.UI
|
|||||||
int idx = l2.SelectedIndex;
|
int idx = l2.SelectedIndex;
|
||||||
object item = l2.SelectedItem;
|
object item = l2.SelectedItem;
|
||||||
l1.Items.Add(item);
|
l1.Items.Add(item);
|
||||||
|
ItemRemove?.Invoke(this, item);
|
||||||
l2.Items.Remove(item);
|
l2.Items.Remove(item);
|
||||||
|
|
||||||
if (l1.Items.Count > 0)
|
if (l1.Items.Count > 0)
|
||||||
@ -156,6 +171,7 @@ namespace Sunny.UI
|
|||||||
foreach (object item in l2.Items)
|
foreach (object item in l2.Items)
|
||||||
{
|
{
|
||||||
l1.Items.Add(item);
|
l1.Items.Add(item);
|
||||||
|
ItemRemove?.Invoke(this, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
l2.Items.Clear();
|
l2.Items.Clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user