RT
解决方案 »
- 请教ProgressBar问题?
- C#如何从数据库里读取iamge类型的数据,让其显示在pictureBox里
- C#+sybase12.5,查询出的汉字显示乱码,如何解决这个问题?
- 求:PC端解析电信基站信息为实际经纬度免费调用接口
- sql 获取某列字段 某一条件范围内的条数
- 使用NPOI导入Excel遇到的问题
- C# 将xml文件导入sql数据库表中
- C#中如何取到DataGrid控件中某一行某一列的值?
- 怎样才能把做好的图标文件加到EXE中去?(为什么每次我做的时候它总是在外面)
- 贺喜巴西2:1
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();这句话求教
- 初学者的问题,送分啦!
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Point[] p1 ={ new Point(3, 15), new Point(766, 15), new Point(766, 209), new Point(3, 209), new Point(3, 15) };
GraphicsPath shape = new GraphicsPath();
shape.AddLines(p1);
this.Region = new Region(shape);
}这样的话假定的窗体大小是(766,209),标题栏占用宽15;
你试一下,是可以的.
要添加引用
using System.Drawing.Drawing2D;
using System.Drawing;
[DllImport("user32.dll", EntryPoint="SetWindowLong")]
public static extern int SetWindowLong (
int hwnd,
int nIndex,
int dwNewLong
);[DllImport("user32.dll", EntryPoint="GetWindowLong")]
public static extern int GetWindowLong (
int hwnd,
int nIndex
);public const int GWL_STYLE = (-16);
public const int WS_SYSMENU = 0x80000;//实现代码
public static void AddSystemMenuToForm(IntPtr WindowHandle)
{
int oldStyle = GetWindowLong(WindowHandle.ToInt32(),GWL_STYLE);
SetWindowLong(WindowHandle.ToInt32(),GWL_STYLE,oldStyle|WS_SYSMENU);
}//调用
AddSystemMenuToForm(this);