小编Maz*_*516的帖子

Win32不存在 - 我如何声明或引用它?

我正在尝试使用我发现使用Win32的代码.但是,我收到此错误:

名称'Win32'在当前上下文中不存在.

我错过了什么?你怎么称呼/声明Win32?

public class TransparentTextBox : TextBox
{
    PictureBox pictureBox = new PictureBox();
    public TransparentTextBox()
    {
        pictureBox.Dock = DockStyle.Fill;
        this.Controls.Add(pictureBox);
    }
    protected override void WndProc(ref Message m)
    {

        base.WndProc(ref m);
        switch (m.Msg)
        {
            case Win32.WM_PAINT:

                Bitmap bmpCaptured =
                  new Bitmap(this.ClientRectangle.Width, this.ClientRectangle.Height);
                Bitmap bmpResult =
                  new Bitmap(this.ClientRectangle.Width, this.ClientRectangle.Height);
                Rectangle r =
                  new Rectangle(0, 0, this.ClientRectangle.Width,
                  this.ClientRectangle.Height);

                CaptureWindow(this, ref bmpCaptured);
                this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
                this.BackColor = Color.Transparent;

                ImageAttributes imgAttrib = new ImageAttributes();

                ColorMap[] colorMap = new ColorMap[1];

                colorMap[0] = new ColorMap();

                colorMap[0].OldColor = …
Run Code Online (Sandbox Code Playgroud)

c# winapi

2
推荐指数
1
解决办法
2459
查看次数

定时器在C#中,定时器开始滴答?

我的问题是计时器何时开始计时.

让我们举个例子,配置为每秒打勾的计时器,然后启动我的程序hh:mm:ss:ms = 22:40:34.50.勾号将在第二轮开始?开始17:40:35.00或确切的时间开始?因此,第一个刻度将打开17:40:35.50,下一个打开17:40:36.50.

实际上我想要解决的是我想让功能05:00:00.00 AM每天都工作但只有一次.我建立了一个工作时间系统,有时工人忘记"关闭"他们的班次,所以在凌晨5点我想检查谁没有关闭,并对此做出错误.你觉得我怎么能解决问题?

c# timer

0
推荐指数
1
解决办法
1960
查看次数

标签 统计

c# ×2

timer ×1

winapi ×1