C#能不能做到这样的效果:一个文件夹在应用程序窗口下面,窗体设置为半透明的(这个我会),在文件夹上面双击,应用程序窗口没有影响,却打开了那个文件夹? 实际上就是忽略前面的窗体的阻挡,好像它不存在一般。

解决方案 »

  1.   

    Dialog,
      或者就是一个全屏的窗体.
      

  2.   

    写一个双击的事件  双击以后 获取windows的双击坐标 用消息发给windows点击windows的位置
    期间把程序最小化 和还原夹在发消息中间,程序隐藏和显示执行的速度很快  用户是看不出来的这里只提供思想
      

  3.   

    Opacity = 0.5;
    TransparencyKey = BackColor;
      

  4.   

    写一个双击的事件  双击以后 获取windows的双击坐标 用消息发给windows点击windows的位置 
    期间把程序最小化 和还原夹在发消息中间,程序隐藏和显示执行的速度很快  用户是看不出来的 这里只提供思想
      

  5.   

    我倒是觉得这个很像暴风或者KMP的层叠式窗口放到最上面的功能。
    还有WINDOWS任务管理器里面的选项-前端显示的功能。
    这个应该是windows 的API里面有吧,不知道调用哪个,查一下吧
      

  6.   

    就是把 WM_LBUTTONDBLCLICK 消息转发给父窗口
      

  7.   

    我的看法跟21楼差不多。
    唯一差别就是,把 WM_LBUTTONDBLCLICK 发送给 explorer.exe 
    而不是发给父窗口。
      

  8.   

    9楼的方法很方便,更详细的,如果不想修改代码,可以将form的属性里的backgroundcolor设置成自己想要的,然后在TransparencyKey属性里设置成背景色对应的颜色即可
      

  9.   


    //实现窗体鼠标穿透
    public const int GWL_EXSTYLE = -20;
    public const uint WS_EX_LAYERED = 0x80000;
    public const int WS_EX_TRANSPARENT = 0x20;
    public const int LWA_ALPHA = 0x2;
    [DllImport("user32", EntryPoint = "SetWindowLong")]
    public static extern uint SetWindowLong(IntPtr hwnd, int nIndex, uint dwNewLong);[DllImport("user32", EntryPoint = "GetWindowLong")]
    public static extern uint GetWindowLong(IntPtr hwnd, int nIndex);[DllImport("user32", EntryPoint = "SetLayeredWindowAttributes")]
    public static extern int SetLayeredWindowAttributes(IntPtr hwnd, int crKey, int bAlpha, int dwFlags);
    //实现代码
    GetWindowLong(this.Handle, GWL_EXSTYLE);
    SetWindowLong(this.Handle, GWL_EXSTYLE, intExTemp | WS_EX_TRANSPARENT | WS_EX_LAYERED);
    SetLayeredWindowAttributes(this.Handle, 0, 100, LWA_ALPHA);