private const int EM_SETCUEBANNER = 0x1501; [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern Int32 SendMessage (IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); private void Form6_Load(object sender, EventArgs e) { SendMessage(textBox1.Handle, EM_SETCUEBANNER, 0, "请输入"); SendMessage(textBox2.Handle, EM_SETCUEBANNER, 0, "请输入"); }
时间: 2024-10-10 08:18:27