You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
906 B

1 month ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Diagnostics;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Runtime.InteropServices;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace Customize.Controls
  12. {
  13. public class TransTextBox : RichTextBox
  14. {
  15. [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
  16. static extern IntPtr LoadLibrary(string lpFileName);
  17. protected override CreateParams CreateParams
  18. {
  19. get
  20. {
  21. CreateParams prams = base.CreateParams;
  22. if (LoadLibrary("msftedit.dll") != IntPtr.Zero)
  23. {
  24. prams.ExStyle |= 0x020; // transparent
  25. prams.ClassName = "RICHEDIT50W";// TRANSTEXTBOXW
  26. }
  27. return prams;
  28. }
  29. }
  30. }
  31. }