protected override void InitControls()
        {
            this.Text            = "WebAssemblyRunner";
            this.Name            = "WebAssemblyRunner";
            this.StatusBar       = true;
            this.Width           = 800;
            this.Height          = 600;
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;
            this.IconFile        = "App.ico";


            this._Browser = new NativeWebBrowser
            {
                Width  = this.Width,
                Height = this.Height,
                DefaultContextMenusEnabled = false,
                DevToolsEnabled            = false,
                AutoDock = true
            };

            this._Browser.WebViewCreated      += OnWebWindowCreated;
            this._Browser.ProcessFailed       += OnProcessFailed;
            this._Browser.ContentLoading      += OnContentLoading;
            this._Browser.NavigationStart     += OnNavigationStart;
            this._Browser.NavigationCompleted += OnNavigationCompleted;
            this._Browser.PermissionRequested += OnPermissionRequested;


            this.Controls.Add(this._Browser);
        }
        protected override void InitControls()
        {
            base.InitControls();
            this.Text            = "WebBrowser";
            this.Name            = "BrowserWindow";
            this.StatusBar       = true;
            this.IconFile        = "Browser.ico";
            this.Width           = 600;
            this.Height          = 400;
            this.StatusBar       = true;
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;

            this._Browser = new NativeWebBrowser()
            {
                Width                      = this.Width,
                Height                     = this.Height,
                Url                        = "http://localhost:1",
                IsStatusBarEnabled         = true,
                DefaultContextMenusEnabled = false,
                DevToolsEnabled            = false,
                EnableMonitoring           = true,
                //BrowserExecutableFolder = ".\\edge",
                BrowserUserDataFolder = "C:\\tmp\\diga",
                MonitoringFolder      = ".\\wwwroot",
                MonitoringUrl         = "http://localhost:1/",
                AutoDock = true
            };
            this._Browser.DocumentTitleChanged  += OnDocumentTitleChanged;
            this._Browser.NavigationStart       += OnNavigationStart;
            this._Browser.NavigationCompleted   += OnNaviationCompleted;
            this._Browser.WebResourceRequested  += OnWebResourceRequested;
            this._Browser.AcceleratorKeyPressed += OnAccessorKeyPressed;
            this.Controls.Add(this._Browser);
        }
Ejemplo n.º 3
0
        protected override void InitControls()
        {
            this.Text            = "WebBrowser";
            this.Name            = "BrowserWindow";
            this.StatusBar       = true;
            this.IconFile        = "Browser.ico";
            this.Width           = 800;
            this.Height          = 600;
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;


            this._Browser = new NativeWebBrowser()
            {
                Width                      = this.Width,
                Height                     = this.Height,
                Url                        = "http://localhost:1",
                IsStatusBarEnabled         = true,
                DefaultContextMenusEnabled = false,
                DevToolsEnabled            = false,
                EnableMonitoring           = true,
                MonitoringFolder           = ".\\wwwroot",
                MonitoringUrl              = "http://localhost:1/",
                AutoDock                   = true
            };
            this._Browser.DocumentTitleChanged += OnDocumentTitleChanged;
            this._Browser.NavigationStart      += OnNavigationStart;
            this._Browser.NavigationCompleted  += OnNaviationCompleted;
            this._Browser.WebResourceRequested += OnWebResourceRequested;
            this._Browser.WebMessageReceived   += OnWebMessageReceived;
            this.Controls.Add(this._Browser);
        }
