WPF de-border conflicts with WebBrowser

Source: Internet
Author: User

First build a class, such as NativeMethods.cs

Class nativemethods{Public const int ws_caption=0x00c0000;    public const int ws_border=0x00800000;    public const int ws_dlgframe=0x00400000;    public const int GWL_STYLE=-16;    [DllImport ("user32", entrypoint= "GetWindowLong")] public static extern int GetWindowLong (INTPTR handle, int sytle); [DllImport ("user32", entrypoint= "SetWindowLong")] public static extern int SetWindowLong (INTPTR handle, int oldstyle, int new Style);}

And then in your form code, like MainWindow.xaml.cs.

public partial class mainwindow:window{IntPtr hwnd=new System.Windows.Interop.WindowInteropHelper (this).    Handle;    int Oldstyle=nativemethods.getwindowlong (Hwnd,nativemethods.gwl_style); Nativemethods.setwindowlong (hwnd,nativemethods.gwl_style,oldstyle&~nativemethods.ws_border&~ Nativemethods.ws_caption&~nativemethods.ws_dlgframe);}    Public MainWindow () {InitializeComponent (); This.    loaded+=window_loaded; Other statements in the form}


This makes the outer window without a native button (maximum minimum off), no border, no border.

WPF de-border conflicts with WebBrowser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.