* UIListBox: 增加修改文字颜色
This commit is contained in:
parent
7b7f378880
commit
513eaf959d
Binary file not shown.
@ -25,7 +25,6 @@ using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
@ -43,17 +42,14 @@ namespace Sunny.UI
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
public static Point LocationOnScreen(this Control ctrl)
|
||||
public static Rectangle ScreenRectangle(this Control ctrl)
|
||||
{
|
||||
Point point = new Point(0, 0);
|
||||
do
|
||||
{
|
||||
point.Offset(ctrl.Location);
|
||||
ctrl = ctrl.Parent;
|
||||
}
|
||||
while (ctrl != null);
|
||||
return ctrl.RectangleToScreen(ctrl.ClientRectangle);
|
||||
}
|
||||
|
||||
return point;
|
||||
public static Point ScreenLocation(this Control ctrl)
|
||||
{
|
||||
return ctrl.PointToScreen(new Point(0, 0));
|
||||
}
|
||||
|
||||
public static Form RootForm(this Control ctrl)
|
||||
@ -318,7 +314,7 @@ namespace Sunny.UI
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查找包含接口名称的控件列表
|
||||
/// </summary>
|
||||
|
@ -24,6 +24,7 @@
|
||||
* 2021-07-29: V3.0.5 增加多选行
|
||||
* 2021-07-30: V3.0.5 选中项显示方角
|
||||
* 2021-08-04: V3.0.5 增加Items变更的事件
|
||||
* 2021-12-29: V3.0.9 增加修改文字颜色
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
@ -421,6 +422,15 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AfterSetForeColor(Color color)
|
||||
{
|
||||
base.AfterSetForeColor(color);
|
||||
if (listbox != null)
|
||||
{
|
||||
listbox.ForeColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
private int LastCount;
|
||||
|
||||
private int lastBarValue = -1;
|
||||
|
@ -673,7 +673,7 @@ namespace Sunny.UI
|
||||
mask.Tag = baseForm;
|
||||
mask.Text = topmost.ToString();
|
||||
|
||||
var pt = control.LocationOnScreen();
|
||||
var pt = control.ScreenLocation();
|
||||
mask.Left = pt.X;
|
||||
mask.Top = pt.Y;
|
||||
mask.Show();
|
||||
|
Loading…
x
Reference in New Issue
Block a user