Ejemplo n.º 4
0
        //public Window2(NativeWindow parent) : base(parent)
        //{

        //}
        protected override void InitControls()
        {
            this.Text   = "Dies ist ein 2. Fenster";
            this.Name   = "Window2";
            this.Left   = 100;
            this.Top    = 100;
            this.Width  = 600;
            this.Height = 400;

            this.Click               += Window2_Click;
            this.DoubleClick         += Window2_DblClick;
            this.Create              += Window2_Create;
            this._WebBrowser          = new NativeWebBrowser();
            this._WebBrowser.Location = new Diga.Core.Api.Win32.Point(100, 100);
            this._WebBrowser.Width    = 200;
            this._WebBrowser.Height   = 200;
            this._WebBrowser.Url      = "https://www.google.de";

            this._Button          = new NativeButton();
            this._Button.Left     = 100;
            this._Button.Top      = 100;
            this._Button.Width    = 100;
            this._Button.Height   = 30;
            this._Button.Text     = "Add a Button";
            this._Button.Name     = "nativeButton";
            this._Button.Clicked += Button_AddButton;

            this._Link              = new NativeLink();
            this._Link.Left         = 200;
            this._Link.Top          = 100;
            this._Link.Width        = 300;
            this._Link.Height       = 25;
            this._Link.Text         = "For more information, <A ID=\"TEST\" HREF=\"https://www.microsoft.com\">click here</A> or <A ID=\"idInfo\">here</A>.";
            this._Link.LinkClicked += Link_Clicked;
            this._Link.Font         = new Font()
            {
                Name = "Arial", Size = 12
            };

            this._GroupBox        = new NativeGroupBox();
            this._GroupBox.Left   = 100;
            this._GroupBox.Top    = 250;
            this._GroupBox.Width  = 300;
            this._GroupBox.Height = 100;
            this._GroupBox.Text   = "TEST";


            this.Controls.Add(this._WebBrowser);
            this.Controls.Add(this._Button);
            this.Controls.Add(this._Link);
            this.Controls.Add(this._GroupBox);
        }
Ejemplo n.º 5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this._Panel1Window = new CoreWindowsWrapper.NativeWindow(this.panel1.Handle);
            this._Panel2Window = new CoreWindowsWrapper.NativeWindow(this.panel2.Handle);
            this._NativeWindow = new CoreWindowsWrapper.NativeWindow(this.Handle);

            this._Panel2Window.Size += OnSize;
            NativeMenu menuFile = new NativeMenu("mnuFile", "&File");

            //Create Sub-Items for File-Menu
            NativeMenuItem menuFileOpen  = new NativeMenuItem("mnuOpen", "&Open");
            NativeMenuItem menuFileClose = new NativeMenuItem("mnuSave", "&Save");
            NativeMenuItem menuFileSep   = new NativeMenuItem("mnuFileSep")
            {
                IsSeparator = true
            };
            NativeMenuItem menFileExit = new NativeMenuItem("mnuExit", "E&xit");

            //Add Menu Event Handlers
            menuFileClose.Click += FileSave_Click;
            menuFileOpen.Click  += FileOpen_Click;
            menFileExit.Click   += Menu_Exit;

            //Add The Sub-Items to File-Menu
            menuFile.Items.Add(menuFileOpen);
            menuFile.Items.Add(menuFileClose);
            menuFile.Items.Add(menuFileSep);
            menuFile.Items.Add(menFileExit);

            //Create Help-Menu
            NativeMenu menuHelp = new NativeMenu("&Help");
            //Add Sub-Item to Help-Menu
            NativeMenuItem menuInfo = new NativeMenuItem("&Info");

            //Add Event-Handler
            menuInfo.Click += MenuInfo_Click;
            //Add the Sub-Item to the Help-Menu
            menuHelp.Items.Add(menuInfo);
            //Add the Help-Menu to the File-Menu
            menuFile.Items.Add(menuHelp);
            this._NativeWindow.Menu      = menuFile;
            this._NativeWindow.BackColor = CoreWindowsWrapper.Tools.ColorTool.White;


            this._Button = new NativeButton
            {
                Left   = 10,
                Top    = 0,
                Width  = 100,
                Height = 30,
                Text   = "<",
                Font   = new Font()
                {
                    Name = "Segoe UI Symbol", Size = 15
                },
                Name      = "bnTestA",
                BackColor = ColorTool.Blue,
                ForeColor = ColorTool.Green
            };

            this._Button.Font.Name = "Segoe UI ";

            this._Button1 = new NativeButton
            {
                Left   = 150,
                Top    = 0,
                Width  = 100,
                Height = 30,
                Text   = ">",
                Name   = "bnTestB" //,
                                   //ControlId = 505
            };
            this._Button.Clicked += button_OnClicked;

            this._Button1.Clicked += button1_OnClicked;


            this._WebBrowser = new NativeWebBrowser()
            {
                Width                      = this._NativeWindow.Width,
                Height                     = this._NativeWindow.Height,
                Url                        = "http://www.itagnesmeyer.de",
                IsStatusBarEnabled         = true,
                DefaultContextMenusEnabled = false,
                DevToolsEnabled            = false
            };

            this._Panel2Window.Controls.Add(this._WebBrowser);
            this._Panel1Window.Controls.Add(this._Button);
            this._Panel1Window.Controls.Add(this._Button1);


            this._NativeWindow.PostCreateControls();
        }