WebBrowserExtensions

Wisej.Web.Markup.WebBrowserExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.0.0.0)

Adds fluent markup extension methods to the Timer class.

public class WebBrowserExtensions

Methods

BorderStyle<TWebBrowser>(webBrowser, borderStyle)

Sets the BorderStyle property of the specified WebBrowser.

Parameter
Type
Description

TWebBrowser

The type of the web browser, must inherit from WebBrowser.

webBrowser

The web browser for which to set the BorderStyle property.

borderStyle

The 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);

OnDocumentCompleted<TWebBrowser>(webBrowser, action)

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

Parameter
Type
Description

TWebBrowser

The type of the web browser, must inherit from WebBrowser.

webBrowser

The web browser to attach the event handler to.

action

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!");
});

ScrollBarsEnabled<TWebBrowser>(webBrowser, scrollBarsEnabled)

Sets the ScrollBarsEnabled property of the specified WebBrowser.

Parameter
Type
Description

TWebBrowser

The type of the web browser, must inherit from WebBrowser.

webBrowser

The web browser for which to set the ScrollBarsEnabled property.

scrollBarsEnabled

A 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);

Url<TWebBrowser>(webBrowser, url)

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

Parameter
Type
Description

TWebBrowser

The type of the web browser, must inherit from WebBrowser.

webBrowser

The web browser for which to set the Url property.

url

The 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");

Url<TWebBrowser>(webBrowser, url)

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

Parameter
Type
Description

TWebBrowser

The type of the web browser, must inherit from WebBrowser.

webBrowser

The web browser for which to set the Url property.

url

The 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"));

Last updated

Was this helpful?