Skip to main content
Version: 4.1

WebBrowserExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the Timer class.

public class WebBrowserExtensions

Methods

Static member BorderStyle<TWebBrowser>(webBrowser, borderStyle)

Sets the BorderStyle property of the specified WebBrowser.

ParameterTypeDescription
TWebBrowserThe type of the web browser, must inherit from WebBrowser.
webBrowserTWebBrowserThe web browser for which to set the BorderStyle property.
borderStyleBorderStyleThe BorderStyle to set for the web browser.

Returns: TWebBrowser. The modified web browser with the updated BorderStyle property.

This method allows you to specify the border style for the web browser.


myWebBrowser.BorderStyle(BorderStyle.FixedSingle);

Static member OnDocumentCompleted<TWebBrowser>(webBrowser, action)

Attaches an event handler for the DocumentCompleted event of the specified WebBrowser.

ParameterTypeDescription
TWebBrowserThe type of the web browser, must inherit from WebBrowser.
webBrowserTWebBrowserThe web browser to attach the event handler to.
actionAction<TWebBrowser, WebBrowserDocumentCompletedEventArgs>An action to execute when the document has completed loading.

Returns: TWebBrowser. The modified web browser with the attached DocumentCompleted event handler.

This method allows you to execute a custom action whenever the document in the web browser completes loading.


myWebBrowser.OnDocumentCompleted((wb, args) =>
{
AlertBox.Show("Document loaded!");
});

Static member ScrollBarsEnabled<TWebBrowser>(webBrowser, scrollBarsEnabled)

Sets the ScrollBarsEnabled property of the specified WebBrowser.

ParameterTypeDescription
TWebBrowserThe type of the web browser, must inherit from WebBrowser.
webBrowserTWebBrowserThe web browser for which to set the ScrollBarsEnabled property.
scrollBarsEnabledBooleanA boolean indicating whether scroll bars are enabled.

Returns: TWebBrowser. The modified web browser with the updated ScrollBarsEnabled property.

This method allows you to enable or disable scroll bars in the web browser.


myWebBrowser.ScrollBarsEnabled(true);

Static member Url<TWebBrowser>(webBrowser, url)

Sets the Url property of the specified WebBrowser using a string.

ParameterTypeDescription
TWebBrowserThe type of the web browser, must inherit from WebBrowser.
webBrowserTWebBrowserThe web browser for which to set the Url property.
urlStringThe URL to navigate to, as a string.

Returns: TWebBrowser. The modified web browser with the updated Url property.

This method allows you to navigate the web browser to a specified URL using a string.


myWebBrowser.Url("http://example.com");

Static member Url<TWebBrowser>(webBrowser, url)

Sets the Url property of the specified WebBrowser using a Uri.

ParameterTypeDescription
TWebBrowserThe type of the web browser, must inherit from WebBrowser.
webBrowserTWebBrowserThe web browser for which to set the Url property.
urlUriThe URL to navigate to, as a Uri.

Returns: TWebBrowser. The modified web browser with the updated Url property.

This method allows you to navigate the web browser to a specified URL using a Uri.


myWebBrowser.Url(new Uri("http://example.com"));