[This is preliminary documentation and is subject to change.]

Occurs when an ISurface is requested by the view. Usually, every time the size of the view changes. You should return your own ISurface implementation here.

Namespace: Awesomium.Windows.Controls
Assembly: Awesomium.Windows.Controls (in Awesomium.Windows.Controls.dll) Version: (


public event CreateSurfaceEventHandler CreateSurface
Visual Basic
Public Event CreateSurface As CreateSurfaceEventHandler
Visual C++
virtual  event CreateSurfaceEventHandler^ CreateSurface {
	void add (CreateSurfaceEventHandler^ value);
	void remove (CreateSurfaceEventHandler^ value);




When CreateSurface is called, Surface reflects the previously assigned ISurface instance. If your surface is capable of handling resizing, you can keep on using the same ISurface instance on multiple CreateSurface calls.

When CreateSurface is called for the first time, Surface returns the ISurface assigned to the view using Surface or, if no ISurface instance has been previously specified, the default ISurface assigned to the view by Awesomium.NET. This is either a BitmapSurface (for WebView instances) or a technology specific ISurface.

If you are using an ISurface instance capable of handling changes in size, you should better use Surface to assign your surface. This surface will be used with multiple calls of CreateSurface and it should be able to handle changes in size during Initialize(IWebView, Int32, Int32). In this scenario, you can ignore the CreateSurface event.

See Also