twinBASIC WebView2 Getting Started - twinbasic/documentation GitHub Wiki

Getting Started

Package requirements

To create projects that use WebView2, your projects must include both the WinNativeForms package and the WebView2 package in your projects.

Both of these packages can be added through the Project > References menu option, and selecting the TWINPACK PACKAGES button. Ensure both packages are ticked, and then close and save the Settings file and restart the compiler.

Once you've added the package references, you should find that the WebView2 control is now available to you in the form designer:

Create a WebView2 control on a form

We use the WebView2 control just like any ordinary control:

WebView2 control properties

There are lots of WebView2 properties and events to experiment with.

Samples

If you prefer to start with a sample, have a look at Sample 0. WebView2 Examples, available in the new-project dialog: