C#的代码
win2000/winxp操作系统

解决方案 »

  1.   

    画个Form,颜色和透明度设置一下,TopMost = true;不行吗?
      

  2.   

    楼上说的有道理,同时我认为难解决的是去掉了form的边框后,怎么移动?这个移动函数怎么写?
      

  3.   

    private Point MouseSet;
    private bool IsMouseDown;private void Login_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    int Xoffset;
    int Yoffset;
    if(e.Button==MouseButtons.Left)
    {
    Xoffset=-e.X-SystemInformation.FrameBorderSize.Width;
    Yoffset=-e.Y-SystemInformation.FrameBorderSize.Height;
    MouseSet=new Point(Xoffset,Yoffset);
    IsMouseDown=true;
    }
    } private void Login_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    if(IsMouseDown)
    {
     Point MousePos=Control.MousePosition;
    MousePos.Offset(MouseSet.X,MouseSet.Y);
    Location=MousePos; }
    } private void Login_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    if(e.Button==MouseButtons.Left)
    {
    IsMouseDown=false;
    }
    }这样不行吗
      

  4.   

    其实修改窗体的HITTEST就可以了一律返回HITTEST为标题栏的HITTEST,就可以拉着窗体到处跑了以前VC都这么干的,C#中也可以用HITTEST,只是消息处理这里可能要麻烦一些
      

  5.   

    看来这问题已经解决了,我已经做出效果来了.
    1设置form的一些属性
        this.FormBorderStyle = FormBorderStyle.None; //去掉边框
             this.TopMost = true;  //设为最上一层
    2写移动函数
    参考
    fengyuhong() ( )的函数(其实就是c#做不规则窗体那一篇文章的移动函数,怪不得我怎么越看越觉得眼熟悉呢,哈哈 ^-^,不过会找资料是一种能力,而且是程序员必须具备的能力哈)
      

  6.   

    ……我做了个完全模拟FLASHGET的界面,包括悬浮窗以及下载时的下载速度的效果,需要的话跟我联系17353886
      

  7.   

    c#拖动无标题窗体 1.引入命名空间
        using System.Runtime.InteropServices;
    2.
        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        public const int WM_SYSCOMMAND = 0x0112;
        public const int SC_MOVE = 0xF010;
        public const int HTCAPTION = 0x0002;
    3.在空间的_MouseDown中加入如下代码:
       如:
        private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
          ReleaseCapture();
          SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
    }