* UITextBox:增加Click事件,Cursor可设置
* UIRichTextBox:增加ReadOnly属性
This commit is contained in:
parent
ac4e035573
commit
667ab5e688
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
1
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
@ -92,6 +92,7 @@
|
|||||||
this.uiTextBox1.Size = new System.Drawing.Size(221, 29);
|
this.uiTextBox1.Size = new System.Drawing.Size(221, 29);
|
||||||
this.uiTextBox1.TabIndex = 3;
|
this.uiTextBox1.TabIndex = 3;
|
||||||
this.uiTextBox1.Watermark = "水印文字";
|
this.uiTextBox1.Watermark = "水印文字";
|
||||||
|
this.uiTextBox1.Click += new System.EventHandler(this.uiTextBox1_Click);
|
||||||
//
|
//
|
||||||
// uiLabel1
|
// uiLabel1
|
||||||
//
|
//
|
||||||
|
@ -6,5 +6,10 @@
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void uiTextBox1_Click(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -61,6 +61,13 @@ namespace Sunny.UI
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool ReadOnly
|
||||||
|
{
|
||||||
|
get => edit.ReadOnly;
|
||||||
|
set => edit.ReadOnly = value;
|
||||||
|
}
|
||||||
|
|
||||||
private void Edit_SelectionChanged(object sender, EventArgs e)
|
private void Edit_SelectionChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SelectionChanged?.Invoke(sender, e);
|
SelectionChanged?.Invoke(sender, e);
|
||||||
|
@ -55,6 +55,8 @@ namespace Sunny.UI
|
|||||||
edit.KeyUp += EditOnKeyUp;
|
edit.KeyUp += EditOnKeyUp;
|
||||||
edit.KeyPress += EditOnKeyPress;
|
edit.KeyPress += EditOnKeyPress;
|
||||||
edit.MouseEnter += Edit_MouseEnter;
|
edit.MouseEnter += Edit_MouseEnter;
|
||||||
|
edit.Click += Edit_Click;
|
||||||
|
edit.DoubleClick += Edit_DoubleClick;
|
||||||
|
|
||||||
edit.Invalidate();
|
edit.Invalidate();
|
||||||
Controls.Add(edit);
|
Controls.Add(edit);
|
||||||
@ -70,16 +72,40 @@ namespace Sunny.UI
|
|||||||
bar.MouseEnter += Bar_MouseEnter;
|
bar.MouseEnter += Bar_MouseEnter;
|
||||||
|
|
||||||
SizeChange();
|
SizeChange();
|
||||||
|
|
||||||
|
editCursor = Cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Edit_DoubleClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DoubleClick?.Invoke(this,e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public new event EventHandler DoubleClick;
|
||||||
|
public new event EventHandler Click;
|
||||||
|
|
||||||
|
private void Edit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Click?.Invoke(this,e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnCursorChanged(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnCursorChanged(e);
|
||||||
|
edit.Cursor = Cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Cursor editCursor;
|
||||||
|
|
||||||
private void Bar_MouseEnter(object sender, EventArgs e)
|
private void Bar_MouseEnter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
editCursor = Cursor;
|
||||||
Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Edit_MouseEnter(object sender, EventArgs e)
|
private void Edit_MouseEnter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Cursor = Cursors.IBeam;
|
Cursor = editCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMouseWheel(object sender, MouseEventArgs e)
|
private void OnMouseWheel(object sender, MouseEventArgs e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user