窗体最大化以后,窗体不能移动,应如何实现.(C#)
解决方案 »
- Discuz!X2论坛搜索及正则表达式?
- .net(c#)分页问题
- 请教怎么声明函数的参数类型?
- 在C#中如何得到一个数的二进制
- c#中如何判断一个string能否转换为int32?
- 关于继承的问题。
- 急!高分求救!邮件的编码问题??
- 如何将string转换成一个Byte数组?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
- Array in Structure when calling functions in dll writtern in c
- csdn的用户登陆是如何实现的?
- 如何妨止程序在 Vista 下因 UAC的原因,在运行时老是弹出那个安全对话框?
- 关于获得动态时间的问题~~~~~
就不能移动了,但是也没有边框了!还有一种方法,就是整个窗口重画,也不能移动!
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
private System.ComponentModel.Container components = null;
[STAThread]
static void Main()
{
Application.Run(new Form1());
} [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;
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle,WM_SYSCOMMAND,SC_MOVE+HTCAPTION, 0);
}
请问lsj_zrp您说的重画窗体是什么意思.请说详细点.谢谢!!!
______________________________________________________
狂晕,maximizebox属性设为false后还能最大化吗?难道你是让它启动是Maximized的。
如果不是你可以在this.move事件里面添这么一句,不过这样会让窗体有点闪烁
this.Location = new Point(0, 0);