2011-07-05 11 views

Odpowiedz

12
[StructLayout(LayoutKind.Sequential)] 
public struct MARGINS 
{ 
    public int Left; 
    public int Right; 
    public int Top; 
    public int Bottom; 
} 

[DllImport("dwmapi.dll")] 
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins); 

Następnie można włączyć go na swojej postaci tak:

MARGINS marg = new MARGINS() { Left = -1, Right = -1, Top = -1, Bottom = -1 }; 
DwmExtendFrameIntoClientArea(form.Handle, marg); 
+1

Dzięki, to wystarczyły. Powinieneś naprawić strukturę tak, aby była w tagach kodowych. –

+1

Cool. BTW 'marg' powinno zostać przekazane do' DwmExtendFrameIntoClientArea' jako 'ref' (tj.' DwmExtendFrameIntoClientArea (form.Handle, ref marg);)) –