WebBrowserExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the Timer class.
- C#
- VB.NET
public class WebBrowserExtensions
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 | TWebBrowser | The web browser for which to set the BorderStyle property. |
| borderStyle | 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 | TWebBrowser | The web browser to attach the event handler to. |
| action | Action<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!");
});
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 | TWebBrowser | The web browser for which to set the ScrollBarsEnabled property. |
| scrollBarsEnabled | Boolean | 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 | TWebBrowser | The web browser for which to set the Url property. |
| url | String | 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 | TWebBrowser | The web browser for which to set the Url property. |
| url | Uri | 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"));