• 保存到桌面加入收藏设为首页
技术

C# 实现透明textbox、透明richtextbox

作者:CrazyEditor   来源:CrazyEditor.cn  
public class TransTextBox : RichTextBox
{
    [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
    static extern IntPtr LoadLibrary(string lpFileName);

    protected override CreateParams CreateParams
    {
        get
        {
            CreateParams prams = base.CreateParams;
            if (LoadLibrary("msftedit.dll") != IntPtr.Zero)
            {
                prams.ExStyle |= 0x020;
                prams.ClassName = "RICHEDIT50W";
            }
            return prams;
        }
    }
}

上一篇:没有了
下一篇:C# TransparentPanel 组件的实现方法

(C) 2018-2019 疯狂小编