-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCueTextBox.cs
45 lines (39 loc) · 1.04 KB
/
CueTextBox.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace StickyNote
{
class CueTextBox : TextBox
{
[Localizable(true)]
public string Cue
{
get { return mCue; }
set
{
mCue = value;
updateCue();
}
}
private void updateCue()
{
if (this.IsHandleCreated && mCue != null)
{
SendMessage(this.Handle, 0x1501, (IntPtr) 1, mCue);
}
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
updateCue();
}
private string mCue;
// PInvoke
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, string lp);
}
}