Day 326
Working on implementing CefSharp on a work project.
#CodingPhase #TheCodingWay #365CodingPhaseChallenge
**********
using System;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace testingCEF
{
public partial class Form1 : Form
{
public ChromiumWebBrowser chromeBrowser;
public Form1()
{
InitializeComponent();
// At the initialization, start cromium
InitializeChromium();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void InitializeChromium()
{
CefSettings settings = new CefSettings();
// Initialize ef with the provided settings
Cef.Initialize(settings);
// Create a browser component
// And provide a start web URL
chromeBrowser = new ChromiumWebBrowser("https://ew23.ultipro.com");
// Add the browser to the form
this.Controls.Add(chromeBrowser);
// Make the browser fill the form
chromeBrowser.Dock = DockStyle.Fill;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Cef.Shutdown();
}
}
}
#CodingPhase #TheCodingWay #365CodingPhaseChallenge
**********
using System;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace testingCEF
{
public partial class Form1 : Form
{
public ChromiumWebBrowser chromeBrowser;
public Form1()
{
InitializeComponent();
// At the initialization, start cromium
InitializeChromium();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void InitializeChromium()
{
CefSettings settings = new CefSettings();
// Initialize ef with the provided settings
Cef.Initialize(settings);
// Create a browser component
// And provide a start web URL
chromeBrowser = new ChromiumWebBrowser("https://ew23.ultipro.com");
// Add the browser to the form
this.Controls.Add(chromeBrowser);
// Make the browser fill the form
chromeBrowser.Dock = DockStyle.Fill;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Cef.Shutdown();
}
}
}
Comments
Post a Comment