mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
again...
This commit is contained in:
parent
b1756fb888
commit
5be4d0ee4e
@ -1,8 +1,36 @@
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Controls
|
||||
{
|
||||
public class NikseTextBox : TextBox
|
||||
{
|
||||
private const int WM_NCPAINT = 0x85;
|
||||
private const int WM_PAINT = 0x0f;
|
||||
|
||||
Color _focusedColor = Color.FromArgb(0, 120, 215);
|
||||
public Color FocusedColor
|
||||
{
|
||||
get => _focusedColor;
|
||||
set
|
||||
{
|
||||
_focusedColor = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
if (Focused && (m.Msg == WM_PAINT || m.Msg == WM_NCPAINT))
|
||||
{
|
||||
using (var g = this.CreateGraphics())
|
||||
{
|
||||
using (var p = new Pen(FocusedColor))
|
||||
{
|
||||
g.DrawRectangle(p, new Rectangle(0, 0, Width - 1, Height - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user