• 大小: 0.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: winform  

资源简介

鼠标穿透效果实例,可实现类似桌面浮动效果,详见截图

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace CalendarPenetrate
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Point CPoint;
        private void monthCalendar1_MouseDown(object sender MouseEventArgs e)
        {
            CPoint = new Point(-e.X -e.Y);
        }

        private void monthCalendar1_MouseMove(object sender MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point myPosittion = Control.MousePosition;//获取当前鼠标的屏幕坐标
                myPosittion.Offset(CPoint.X CPoint.Y);//重载当前鼠标的位置
                this.DesktopLocation = myPosittion;//设置当前窗体在屏幕上的位置
            }
        }

        private const uint WS_EX_layerED =

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-11 21:43  鼠标穿透\
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\
     文件         941  2009-02-07 14:10  鼠标穿透\CalendarPenetrate.sln
     文件       14336  2009-02-07 14:21  鼠标穿透\CalendarPenetrate.suo
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\bin\
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\bin\Debug\
     文件       13824  2009-02-07 14:18  鼠标穿透\CalendarPenetrate\bin\Debug\CalendarPenetrate.exe
     文件       26112  2009-02-07 14:18  鼠标穿透\CalendarPenetrate\bin\Debug\CalendarPenetrate.pdb
     文件       14328  2009-02-07 14:21  鼠标穿透\CalendarPenetrate\bin\Debug\CalendarPenetrate.vshost.exe
     文件         490  2007-07-21 01:33  鼠标穿透\CalendarPenetrate\bin\Debug\CalendarPenetrate.vshost.exe.manifest
     文件        3745  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\CalendarPenetrate.csproj
     文件        3261  2009-02-07 14:18  鼠标穿透\CalendarPenetrate\Form1.cs
     文件        4493  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\Form1.Designer.cs
     文件       11423  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\Form1.resx
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\Image\
     文件        3262  2007-07-11 10:39  鼠标穿透\CalendarPenetrate\Image\明日图标(2).ico
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\obj\
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\obj\Debug\
     文件        1122  2009-02-07 14:21  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.csproj.FileListAbsolute.txt
     文件         847  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.csproj.GenerateResource.Cache
     文件       13824  2009-02-07 14:18  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.exe
     文件        3840  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.Form1.resources
     文件       26112  2009-02-07 14:18  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.pdb
     文件         180  2009-02-07 14:17  鼠标穿透\CalendarPenetrate\obj\Debug\CalendarPenetrate.Properties.Resources.resources
     目录           0  2012-05-02 09:50  鼠标穿透\CalendarPenetrate\obj\Debug\TempPE\
     文件         498  2009-02-07 14:10  鼠标穿透\CalendarPenetrate\Program.cs
     目录           0  2013-01-11 21:43  鼠标穿透\CalendarPenetrate\Properties\
     文件        1366  2009-02-07 14:10  鼠标穿透\CalendarPenetrate\Properties\AssemblyInfo.cs
     文件        2884  2009-02-07 14:10  鼠标穿透\CalendarPenetrate\Properties\Resources.Designer.cs
     文件        5612  2009-02-07 14:10  鼠标穿透\CalendarPenetrate\Properties\Resources.resx
     文件        1102  2009-02-07 14:10  鼠标穿透\CalendarPenetrate\Properties\Settings.Designer.cs
............此处省略1个文件信息

评论

共有 条评论