把标题栏去掉,或者不响应 WM_NCLBUTTONDOWN 消息试试
解决方案 »
- C#中,像int i = 2; string s = i.toString();这样的类型转换会进行装箱操作吗?
- 怎么把xml文件读到dataset里面的一个tabel里面?
- WPF DataGrid中DataGridCheckBoxColumn得问题
- 算法问题 很难的!!
- 大家帮助看看这个有意思的问题吧@!!!!!
- 在windows应用程序中 我想点一按纽即复制textbox里的内容 如何实现?
- 如何在程序里让DataGrid按某一列从大到小排序
- 怎样在C#中向用C++写的托管代码传递字符串?
- lhx1977(清水无鱼),进来领分!
- 请问那有.net构建多层应用程序的例子、代码!
- 关于文档内容的自动提取如何实现?
- 背景闪烁问题
using System.Windows.Forms;
using System.Runtime.InteropServices; class Test : Form
{
const int MF_BYPOSITION = 0x0400;
const int MF_REMOVE = 0x1000; [DllImport("user32.dll",EntryPoint="GetSystemMenu")]
extern static IntPtr GetSystemMenu(IntPtr hWnd, IntPtr bRevert); [DllImport("user32.dll",EntryPoint="RemoveMenu")]
extern static int RemoveMenu(IntPtr hMenu, int nPos, int flags); Test()
{
Text = "不能移动和改变大小的窗口";
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
RemoveMenu(GetSystemMenu(Handle,IntPtr.Zero),1,MF_BYPOSITION|MF_REMOVE);
} static void Main()
{
Application.Run(new Test());
}
}
class Test : Form
{
Test()
{
Text = "去掉系统菜单的标题栏";
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
}
const int WS_SYSMENU = 0x00080000;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style = cp.Style & ~WS_SYSMENU;
return cp;
}
}
static void Main()
{
Application.Run(new Test());
}
}