我模仿QQ-GAME做了一个程序..结果最后郁闷了..点击自己做的最大化按钮的时候.整个窗体会占用整个桌面.而且可以被移动...
求教高人.怎么让无边框窗体的最大化和普通的窗体一样?

解决方案 »

  1.   

    MaxSize?有这个属性吗?我在MSDN里面搜索没有找到.
      

  2.   

    什么 formboderstyle 为none 不过没有标题栏 自己做也可以。
    也可以这样设置 获得屏幕长宽 但可以拖动 加上最后的代码就可以禁止拖动 int upperBound;                                               
    Screen [] screens = Screen.AllScreens;                        
    upperBound = screens.GetUpperBound(0);               
    int CurrentScreenWidth=screens[0].Bounds.Width ;              
    int CurrentScreenHeight=screens[0].Bounds .Height   ;       
                this.Width =CurrentScreenWidth;                               
    this.Height =CurrentScreenHeight; ***********************************禁止拖动主窗体*********************************************//////////

    private const int WM_NCHITTEST = 0x84;
    private const int HTCLIENT = 0x1;
    private const int HTCAPTION = 0x2; protected override void WndProc(ref Message m) 
    {
    switch(m.Msg) 
    {
    case WM_NCHITTEST:
    base.WndProc(ref m);
    if ((int)m.Result == HTCAPTION)
    m.Result = (IntPtr)HTCLIENT;
    return;
    break; } base.WndProc(ref m);
    }