C#的winform程序下如何实现文本编辑框(TextBox)的Hint提示文字效果

[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SendMessage(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);

public static void SetHintText(Control control, string text)
{
  SendMessage(control.Handle, 0x1501, 0, text);
}

下面连接是网络上找到的http://jileniao.net/post-112.html

原文地址:https://www.cnblogs.com/heyanpeng/p/4023941.html